Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing setup.py

git-svn-id: http://svn.umitproject.org/svnroot/umit/branch/PacketManipulator@5449 1105ee14-b0fa-0310-85a5-ff3eed429ff7
  • Loading branch information...
commit 285e7e6cfe14af642b200c9605d65d70bf972cba 1 parent 74fc6a4
@nopper nopper authored
View
8 audits/passive/http/sources/main.py
@@ -571,10 +571,10 @@ def _process_http(self, stream, mpkt, rcv):
'in common use.\n\n'
'HTTP is a request/response standard of a client and a '
'server. A client is the end-user, the server is the web '
- 'site. The client making a HTTP requestusing a web '
- 'browser, spider, or other end-user toolis referred to as '
- 'the user agent. The responding serverwhich stores or '
- 'creates resources such as HTML files and imagesis called '
+ 'site. The client making a HTTP request using a web '
+ 'browser, spider, or other end-user tool is referred to as '
+ 'the user agent. The responding server which stores or '
+ 'creates resources such as HTML files and images is called '
'the origin server. In between the user agent and origin '
'server may be several intermediaries, such as proxies, '
'gateways, and tunnels. HTTP is not constrained to using '
View
2  audits/passive/icmp/sources/main.py
@@ -89,7 +89,7 @@ def stop(self):
'description' : 'The Internet Control Message Protocol (ICMP) is one of '
'the core protocols of the Internet Protocol Suite. It is '
'chiefly used by networked computers\' operating systems '
- 'to send error messagesindicating, for instance, that a '
+ 'to send error messages indicating, for instance, that a '
'requested service is not available or that a host or '
'router could not be reached.\n\n'
'ICMP relies on IP to perform its tasks, and it is an '
View
71 setup.py
@@ -31,8 +31,10 @@
from distutils.command.build import build
from umit.pm.core.const import PM_VERSION, PM_SITE
-BASE_DOCS_DIR = os.path.join('share', 'doc', 'PacketManipulator-%s' % PM_VERSION)
-DOCS_DIR = os.path.join('generated-doc', 'html')
+ROOT_DIR = os.path.abspath(os.path.dirname(__file__))
+BASE_DOCS_DIR = os.path.join('share', 'doc',
+ 'PacketManipulator-%s' % PM_VERSION)
+DOCS_DIR = os.path.join(ROOT_DIR, 'generated-doc', 'html')
def getoutput(cmd):
"""Return output (stdout or stderr) of executing cmd in a shell."""
@@ -110,12 +112,12 @@ def pkc_get_library_dirs(names):
moo = Extension(
'umit.pm.gui.moo_stub',
[
- 'umit/pm/moo/moopane.c',
- 'umit/pm/moo/moopaned.c',
- 'umit/pm/moo/moobigpaned.c',
- 'umit/pm/moo/moomarshals.c',
- 'umit/pm/moo/moo-pygtk.c',
- 'umit/pm/moo/moo-stub.c',
+ os.path.join(ROOT_DIR, 'umit/pm/moo/moopane.c'),
+ os.path.join(ROOT_DIR, 'umit/pm/moo/moopaned.c'),
+ os.path.join(ROOT_DIR, 'umit/pm/moo/moobigpaned.c'),
+ os.path.join(ROOT_DIR, 'umit/pm/moo/moomarshals.c'),
+ os.path.join(ROOT_DIR, 'umit/pm/moo/moo-pygtk.c'),
+ os.path.join(ROOT_DIR, 'umit/pm/moo/moo-stub.c'),
],
include_dirs=pkc_get_include_dirs('gtk+-2.0 pygtk-2.0'),
libraries=pkc_get_libraries('gtk+-2.0 pygtk-2.0'),
@@ -126,8 +128,9 @@ def pkc_get_library_dirs(names):
mo_files = []
-for filepath in glob.glob("umit/pm/share/locale/*/LC_MESSAGES/*.mo"):
- lang = filepath[len("umit/pm/share/locale/"):]
+for filepath in glob.glob(os.path.join(ROOT_DIR, "umit/pm/share/locale/"
+ "*/LC_MESSAGES/*.mo")):
+ lang = filepath[len(ROOT_DIR) + len("umit/pm/share/locale/"):]
targetpath = os.path.dirname(os.path.join("share/locale",lang))
mo_files.append((targetpath, [filepath]))
@@ -156,8 +159,10 @@ def digits(x):
# Build the documentation just like it is done through the Makefile
sphinx.main([__file__,
"-b", "html",
- "-d", os.path.join("umit", "pm", "share", "doc", "doctrees"),
- os.path.join("umit", "pm", "share", "doc", "src"), DOCS_DIR])
+ "-d", os.path.join(ROOT_DIR, "umit", "pm",
+ "share", "doc", "doctrees"),
+ os.path.join(ROOT_DIR, "umit", "pm", "share",
+ "doc", "src"), DOCS_DIR])
def run(self):
self.build_html_doc()
@@ -188,19 +193,15 @@ def build_audits(self):
print "#" * 80
print
- dir = self.install_data
- dirs = ['share', 'PacketManipulator', 'audits']
+ dir = os.path.join(ROOT_DIR, self.install_data, 'share',
+ 'PacketManipulator', 'audits')
- while dirs:
- dir = os.path.join(dir, dirs.pop(0))
-
- if not os.path.exists(dir):
- os.mkdir(dir)
+ if not os.path.exists(dir):
+ os.makedirs(dir)
dest_dir = dir
old_cd = os.getcwd()
- pm_dir = os.path.abspath(os.path.dirname(os.sys.argv[0]))
- plugins_dir = os.path.join(pm_dir, 'audits')
+ plugins_dir = os.path.join(ROOT_DIR, 'audits')
os.chdir(plugins_dir)
if os.name =="nt":
@@ -234,24 +235,21 @@ def build_plugins(self):
print "#" * 80
print
- dir = self.install_data
- dirs = ['share', 'PacketManipulator', 'plugins']
-
- while dirs:
- dir = os.path.join(dir, dirs.pop(0))
+ dir = os.path.join(ROOT_DIR, self.install_data, 'share',
+ 'PacketManipulator', 'plugins')
- if not os.path.exists(dir):
- os.mkdir(dir)
+ if not os.path.exists(dir):
+ os.makedirs(dir)
# Ok now dir is our destination so we should make plugins
dest_dir = dir
old_cd = os.getcwd()
- pm_dir = os.path.abspath(os.path.dirname(os.sys.argv[0]))
- plugins_dir = os.path.join(pm_dir, 'plugins')
+ plugins_dir = os.path.join(ROOT_DIR, 'plugins')
os.putenv('PYTHONPATH',
- '%s%s%s' % (pm_dir, os.pathsep, os.getenv('PYTHONPATH', '')))
+ '%s%s%s' % (ROOT_DIR, os.pathsep,
+ os.getenv('PYTHONPATH', '')))
for dir_entry in os.listdir(plugins_dir):
dir_entry = os.path.join(plugins_dir, dir_entry)
@@ -268,7 +266,8 @@ def build_plugin(self, plugins_dir, dir_entry, dest_dir):
os.chdir(os.path.join(plugins_dir, dir_entry))
if os.name =="nt":
- os.system("C:\\python25\\python.exe setup.py build_ext -c mingw32 install")
+ os.system("C:\\python25\\python.exe setup.py "
+ "build_ext -c mingw32 install")
else:
os.system("python setup.py install")
@@ -310,10 +309,11 @@ def build_plugin(self, plugins_dir, dir_entry, dest_dir):
'umit.pm.gui.plugins',
'umit.pm.higwidgets'
],
+ package_dir = {'umit' : os.path.join(ROOT_DIR, 'umit')},
data_files = [
(os.path.join('share', 'pixmaps', 'pm'),
- glob.glob(os.path.join('umit', 'pm', 'share', 'pixmaps',
- 'pm', '*'))),
+ glob.glob(os.path.join(ROOT_DIR, 'umit', 'pm', 'share',
+ 'pixmaps', 'pm', '*'))),
(BASE_DOCS_DIR,
glob.glob(os.path.join(DOCS_DIR, '*.html')) + \
glob.glob(os.path.join(DOCS_DIR, '*.js')) + \
@@ -325,7 +325,8 @@ def build_plugin(self, plugins_dir, dir_entry, dest_dir):
(os.path.join(BASE_DOCS_DIR, '_static'),
glob.glob(os.path.join(DOCS_DIR, '_static', '*'))),
] + mo_files,
- scripts = [os.path.join('umit', 'pm', 'PacketManipulator')],
+ scripts = [os.path.join(ROOT_DIR, 'umit', 'pm',
+ 'PacketManipulator')],
ext_modules = modules,
cmdclass = {'install' : pm_install,
'build' : pm_build}
Please sign in to comment.
Something went wrong with that request. Please try again.