Skip to content

Commit

Permalink
Merge pull request #11 from thombashi/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
thombashi committed Mar 1, 2016
2 parents 9b4d507 + 4c50a7f commit a0d1a43
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 28 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ docs/_build/

# PyBuilder
target/
/.idea
convert_readme.sh
desktop.ini
README.md
misc/README.md
misc/README_HEADER.rst
misc/readme_converter.py
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ include LICENSE
include README.rst
include setup.cfg
include tox.ini
include requirements.txt
recursive-include test *
recursive-include requirements *
recursive-include misc *

global-exclude __pycache__/*
global-exclude *.pyc
45 changes: 31 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,33 +1,42 @@
**tcconfig**

.. image:: https://img.shields.io/pypi/pyversions/tcconfig.svg
:target: https://pypi.python.org/pypi/tcconfig
.. image:: https://travis-ci.org/thombashi/tcconfig.svg?branch=master
:target: https://travis-ci.org/thombashi/tcconfig

.. contents:: Table of contents
:backlinks: top
:local:

About
=====

Simple tc (traffic control) command wrapper.

Feature
Summary
=======
Simple tc command wrapper.
Easy to set up traffic control of
network bandwidth/latency/packet-loss to a network interface.

Easy to set up network traffic control. The following parameters can be
set for network interface.
Traffic control
===============

- Network bandwidth
- Network latency
- Packet loss rate
The following parameters can be set of network interfaces.

- Network bandwidth [G/M/K bps]
- Network latency [milliseconds]
- Packet loss rate [%]

Installation
============

Install via pip
---------------

tcconfig canbe installed via
`pip <https://pip.pypa.io/en/stable/installing/>`__ (Python package
manager).

.. code:: console
pip install tcconfig
sudo pip install tcconfig
Usage
=====
Expand Down Expand Up @@ -129,11 +138,19 @@ e.g.
Dependencies
============

Linux package
-------------

- iproute2 (reqrequired for tc commandured)

Python packagge
---------------

- `DataPropery <https://github.com/thombashi/DataProperty>`__
- `thutils <https://github.com/thombashi/thutils>`__

Test dependencies
-----------------
Python packagge: test dependencies
----------------------------------

- `pytest <https://pypi.python.org/pypi/pytest>`__
- `pytest-runner <https://pypi.python.org/pypi/pytest-runner>`__
Expand Down
3 changes: 3 additions & 0 deletions misc/summary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Simple tc command wrapper.
Easy to set up traffic control of
network bandwidth/latency/packet-loss to a network interface.
File renamed without changes.
24 changes: 15 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
from __future__ import with_statement
import sys
import os.path
import setuptools
import sys

import tcconfig


MISC_DIR = "misc"
REQUIREMENT_DIR = "requirements"

with open("README.rst") as fp:
long_description = fp.read()

with open("requirements.txt", "r") as fp:
requirements = fp.read().splitlines()
with open(os.path.join(MISC_DIR, "summary.txt")) as f:
summary = f.read()

with open(os.path.join(REQUIREMENT_DIR, "requirements.txt")) as f:
install_requires = [line.strip() for line in f if line.strip()]

major, minor = sys.version_info[:2]
if major == 2 and minor <= 5:
requirements.extend([
install_requires.extend([
"argparse",
])

Expand All @@ -23,15 +30,13 @@
author="Tsuyoshi Hombashi",
author_email="[email protected]",
url="https://github.com/thombashi/tcconfig",
description="""
Simple tc (traffic control) command wrapper.
Easy to set up network bandwidth/latency/packet-loss to a network interface.
""",
description=summary,
keywords=["traffic control", "bandwidth", "latency", "packet loss"],
long_description=long_description,
license="MIT License",
include_package_data=True,
packages=setuptools.find_packages(exclude=['test*']),
install_requires=requirements,
install_requires=install_requires,
setup_requires=["pytest-runner"],
tests_require=["pytest"],
classifiers=[
Expand All @@ -48,6 +53,7 @@
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Topic :: System :: Networking",
],
entry_points={
Expand Down
2 changes: 1 addition & 1 deletion tcconfig/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import thutils


VERSION = "0.1.3"
VERSION = "0.1.4"

_MIN_LOSS_RATE = 0
_MAX_LOSS_RATE = 99
Expand Down

0 comments on commit a0d1a43

Please sign in to comment.