aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-04-29 21:30:48 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-04-29 21:30:48 +1200
commit04f4f8e2a16aebe5625bf01bd01354b8952d591f (patch)
treebb02481886183e65801999ed5a35d87d3f7884fe
parentccd6eeed4b8eafcfd2530057fb645915fe335caf (diff)
downloadmitmproxy-04f4f8e2a16aebe5625bf01bd01354b8952d591f.tar.gz
mitmproxy-04f4f8e2a16aebe5625bf01bd01354b8952d591f.tar.bz2
mitmproxy-04f4f8e2a16aebe5625bf01bd01354b8952d591f.zip
setup.py, LICENSE, README.txt
-rw-r--r--LICENSE19
-rw-r--r--README.txt5
-rw-r--r--libpathod/version.py4
-rw-r--r--setup.py93
4 files changed, 121 insertions, 0 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00000000..908aa13f
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2008, Aldo Cortesi. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.txt b/README.txt
new file mode 100644
index 00000000..2dbc2f93
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,5 @@
+
+Pathod is a pathological HTTP/S server, used for testing and stressing
+unsuspecting client software.
+
+
diff --git a/libpathod/version.py b/libpathod/version.py
new file mode 100644
index 00000000..7015ac67
--- /dev/null
+++ b/libpathod/version.py
@@ -0,0 +1,4 @@
+IVERSION = (0, 1)
+VERSION = ".".join(str(i) for i in IVERSION)
+NAME = "pathod"
+NAMEVERSION = NAME + " " + VERSION
diff --git a/setup.py b/setup.py
new file mode 100644
index 00000000..6bffbe2a
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,93 @@
+from distutils.core import setup
+import fnmatch, os.path
+from libpathod import version
+
+def _fnmatch(name, patternList):
+ for i in patternList:
+ if fnmatch.fnmatch(name, i):
+ return True
+ return False
+
+
+def _splitAll(path):
+ parts = []
+ h = path
+ while 1:
+ if not h:
+ break
+ h, t = os.path.split(h)
+ parts.append(t)
+ parts.reverse()
+ return parts
+
+
+def findPackages(path, dataExclude=[]):
+ """
+ Recursively find all packages and data directories rooted at path. Note
+ that only data _directories_ and their contents are returned -
+ non-Python files at module scope are not, and should be manually
+ included.
+
+ dataExclude is a list of fnmatch-compatible expressions for files and
+ directories that should not be included in pakcage_data.
+
+ Returns a (packages, package_data) tuple, ready to be passed to the
+ corresponding distutils.core.setup arguments.
+ """
+ packages = []
+ datadirs = []
+ for root, dirs, files in os.walk(path, topdown=True):
+ if "__init__.py" in files:
+ p = _splitAll(root)
+ packages.append(".".join(p))
+ else:
+ dirs[:] = []
+ if packages:
+ datadirs.append(root)
+
+ # Now we recurse into the data directories
+ package_data = {}
+ for i in datadirs:
+ if not _fnmatch(i, dataExclude):
+ parts = _splitAll(i)
+ module = ".".join(parts[:-1])
+ acc = package_data.get(module, [])
+ for root, dirs, files in os.walk(i, topdown=True):
+ sub = os.path.join(*_splitAll(root)[1:])
+ if not _fnmatch(sub, dataExclude):
+ for fname in files:
+ path = os.path.join(sub, fname)
+ if not _fnmatch(path, dataExclude):
+ acc.append(path)
+ else:
+ dirs[:] = []
+ package_data[module] = acc
+ return packages, package_data
+
+
+long_description = file("README.txt").read()
+packages, package_data = findPackages("libpathod")
+setup(
+ name = "pathod",
+ version = version.VERSION,
+ description = "A pathological HTTP/S daemon for testing and stressing clients.",
+ long_description = long_description,
+ author = "Aldo Cortesi",
+ author_email = "aldo@corte.si",
+ url = "http://cortesi.github.com/pathod",
+ packages = packages,
+ package_data = package_data,
+ scripts = ["pathod"],
+ classifiers = [
+ "License :: OSI Approved :: MIT License",
+ "Development Status :: 3 - Alpha",
+ "Operating System :: POSIX",
+ "Programming Language :: Python",
+ "Topic :: Internet",
+ "Topic :: Internet :: WWW/HTTP :: HTTP Servers",
+ "Topic :: Software Development :: Testing",
+ "Topic :: Software Development :: Testing :: Traffic Generation",
+ "Topic :: Internet :: WWW/HTTP",
+ ],
+ install_requires=['tornado>=2.2.1'],
+)