[Pymoul-svn] SF.net SVN: pymoul: [121] pymoul/trunk
Status: Alpha
Brought to you by:
tiran
|
From: <ti...@us...> - 2007-02-02 17:22:25
|
Revision: 121
http://pymoul.svn.sourceforge.net/pymoul/?rev=121&view=rev
Author: tiran
Date: 2007-02-02 09:22:22 -0800 (Fri, 02 Feb 2007)
Log Message:
-----------
Moved utils to utilities/
Added some useful stuff from Zope3
Modified Paths:
--------------
pymoul/trunk/Makefile.in
pymoul/trunk/setup.py
Added Paths:
-----------
pymoul/trunk/doc/XXXreport.html
pymoul/trunk/utilities/
pymoul/trunk/utilities/XXXreport
pymoul/trunk/utilities/XXXreport2html.py
pymoul/trunk/utilities/compileui.py
pymoul/trunk/utilities/distutils_iss.py
pymoul/trunk/utilities/distutils_upx.py
pymoul/trunk/utilities/ez_setup.py
pymoul/trunk/utilities/genepydoc.py
pymoul/trunk/utilities/importchecker.py
pymoul/trunk/utilities/setup_win32.py
Removed Paths:
-------------
pymoul/trunk/compileui.py
pymoul/trunk/distutils_iss.py
pymoul/trunk/distutils_upx.py
pymoul/trunk/ez_setup.py
pymoul/trunk/genepydoc.py
pymoul/trunk/setup_win32.py
Modified: pymoul/trunk/Makefile.in
===================================================================
--- pymoul/trunk/Makefile.in 2007-02-02 17:13:40 UTC (rev 120)
+++ pymoul/trunk/Makefile.in 2007-02-02 17:22:22 UTC (rev 121)
@@ -1,5 +1,5 @@
-PYTHON?=python
-EPYDOC=$(PYTHON) genepydoc.py
+PYTHON?=python2.5
+EPYDOC=$(PYTHON) utilities/genepydoc.py
NOTSVN=-a -not -wholename '*.svn*'
FINDPYTXT=find src/moul \( -name '*.py' -o -name '*.txt' \) $(NOTSVN)
FINDPY=find src/moul -name '*.py' $(NOTSVN)
@@ -36,7 +36,7 @@
dist/moulqt.exe
ui:
- $(PYTHON) compileui.py
+ $(PYTHON) utilities/compileui.py ./src/moul/
test_build: build ui
PYTHONPATH="src" $(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS)
@@ -91,3 +91,9 @@
cd dist && $(FINDHASH) | xargs sha1sum >sha1.txt
cd dist && $(FINDHASH) | xargs gpg --detach-sign -a
+xxxreport:
+ utilities/XXXreport
+
+importchecker:
+ $(PYTHON) utilities/importchecker.py ./src/moul/
+
Deleted: pymoul/trunk/compileui.py
===================================================================
--- pymoul/trunk/compileui.py 2007-02-02 17:13:40 UTC (rev 120)
+++ pymoul/trunk/compileui.py 2007-02-02 17:22:22 UTC (rev 121)
@@ -1,115 +0,0 @@
-#!/usr/bin/env python2.5
-"""Compile QtDesigner's UI and QRC files to Python files
-"""
-__author__ = "Christian Heimes"
-__version__ = "$Id$"
-__revision__ = "$Revision$"
-
-import os
-import re
-from stat import ST_MTIME
-
-from PyQt4 import uic
-
-RE_RC_TEXT = "^import[ \.\\/]*(?P<module>[a-zA-Z]\w*_rc)\s$"
-RE_RC = re.compile(RE_RC_TEXT)
-
-UI_EXT = '.ui'
-PY_EXT = '.py'
-QRC_EXT = '.qrc'
-PY_QRC_EXT = '_rc.py'
-QRC_COMPILER = "pyrcc4 -o %(py)s %(qrc)s"
-QRC_PACKAGE = "moul.qt.ui"
-
-def _newer(orig, py):
- try:
- return os.stat(orig)[ST_MTIME] > os.stat(py)[ST_MTIME]
- except Exception:
- return True
-
-
-def previewUi(uifname):
- """Copied from PyQt.uic.pyuic
- """
- from PyQt4 import QtGui
- app = QtGui.QApplication([uifname])
- widget = uic.loadUi(uifname)
- widget.show()
- return app.exec_()
-
-def findFiles(base):
- uis = []
- qrcs = []
- if not os.path.isdir(base):
- raise IOError("%s is not a directory" % root)
- for root, dirs, files in os.walk(base):
- if '.svn' in dirs:
- dirs.remove('.svn')
- for file in files:
- if file.endswith(UI_EXT):
- uis.append((root, file))
- if file.endswith(QRC_EXT):
- qrcs.append((root, file))
- return uis, qrcs
-
-def compileUiFiles(uis, execute=False, preview=False):
- pys = []
- for root, ui_name in uis:
- py_name = ui_name.lower()[:-len(UI_EXT)]+PY_EXT
- ui_path = os.path.join(root, ui_name)
- py_path = os.path.join(root, py_name)
- if not _newer(ui_path, py_path):
- continue
- ui = open(ui_path, 'r')
- py = open(py_path, 'w')
- err = uic.compileUi(ui, py, execute)
- ui.close()
- py.close()
- if err:
- raise RuntimeError("%s: %s" % (ui_path, str(err)))
- fixRelativeImport(py_path)
- if preview:
- previewUi(ui_path)
- pys.append(py_path)
- return pys
-
-def fixRelativeImport(fname):
- lines = []
- fin = open(fname, 'r')
- for line in fin:
- if line.startswith('import'):
- # faster than re
- match = RE_RC.match(line)
- if match:
- line = match.expand("from %s import \g<module>" % QRC_PACKAGE)
- lines.append(line)
- fin.close()
- fout = open(fname, 'w')
- fout.write(''.join(lines))
- fout.close()
-
-def compileQRCFiles(qrcs):
- pys = []
- for root, qrc_name in qrcs:
- py_name = qrc_name.lower()[:-len(QRC_EXT)]+PY_QRC_EXT
- kw = {}
- kw['qrc'] = os.path.join(root, qrc_name)
- kw['py'] = os.path.join(root, py_name)
- if not _newer(kw['qrc'], kw['py']):
- continue
- err = os.system(QRC_COMPILER % kw)
- if err != 0:
- raise RuntimeError("pyrcc error")
- pys.append(kw['py'])
- return pys
-
-def compileUi(base='src', execute=True, preview=False):
- uis, qrcs = findFiles(base)
- upys = compileUiFiles(uis, execute=execute, preview=preview)
- qpys = compileQRCFiles(qrcs)
- return upys + qpys
-
-if __name__ == '__main__':
- pys = compileUi()
- print "Python files written:\n"
- print '\n'.join(pys)
Deleted: pymoul/trunk/distutils_iss.py
===================================================================
--- pymoul/trunk/distutils_iss.py 2007-02-02 17:13:40 UTC (rev 120)
+++ pymoul/trunk/distutils_iss.py 2007-02-02 17:22:22 UTC (rev 121)
@@ -1,514 +0,0 @@
-"""Distutils helper for creating and running InnoSetup Script files
-"""
-__author__ = "Christian Heimes"
-__version__ = "$Id"
-__revision__ = "$Revision$"
-
-import os
-import sys
-import re
-from distutils import log
-from fnmatch import fnmatch
-from subprocess import call as subcall
-from ConfigParser import SafeConfigParser
-from ConfigParser import NoSectionError
-from ConfigParser import DEFAULTSECT
-from string import ascii_letters
-
-class ISSConfigParser(SafeConfigParser):
- """Config parser with some extensions for ISS
-
- new methods:
- add_header(string) - Adds comments to the header
- set_raw(section, string) - Adds a raw entry to a section
- add_sectionif(section)
- setif(section, option, value)
-
- changed behavior:
- doesn't write [default] section to file
- interpolates "%(...)s" when writing to file
- doesn't parse key: value
- parses "Key: "value"; ..." to raw
- writes sections in the order they are created
-
- >>> from StringIO import StringIO
- >>> defaults = {'appname' : 'Test App'}
- >>> cfg = ISSConfigParser(defaults)
- >>> cfg.add_header("header")
-
- >>> cfg.add_section("testsection")
- >>> cfg.set("testsection", "key", "value %(appname)s")
- >>> cfg.set_raw("testsection", 'Rawline: "%(appname)s";')
-
- >>> out = StringIO()
- >>> cfg.write(out)
- >>> out.seek(0)
- >>> data = out.read()
- >>> print data
- ; header
- [testsection]
- key = value Test App
- Rawline: "Test App";
- <BLANKLINE>
-
- >>> template = StringIO(data)
- >>> del cfg, out, data
- >>> cfg = ISSConfigParser(defaults)
- >>> cfg.readfp(template)
- >>> cfg._sections
- {'testsection': {'__name__': 'testsection', 'key': 'value Test App'}}
- >>> cfg._raw
- {'testsection': ['Rawline: "Test App";']}
-
- >>> out = StringIO()
- >>> cfg.write(out)
- >>> out.seek(0)
- >>> data = out.read()
- >>> print data
- [testsection]
- key = value Test App
- Rawline: "Test App";
- <BLANKLINE>
-
- >>>
- """
- def __init__(self, defaults=None):
- SafeConfigParser.__init__(self, defaults)
- self._raw = {}
- self._header = []
- self._order = []
-
- def add_header(self, value):
- """Add a header comment
- """
- self._header.append(value)
-
- def add_section(self, section):
- """Create a new section in the configuration.
- """
- SafeConfigParser.add_section(self, section)
- self._raw[section]= []
- self._order.append(section)
-
- def add_sectionif(self, section):
- """Create a new section in the configuration if section doesn't exist.
- """
- if not self.has_section(section):
- self.add_section(section)
- return True
-
- def setif(self, section, option, value):
- """Set section-option to value if option is not yet set
- """
- if not self.has_option(section, option):
- self.set(section, option, value)
- return True
-
- def set_raw(self, section, raw):
- """Add a raw string to a section
- """
- try:
- sec = self._raw[section]
- except KeyError:
- raise NoSectionError(section)
- if isinstance(raw, (tuple, list)):
- for r in raw:
- sec.append(r)
- else:
- sec.append(raw)
-
- def get_raw(self, section, raw=False, vars=None):
- """Get all raw lines as string for a given section.
-
- Interpolates %(var)s vars
- """
- d = self._defaults.copy()
- try:
- d.update(self._sections[section])
- except KeyError:
- if section != DEFAULTSECT:
- raise NoSectionError(section)
- # Update with the entry specific variables
- if vars:
- for key, value in vars.items():
- d[self.optionxform(key)] = value
- try:
- rawdata = "\n".join(self._raw[section])
- except KeyError:
- return None
-
- if raw:
- return rawdata
- else:
- return self._interpolate(section, "RAWDATA", rawdata, d)
-
- def optionxform(self, optionstr):
- return optionstr
-
- def write(self, fp):
- """Write an .ini-format representation of the configuration state."""
- for header in self._header:
- fp.write("; %s\n" % header.replace('\n', '; \n'))
- #if self._defaults:
- # fp.write("[%s]\n" % DEFAULTSECT)
- # for (key, value) in self._defaults.items():
- # fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t')))
- # fp.write("\n")
- for section in self._order:
- fp.write("[%s]\n" % section)
- for key in self._sections[section]:
- if key == "__name__":
- continue
- value = self.get(section, key, raw=False)
- fp.write("%s = %s\n" %
- (key, str(value).replace('\n', '\n\t')))
- rawdata = self.get_raw(section, raw=False)
- if rawdata:
- fp.write(rawdata)
- fp.write("\n")
-
- def remove_section(self, section):
- """Remove a file section."""
- existed = RawConfigParser.remove_section(self, section)
- if existed:
- del self._raw[section]
- return existed
-
- OPTCRE = re.compile(
- r'(?P<option>[^=\s][^=]*)' # very permissive!
- r'\s*(?P<vi>[=])\s*' # any number of space/tab,
- # followed by separator
- # (either : or =), followed
- # by any # space/tab
- r'(?P<value>.*)$' # everything up to eol
- )
-
- RAWRE = re.compile(
- r'^[A-Z][A-Za-z]*:\s?' # 'Name: '
- r'".*";' # '"value ...";' and
- )
-
- def _read(self, fp, fpname):
- """Parse a sectioned setup file.
-
- From ConfigParser.RawConfigParser
- """
- cursect = None # None, or a dictionary
- curraw = None
- optname = None
- lineno = 0
- e = None # None, or an exception
- while True:
- line = fp.readline()
- if not line:
- break
- lineno = lineno + 1
- # comment or blank line?
- if line.strip() == '' or line[0] in '#;':
- continue
- if line.split(None, 1)[0].lower() == 'rem' and line[0] in "rR":
- # no leading whitespace
- continue
- # continuation line?
- if line[0].isspace() and cursect is not None and optname:
- value = line.strip()
- if value:
- cursect[optname] = "%s\n%s" % (cursect[optname], value)
- # a section header or option header?
- else:
- # is it a section header?
- mo = self.SECTCRE.match(line)
- if mo:
- sectname = mo.group('header')
- if sectname in self._sections:
- cursect = self._sections[sectname]
- curraw = self._raw[sectname]
- elif sectname == DEFAULTSECT:
- cursect = self._defaults
- else:
- cursect = {'__name__': sectname}
- curraw = [] # new
- self._order.append(sectname) # new
- self._sections[sectname] = cursect
- self._raw[sectname] = curraw # new
- # So sections can't start with a continuation line
- optname = None
- # no section header in the file?
- elif cursect is None:
- raise MissingSectionHeaderError(fpname, lineno, line)
- # an option line?
- else:
- mo = self.OPTCRE.match(line)
- if mo:
- optname, vi, optval = mo.group('option', 'vi', 'value')
- if vi in ('=', ':') and ';' in optval:
- # ';' is a comment delimiter only if it follows
- # a spacing character
- pos = optval.find(';')
- if pos != -1 and optval[pos-1].isspace():
- optval = optval[:pos]
- optval = optval.strip()
- # allow empty values
- if optval == '""':
- optval = ''
- optname = self.optionxform(optname.rstrip())
- cursect[optname] = optval
- else:
- mo = self.RAWRE.match(line) # new
- if mo:
- # found a InnoSetup raw line
- curraw.append(line.strip())
- else:
- # a non-fatal parsing error occurred. set up the
- # exception but keep going. the exception will be
- # raised at the end of the file and will contain a
- # list of all bogus lines
- if not e:
- e = ParsingError(fpname)
- e.append(lineno, repr(line))
- # if any parsing errors occurred, raise an exception
- if e:
- raise e
-
-
-class InnoSetupCommandMixin:
- """Mixin class class for a distutils command
-
- You have call initialize_options() and run() from your class!
-
- >>> from tempfile import mkstemp
- >>> tmphdlr, tmpfile = mkstemp()
-
- >>> test = InnoSetupCommandMixin()
- >>> test.initialize_options()
- >>> test.app_name = "Test App"
- >>> test.innosetup = True
- >>> test.inno_script = tmpfile
- >>> test.lib_dir = 'li',
- >>> test.dist_dir = 'dist'
- >>> test.windows_exe_files = [r'dist\\test.exe']
- >>> test.lib_files = [r'dist\\lib1', r'dist\\lib2']
-
- >>> try:
- ... test.run()
- ... finally:
- ... data = open(tmpfile).read()
- ... os.unlink(tmpfile)
-
- #>>> print data
- """
- def initialize_options(self):
- self.app_name = ''
- self.innosetup = False
- self.inno_script = None
- self.inno_version = "1.0"
- self.inno_templates = None
- self.inno_interpolation = {}
- self.inno_sections = {}
- self.inno_languages = [('nl', 'Dutch'), ('de', 'German'),
- ('fr', 'French'), ('it', 'Italian'),
- ('es', 'Spanish')
- ]
-
- def run(self):
- self._createInnoSetup()
-
- def _createInnoSetup(self):
- if not self.innosetup:
- return
-
- self._inno_script = InnoScript(
- self.app_name,
- self.lib_dir,
- self.dist_dir,
- self.windows_exe_files,
- self.lib_files,
- inno_script = self.inno_script,
- templates = self.inno_templates,
- interpolation = self.inno_interpolation,
- sections = self.inno_sections,
- languages = self.inno_languages)
-
- print "*** creating the inno setup script***"
- self._inno_script.create()
- print "*** compiling the inno setup script***"
- try:
- self._inno_script.compile()
- except RuntimeError, msg:
- print "Failed to create installer:\n%s" % msg
- # Note: By default the final setup.exe will be in an Output subdirectory.
-
-class InnoScript:
- """Based on py2exe/samples/extending/setup.py
-
- Requires http://www.jrsoftware.org
-
- appname - name of the app
- lib_dir - internal
- dist_dir - internal
- windows_exe_files - internal
- lib_files - internal
- inno_script=None - path to IS script output file
- templates = None - list of template file names or single file
- version = "1.0" - version string
- interpolation - dict with additional %()s interpolation items
- sections - dict with additional section informations
- languages - list with languages tuples e.g. [('de', 'German')]
-
- sections = {'sectioname' :
- {'key' : 'value',
- 'RAW' : 'string or list with raw items'
- }
- }
-
- """
- def __init__(self,
- appname,
- lib_dir,
- dist_dir,
- windows_exe_files,
- lib_files,
- inno_script=None,
- templates = None,
- version = "1.0",
- interpolation = {},
- sections = {},
- languages = []
- ):
- self.lib_dir = lib_dir
- self.dist_dir = dist_dir
- if not self.dist_dir[-1] in "\\/":
- self.dist_dir += "\\"
- self.windows_exe_files = [self.chop(p) for p in windows_exe_files]
- self.lib_files = [self.chop(p) for p in lib_files]
- if inno_script is None:
- self.inno_script = os.path.join(dist_dir, appname.replace(' ', '_')+'.iss')
- else:
- self.inno_script = inno_script
- self.fd = open(self.inno_script, "w")
-
- ip = interpolation.copy()
- ip['appname'] = appname
- ip['version'] = version
- ip['appnamestripped'] = "".join([c for c in appname
- if c in ascii_letters])
- ip['appexe'] = self.windows_exe_files[0]
- self.interpolation = ip
-
- self.cfg = ISSConfigParser(ip)
- if templates:
- read = self.cfg.read(templates)
- self.sections = sections
- self.languages = languages
-
- def chop(self, pathname):
- assert pathname.startswith(self.dist_dir)
- return pathname[len(self.dist_dir):]
-
- def create(self):
- """create Inno Script
- """
- self.createInnoScript()
- self.modifyInnoScript()
- self.writeInnoScript()
-
- def createInnoScript(self):
- """Create Inno Script cfg
- """
- cfg = self.cfg
- cfg.add_header("WARNING: This script has been created by py2exe. Changes to this script")
- cfg.add_header("will be overwritten the next time py2exe is run!\n")
-
- cfg.add_sectionif("Setup")
- # Setup
- cfg.setif("Setup", "AppName", "%(appname)s")
- cfg.setif("Setup", "AppVerName", "%(appname)s %(version)s")
- cfg.setif("Setup", "DefaultDirName", "{pf}\%(appname)s")
- cfg.setif("Setup", "DefaultGroupName", "%(appname)s")
-
- self._writeLanguagesSect()
- self._writeWindowsExeFiles()
- self._writeLibFiles()
- #self._writeIcons()
- self._writeSections()
-
- def _writeLanguagesSect(self):
- cfg = self.cfg
- if not self.languages:
- return
- cfg.add_sectionif('Languages')
- for key, lang in self.languages:
- cfg.set_raw("Languages",
- 'Name: "%s"; MessagesFile: "compiler:Languages\%s.isl"' %
- (key, lang))
-
- def _writeWindowsExeFiles(self):
- cfg = self.cfg
- cfg.add_sectionif("Files")
- for path in self.windows_exe_files:
- cfg.set_raw("Files",
- r'Source: "%s"; DestDir: "{app}\%s"; Flags: ignoreversion'
- % (path, os.path.dirname(path)) )
-
- def _writeLibFiles(self):
- cfg = self.cfg
- cfg.add_sectionif("Files")
- for path in self.lib_files:
- cfg.set_raw("Files",
- r'Source: "%s"; DestDir: "{app}\%s"; Flags: ignoreversion'
- % (path, os.path.dirname(path)) )
-
- def _writeIcons(self):
- cfg = self.cfg
- cfg.add_sectionif("Icons")
- for path in self.windows_exe_files:
- cfg.set_raw("Icons",
- 'Name: "{group}\\%(appname)s"; Filename: "{app}\\' + path + '"')
- cfg.set_raw("Icons", r'Name: "{group}\Uninstall %(appname)s"; Filename: "{uninstallexe}"')
-
- def _writeSections(self):
- cfg = self.cfg
- # Additional things in self.sections
- for section in self.sections:
- cfg.add_sectionif(section)
- for key, value in self.sections[section].items():
- if key == "RAW":
- cfg.set_raw(section, value)
- else:
- cfg.set(section, key, value)
-
- def modifyInnoScript(self):
- """Hook
- """
- pass
-
- def writeInnoScript(self):
- """Write script to disk
- """
- self.cfg.write(self.fd)
- self.fd.close()
-
- def compile(self):
- import ctypes
- res = ctypes.windll.shell32.ShellExecuteA(0, "compile",
- self.inno_script,
- None,
- None,
- 0)
- if res < 32:
- raise RuntimeError("ShellExecute failed, error %d" % res)
-
- def __call__(self):
- self.create()
- self.compile()
-
-def test_suite():
- import unittest
- from doctest import DocTestSuite
- return unittest.TestSuite((
- DocTestSuite(__name__),
- ))
-
-if __name__ == '__main__':
- import unittest
- unittest.main(defaultTest="test_suite")
Deleted: pymoul/trunk/distutils_upx.py
===================================================================
--- pymoul/trunk/distutils_upx.py 2007-02-02 17:13:40 UTC (rev 120)
+++ pymoul/trunk/distutils_upx.py 2007-02-02 17:22:22 UTC (rev 121)
@@ -1,157 +0,0 @@
-"""Patched distutils Command
-"""
-__author__ = "Christian Heimes"
-__version__ = "$Id"
-__revision__ = "$Revision$"
-
-import os
-import sys
-from inspect import getmro
-from tempfile import TemporaryFile
-from subprocess import call as subcall
-from distutils import log
-from stat import ST_SIZE
-from fnmatch import fnmatch
-from distutils_iss import InnoSetupCommandMixin
-
-class UpxCommand(InnoSetupCommandMixin):
- """Upx packer mixin class for distutils
-
- Usage:
- class UpxPy2exe(UpxCommand, py2exe):
- pass
-
- setup(..., cmdclass = {'py2exe': UpxPy2exe})
-
- The mixin class should work for every distutils Command based class on
- every os (Win32, Mac, Linux).
-
- New options:
- o upx - True/False
- o upx_args - additional args for upx (e.g. "--no-color --best")
- o upx_path - path to upx if not in os.environ['PATH']
- o upx_extensions - list of extensions to packed (e.g. ['dll','pyd','exe'])
- o upx_ignore - list of pattern to ignore (e.g. ['python*.dll']=
- """
-
- def initialize_options(self):
- result = self._otherclass().initialize_options(self)
- InnoSetupCommandMixin.initialize_options(self)
- self.upx = True
- self.upx_args = '--no-color'
- self.upx_path = 'upx'
- self.upx_extensions = [
- 'pyd', 'dll', 'exe', # Windows
- '', 'so', # Linux
- 'dylib', # Mac OS X
- ]
- self.upx_ignore = []
- return result
-
- def finalize_options(self):
- result = self._otherclass().finalize_options(self)
- self.has_upx = self._upxAvailable()
- self.upx_packlist = []
- return result
-
- def copy_file(self, *args, **kwargs):
- result = self._otherclass().copy_file(self, *args, **kwargs)
- self.upx_packlist.append(result)
- return result
-
- def run(self, *args, **kwargs):
- result = self._otherclass().run(self, *args, **kwargs)
- self._upxPack()
- InnoSetupCommandMixin.run(self)
- return result
-
- def _upxPack(self):
- """Pack files
-
- At last pack the files. I had some hard to debug errors as I tried to
- pack the files inside the copy_file() method. Some dll and exe files
- were broken. Perhaps some file handlers weren't closed?
- """
- if not self.has_upx or not self.upx:
- return
-
- packed = []
- for fname, copied in self.upx_packlist:
- if not copied:
- continue
- basename = os.path.basename(fname)
- tmp, ext = os.path.splitext(basename)
- ext = ext[1:] # strip leading dot
-
- # check extension
- if ext not in self.upx_extensions:
- continue
- # check ignores
- if self.upx_ignore:
- matches = [pat for pat in self.upx_ignore if fnmatch(basename, pat)]
- if matches:
- continue
-
- origsize = os.stat(fname)[ST_SIZE]
- self._upxPackFile(os.path.normpath(fname))
- newsize = os.stat(fname)[ST_SIZE]
- ratio = newsize*100 / origsize
- packed.append((basename, origsize, newsize, ratio))
-
- print "\n*** UPX result ***"
- for basename, origsize, newsize, ratio in packed:
- print " %s packed to %i%%" % (basename, ratio)
- if not packed:
- print " no files packed"
- print "\n"
-
- def _upxPackFile(self, fname):
- """Pack a file
- """
- retcode = subcall('%s %s "%s"' % (self.upx_path, self.upx_args, fname))
- if retcode == 0: # OK, file packed
- pass
- elif retcode == 2: # OK, file already packed
- pass
- else: # something bad has happend
- sys.exit(retcode) # XXX
-
- def _upxAvailable(self):
- """Search for UPX in search path
- """
- stdout = TemporaryFile()
- try:
- try:
- retcode = subcall("%s --version" % self.upx_path, stdout=stdout)
- finally:
- if stdout:
- stdout.close()
- except OSError:
- log.debug('UPX not found')
- return False
- else:
- if retcode == 0:
- log.debug('UPX found')
- return True
- else:
- log.debug('UPX: an error occured %i' % retcode)
- return False
-
- @classmethod
- def _otherclass(cls):
- """Workaround: distutils.cmd.Command is an old style class
-
- Find next class in MRO that is not based on UpxCommand class
- """
- for c in getmro(cls):
- if not issubclass(c, (UpxCommand, InnoSetupCommandMixin)):
- return c
- raise ValueError(cls)
-
-try:
- from py2exe.build_exe import py2exe
-except ImportError:
- pass
-else:
- class UpxPy2exe(UpxCommand, py2exe):
- pass
Added: pymoul/trunk/doc/XXXreport.html
===================================================================
--- pymoul/trunk/doc/XXXreport.html (rev 0)
+++ pymoul/trunk/doc/XXXreport.html 2007-02-02 17:22:22 UTC (rev 121)
@@ -0,0 +1,411 @@
+<html><head><title>XXX/TODO/FIXME-Comment report for pyMoul</title>
+</head>
+
+<body>
+<h1>pyMoul - Developer report tools: XXX/TODO/FIXME comments</h1>
+<p>Generated on Fri, 02 Feb 2007 18:18:36 CET, based on Zope 3's XXX report</p>
+<hr>
+<h3>Summary</h3>
+<p>
+ There are currently 100 XXX/TODO/FIXME comments.
+</p>
+<hr/>
+<h3>Listing</h3>
+<ol><li><b>File: utilities/../.svn/text-base/ez_setup.py.svn-base:92</b><br/><pre> # XXX could we install in a subprocess here?
+base-93- print >>sys.stderr, (
+base-94- "The required version of setuptools (>=%s) is not available, and\n"
+base-95- "can't be installed while this script is running. Please install\n"
+</pre></li><li><b>File: utilities/../.svn/text-base/test.py.svn-base:548</b><br/><pre> # XXX bug: doctest may report several failures in one test, they are
+base-549- # separated by a horizontal dash line. Only the first one of
+base-550- # them is now colorized properly.
+base-551- header = lines[0]
+</pre></li><li><b>File: utilities/../.svn/text-base/test.py.svn-base:603</b><br/><pre> # TODO: Scrape and colorize the traceback.
+base-604- result.append(self.colorize('doctest_got', line))
+base-605- elif remaining[0] == 'Differences (ndiff with -expected +actual):':
+base-606- result.append(self.colorize('doctest_title', remaining.pop(0))) # E. raised:
+</pre></li><li><b>File: utilities/../.svn/text-base/test.py.svn-base:623</b><br/><pre> # TODO: We only deal with the output from Zope 3's doctest module.
+base-624- # A colorizer for the Python's doctest module would be nice too.
+base-625- if doctest:
+base-626- # If we have a doctest, we do not care about this header. All the
+</pre></li><li><b>File: utilities/../.svn/text-base/test.py.svn-base:690</b><br/><pre> # TODO these should be hookable
+base-691- from zope.tales.tales import TALESTracebackSupplement
+base-692- from zope.pagetemplate.pagetemplate \
+base-693- import PageTemplateTracebackSupplement
+</pre></li><li><b>File: utilities/../.svn/text-base/setup_win32.py.svn-base:84</b><br/><pre> pexe['innosetup'] = os.environ.get('INNOSETUP') # TODO:
+base-85- pexe['inno_templates'] = "template.iss"
+base-86- pexe['app_name'] = 'pyMoul'
+base-87- pexe['includes'].extend(findPyTz())
+</pre></li><li><b>File: utilities/../.svn/text-base/distutils_upx.py.svn-base:117</b><br/><pre> sys.exit(retcode) # XXX
+base-118-
+base-119- def _upxAvailable(self):
+base-120- """Search for UPX in search path
+</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/chatlog.py.svn-base:268</b><br/><pre> # TODO: add parser, currently simply iterates over the file
+base-269- return iter(self._fd)
+</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/kiimage.py.svn-base:112</b><br/><pre> # XXX use struct
+base-113- if header is None:
+base-114- fd = self._fd
+base-115- fd.seek(0)
+</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/kiimage.py.svn-base:127</b><br/><pre> # XXX use struct
+base-128- if size is None:
+base-129- size = self.getFileSize()
+base-130- leading = 4* [None]
+</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/wdysini.py.svn-base:156</b><br/><pre> # TODO: write me
+base-157- pass
+base-158-
+base-159-class Constrain(object):
+</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/wdysini.py.svn-base:540</b><br/><pre> 'Audio.SetDeviceName' : (QuotedString, Constrain()), # TODO: add check
+base-541- 'Audio.SetChannelVolume GUI' : (FloatString, MinMax(0.0, 1.0)), # 0-100%, no ui
+base-542- # microphon missing -> OS mixer
+base-543- }
+</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/wdysini.py.svn-base:628</b><br/><pre> # TODO: microphon needs an extra handler. The mic slider changes the OS mixer.
+base-629-
+base-630-class GraphicsIni(ConfFile):
+base-631- _filename = 'graphics.ini'
+</pre></li><li><b>File: utilities/../src/moul/file/.svn/text-base/directory.py.svn-base:58</b><br/><pre> # TODO: fnmatch
+base-59- return len([name for name in os.listdir(path)
+base-60- if os.path.isfile(os.path.join(path, name))])
+base-61-
+</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/test_wdysini.py.svn-base:104</b><br/><pre> # TODO: more
+base-105-
+base-106- def test_publicapi_create(self):
+base-107- inipath = os.path.join(self.tmpdir, os.path.basename(self.enc))
+</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/test_wdysini.py.svn-base:115</b><br/><pre> # TODO: more
+base-116-
+base-117-class AudioIniTest(GenericIniTest):
+base-118- enc = aud_enc
+</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/test_wdysini.py.svn-base:153</b><br/><pre> #XXX self.failIf(p.isChanged())
+base-154-
+base-155- p.screenres = 0
+base-156- eq(p._get('Graphics.Width'), 800)
+</pre></li><li><b>File: utilities/../src/moul/file/tests/.svn/text-base/utils.py.svn-base:79</b><br/><pre> for fname in ('UruLauncher.exe', 'UruExplorer.exe'): # XXX: win32
+base-80- fd = open(os.path.join(path, fname), 'wb')
+base-81- fd.write('dummy')
+base-82- fd.close()
+</pre></li><li><b>File: utilities/../src/moul/file/tests/test_wdysini.py:104</b><br/><pre> # TODO: more
+
+ def test_publicapi_create(self):
+ inipath = os.path.join(self.tmpdir, os.path.basename(self.enc))
+</pre></li><li><b>File: utilities/../src/moul/file/tests/test_wdysini.py:115</b><br/><pre> # TODO: more
+
+class AudioIniTest(GenericIniTest):
+ enc = aud_enc
+</pre></li><li><b>File: utilities/../src/moul/file/tests/test_wdysini.py:153</b><br/><pre> #XXX self.failIf(p.isChanged())
+
+ p.screenres = 0
+ eq(p._get('Graphics.Width'), 800)
+</pre></li><li><b>File: utilities/../src/moul/file/tests/utils.py:79</b><br/><pre> for fname in ('UruLauncher.exe', 'UruExplorer.exe'): # XXX: win32
+ fd = open(os.path.join(path, fname), 'wb')
+ fd.write('dummy')
+ fd.close()
+</pre></li><li><b>File: utilities/../src/moul/file/chatlog.py:268</b><br/><pre> # TODO: add parser, currently simply iterates over the file
+ return iter(self._fd)
+</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py:112</b><br/><pre> # XXX use struct
+ if header is None:
+ fd = self._fd
+ fd.seek(0)
+</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py:127</b><br/><pre> # XXX use struct
+ if size is None:
+ size = self.getFileSize()
+ leading = 4* [None]
+</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py:156</b><br/><pre> # TODO: write me
+ pass
+
+class Constrain(object):
+</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py:540</b><br/><pre> 'Audio.SetDeviceName' : (QuotedString, Constrain()), # TODO: add check
+ 'Audio.SetChannelVolume GUI' : (FloatString, MinMax(0.0, 1.0)), # 0-100%, no ui
+ # microphon missing -> OS mixer
+ }
+</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py:628</b><br/><pre> # TODO: microphon needs an extra handler. The mic slider changes the OS mixer.
+
+class GraphicsIni(ConfFile):
+ _filename = 'graphics.ini'
+</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py~:112</b><br/><pre> # XXX use struct
+ if header is None:
+ fd = self._fd
+ fd.seek(0)
+</pre></li><li><b>File: utilities/../src/moul/file/kiimage.py~:127</b><br/><pre> # XXX use struct
+ if size is None:
+ size = self.getFileSize()
+ leading = 4* [None]
+</pre></li><li><b>File: utilities/../src/moul/file/chatlog.py~:268</b><br/><pre> # TODO: add parser, currently simply iterates over the file
+ return iter(self._fd)
+</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py~:156</b><br/><pre> # TODO: write me
+ pass
+
+class Constrain(object):
+</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py~:540</b><br/><pre> 'Audio.SetDeviceName' : (QuotedString, Constrain()), # TODO: add check
+ 'Audio.SetChannelVolume GUI' : (FloatString, MinMax(0.0, 1.0)), # 0-100%, no ui
+ # microphon missing -> OS mixer
+ }
+</pre></li><li><b>File: utilities/../src/moul/file/wdysini.py~:628</b><br/><pre> # TODO: microphon needs an extra handler. The mic slider changes the OS mixer.
+
+class GraphicsIni(ConfFile):
+ _filename = 'graphics.ini'
+</pre></li><li><b>File: utilities/../src/moul/file/directory.py:58</b><br/><pre> # TODO: fnmatch
+ return len([name for name in os.listdir(path)
+ if os.path.isfile(os.path.join(path, name))])
+
+</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/whatdoyousee.py.svn-base:76</b><br/><pre> # XXX: dos format
+base-77- return data.replace("\r\n", "\n")
+base-78-
+base-79-def encryptWDYS(instr, fout):
+</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/whatdoyousee.py.svn-base:86</b><br/><pre> # XXX: dos format
+base-87- instr = instr.replace("\n", "\r\n")
+base-88- fout.seek(0)
+base-89- fout.write(HEADER)
+</pre></li><li><b>File: utilities/../src/moul/crypt/.svn/text-base/elf.py.svn-base:70</b><br/><pre> # XXX NotImplemented
+base-71- raise NotImplementedError
+base-72-
+base-73-def decipher(crypt, size, key):
+</pre></li><li><b>File: utilities/../src/moul/crypt/whatdoyousee.py:76</b><br/><pre> # XXX: dos format
+ return data.replace("\r\n", "\n")
+
+def encryptWDYS(instr, fout):
+</pre></li><li><b>File: utilities/../src/moul/crypt/whatdoyousee.py:86</b><br/><pre> # XXX: dos format
+ instr = instr.replace("\n", "\r\n")
+ fout.seek(0)
+ fout.write(HEADER)
+</pre></li><li><b>File: utilities/../src/moul/crypt/elf.py:70</b><br/><pre> # XXX NotImplemented
+ raise NotImplementedError
+
+def decipher(crypt, size, key):
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/localization.py.svn-base:78</b><br/><pre> # TODO: other message box
+base-79- self._journal_progressbar = SimpleProgressbar(self)
+base-80- self._journal_progressbar.setWindowTitle(self.trUtf8("Loading journals"))
+base-81- self._journal_progressbar.setProgressbar(0, 1, 0)
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:76</b><br/><pre> # TODO: checks
+base-77- self.urudatadir.initializeFactories()
+base-78-
+base-79- # init handlers
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:152</b><br/><pre> # FIXME: signal doesn't do anything
+base-153- self.emit(SIGNAL("close()"))
+base-154- event.accept()
+base-155- event.ignore()
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:189</b><br/><pre> # TODO: msg
+base-190- return
+base-191-
+base-192- self.pb_kiimage_repair.setEnabled(False)
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:219</b><br/><pre> # TODO: msg
+base-220-
+base-221- # ************************************************************************
+base-222- # graphics settings
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:237</b><br/><pre> self.emit(SIGNAL("graphicsini_loaded()")) # XXX: hard coded emit
+base-238-
+base-239- @signalLogDecorator(LOG)
+base-240- def on_graphicsini_loaded(self):
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:297</b><br/><pre> # XXX: fixme
+base-298- txt = videoModes.getVidModeHuman(idx)
+base-299- self.lb_screenres.setText(QtCore.QString(txt))
+base-300- self._graphics_ini.screenres = idx
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:387</b><br/><pre> self.emit(SIGNAL("audioini_loaded()")) # XXX: hard coded emit
+base-388-
+base-389- @signalLogDecorator(LOG)
+base-390- def on_audioini_loaded(self):
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:506</b><br/><pre> # TODO: needs optimization? run only when timer tab is active
+base-507- self.connect(timer, SIGNAL('timeout()'), self.on_timezone_timer_timeout)
+base-508- timer.start()
+base-509-
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:602</b><br/><pre> # TODO: thread safety!
+base-603- self.servers = servers
+base-604- if not self.isRunning():
+base-605- self.start()
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:608</b><br/><pre> # TODO: thread safety!
+base-609- # emit a list of names first
+base-610- for server in self.servers:
+base-611- self.emit(SIGNAL("server(const QString&)"), server.name)
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/mainwindow.py.svn-base:644</b><br/><pre> # TODO check this
+base-645- self._running = False
+base-646- self.condition.wakeAll()
+base-647-
+</pre></li><li><b>File: utilities/../src/moul/qt/.svn/text-base/errorhandler.py.svn-base:46</b><br/><pre> # TODO: translation aware
+base-47- LOG.critical("UNHANDLED ERROR", exc_info=(typ, value, traceback))
+base:48: return # XXX: remove
+base-49- try:
+base-50- title= QtGui.QApplication.translate("excepthook",
+base-51- "An unhandled error has occured",
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:76</b><br/><pre> # TODO: checks
+ self.urudatadir.initializeFactories()
+
+ # init handlers
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:152</b><br/><pre> # FIXME: signal doesn't do anything
+ self.emit(SIGNAL("close()"))
+ event.accept()
+ event.ignore()
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:189</b><br/><pre> # TODO: msg
+ return
+
+ self.pb_kiimage_repair.setEnabled(False)
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:236</b><br/><pre> self.emit(SIGNAL("graphicsini_loaded()")) # XXX: hard coded emit
+
+ @signalLogDecorator(LOG)
+ def on_graphicsini_loaded(self):
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:296</b><br/><pre> # XXX: fixme
+ txt = videoModes.getVidModeHuman(idx)
+ self.lb_screenres.setText(QtCore.QString(txt))
+ self._graphics_ini.screenres = idx
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:386</b><br/><pre> self.emit(SIGNAL("audioini_loaded()")) # XXX: hard coded emit
+
+ @signalLogDecorator(LOG)
+ def on_audioini_loaded(self):
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:505</b><br/><pre> # TODO: needs optimization? run only when timer tab is active
+ self.connect(timer, SIGNAL('timeout()'), self.on_timezone_timer_timeout)
+ timer.start()
+
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:601</b><br/><pre> # TODO: thread safety!
+ self.servers = servers
+ if not self.isRunning():
+ self.start()
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:607</b><br/><pre> # TODO: thread safety!
+ # emit a list of names first
+ for server in self.servers:
+ self.emit(SIGNAL("server(const QString&)"), server.name)
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py~:643</b><br/><pre> # TODO check this
+ self._running = False
+ self.condition.wakeAll()
+
+</pre></li><li><b>File: utilities/../src/moul/qt/localization.py:78</b><br/><pre> # TODO: other message box
+ self._journal_progressbar = SimpleProgressbar(self)
+ self._journal_progressbar.setWindowTitle(self.trUtf8("Loading journals"))
+ self._journal_progressbar.setProgressbar(0, 1, 0)
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:76</b><br/><pre> # TODO: checks
+ self.urudatadir.initializeFactories()
+
+ # init handlers
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:152</b><br/><pre> # FIXME: signal doesn't do anything
+ self.emit(SIGNAL("close()"))
+ event.accept()
+ event.ignore()
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:189</b><br/><pre> # TODO: msg
+ return
+
+ self.pb_kiimage_repair.setEnabled(False)
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:219</b><br/><pre> # TODO: msg
+
+ # ************************************************************************
+ # graphics settings
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:237</b><br/><pre> self.emit(SIGNAL("graphicsini_loaded()")) # XXX: hard coded emit
+
+ @signalLogDecorator(LOG)
+ def on_graphicsini_loaded(self):
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:297</b><br/><pre> # XXX: fixme
+ txt = videoModes.getVidModeHuman(idx)
+ self.lb_screenres.setText(QtCore.QString(txt))
+ self._graphics_ini.screenres = idx
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:387</b><br/><pre> self.emit(SIGNAL("audioini_loaded()")) # XXX: hard coded emit
+
+ @signalLogDecorator(LOG)
+ def on_audioini_loaded(self):
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:506</b><br/><pre> # TODO: needs optimization? run only when timer tab is active
+ self.connect(timer, SIGNAL('timeout()'), self.on_timezone_timer_timeout)
+ timer.start()
+
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:602</b><br/><pre> # TODO: thread safety!
+ self.servers = servers
+ if not self.isRunning():
+ self.start()
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:608</b><br/><pre> # TODO: thread safety!
+ # emit a list of names first
+ for server in self.servers:
+ self.emit(SIGNAL("server(const QString&)"), server.name)
+</pre></li><li><b>File: utilities/../src/moul/qt/mainwindow.py:644</b><br/><pre> # TODO check this
+ self._running = False
+ self.condition.wakeAll()
+
+</pre></li><li><b>File: utilities/../src/moul/qt/errorhandler.py:46</b><br/><pre> # TODO: translation aware
+ LOG.critical("UNHANDLED ERROR", exc_info=(typ, value, traceback))
+ try:
+ title= QtGui.QApplication.translate("excepthook",
+ "An unhandled error has occured",
+</pre></li><li><b>File: utilities/../src/moul/osdependent/__init__.py:116</b><br/><pre># XXX: what about cygwin, bsd and others?
+_thismodule = sys.modules[__name__]
+if __WIN32__:
+ from moul.osdependent import win32 as osdep_win32
+</pre></li><li><b>File: utilities/../src/moul/osdependent/.svn/text-base/__init__.py.svn-base:116</b><br/><pre># XXX: what about cygwin, bsd and others?
+base-117-_thismodule = sys.modules[__name__]
+base-118-if __WIN32__:
+base-119- from moul.osdependent import win32 as osdep_win32
+</pre></li><li><b>File: utilities/../test.py:548</b><br/><pre> # XXX bug: doctest may report several failures in one test, they are
+ # separated by a horizontal dash line. Only the first one of
+ # them is now colorized properly.
+ header = lines[0]
+</pre></li><li><b>File: utilities/../test.py:603</b><br/><pre> # TODO: Scrape and colorize the traceback.
+ result.append(self.colorize('doctest_got', line))
+ elif remaining[0] == 'Differences (ndiff with -expected +actual):':
+ result.append(self.colorize('doctest_title', remaining.pop(0))) # E. raised:
+</pre></li><li><b>File: utilities/../test.py:623</b><br/><pre> # TODO: We only deal with the output from Zope 3's doctest module.
+ # A colorizer for the Python's doctest module would be nice too.
+ if doctest:
+ # If we have a doctest, we do not care about this header. All the
+</pre></li><li><b>File: utilities/../test.py:690</b><br/><pre> # TODO these should be hookable
+ from zope.tales.tales import TALESTracebackSupplement
+ from zope.pagetemplate.pagetemplate \
+ import PageTemplateTracebackSupplement
+</pre></li><li><b>File: utilities/../contrib/.svn/text-base/build_exe.py.svn-base:6</b><br/><pre># Todo:
+base-7-#
+base-8-# Make 'unbuffered' a per-target option
+base-9-
+</pre></li><li><b>File: utilities/../contrib/.svn/text-base/build_exe.py.svn-base:357</b><br/><pre>## extra_path = ["."] # XXX
+base-358- extra_path = []
+base-359- dlls, unfriendly_dlls, other_depends = \
+base-360- self.find_dependend_dlls(dlls,
+</pre></li><li><b>File: utilities/../contrib/.svn/text-base/build_exe.py.svn-base:403</b><br/><pre> # XXX all dlls are copied into the same directory - a flat name space.
+base-404- # sooner or later that will give conflicts.
+base-405- dst = os.path.join(self.lib_dir, os.path.basename(item.__file__))
+base-406- self.copy_file(src, dst, preserve_mode=0)
+</pre></li><li><b>File: utilities/../contrib/.svn/text-base/build_exe.py.svn-base:919</b><br/><pre> # XXX On Windows NT, the SYSTEM directory is also searched
+base-920- exedir = os.path.dirname(sys.executable)
+base-921- syspath = os.environ['PATH']
+base-922- loadpath = ';'.join([exedir, sysdir, windir, syspath])
+</pre></li><li><b>File: utilities/../contrib/.svn/text-base/build_exe.py.svn-base:1329</b><br/><pre># XXX This list is NOT complete (it cannot be)
+base-1330-# Note: ALL ENTRIES MUST BE IN LOWER CASE!
+base-1331-EXCLUDED_DLLS = (
+base-1332- "advapi32.dll",
+</pre></li><li><b>File: utilities/../contrib/.svn/text-base/build_exe.py.svn-base:1362</b><br/><pre># XXX Perhaps it would be better to assume dlls from the systemdir are system dlls,
+base-1363-# and make some exceptions for known dlls, like msvcr71, pythonXY.dll, and so on?
+base-1364-def isSystemDLL(pathname):
+base-1365- if os.path.basename(pathname).lower() in ("msvcr71.dll", "msvcr71d.dll"):
+</pre></li><li><b>File: utilities/../contrib/build_exe.py:6</b><br/><pre># Todo:
+#
+# Make 'unbuffered' a per-target option
+
+</pre></li><li><b>File: utilities/../contrib/build_exe.py:357</b><br/><pre>## extra_path = ["."] # XXX
+ extra_path = []
+ dlls, unfriendly_dlls, other_depends = \
+ self.find_dependend_dlls(dlls,
+</pre></li><li><b>File: utilities/../contrib/build_exe.py:403</b><br/><pre> # XXX all dlls are copied into the same directory - a flat name space.
+ # sooner or later that will give conflicts.
+ dst = os.path.join(self.lib_dir, os.path.basename(item.__file__))
+ self.copy_file(src, dst, preserve_mode=0)
+</pre></li><li><b>File: utilities/../contrib/build_exe.py:919</b><br/><pre> # XXX On Windows NT, the SYSTEM directory is also searched
+ exedir = os.path.dirname(sys.executable)
+ syspath = os.environ['PATH']
+ loadpath = ';'.join([exedir, sysdir, windir, syspath])
+</pre></li><li><b>File: utilities/../contrib/build_exe.py:1329</b><br/><pre># XXX This list is NOT complete (it cannot be)
+# Note: ALL ENTRIES MUST BE IN LOWER CASE!
+EXCLUDED_DLLS = (
+ "advapi32.dll",
+</pre></li><li><b>File: utilities/../contrib/build_exe.py:1362</b><br/><pre># XXX Perhaps it would be better to assume dlls from the systemdir are system dlls,
+# and make some exceptions for known dlls, like msvcr71, pythonXY.dll, and so on?
+def isSystemDLL(pathname):
+ if os.path.basename(pathname).lower() in ("msvcr71.dll", "msvcr71d.dll"):
+</pre></li><li><b>File: utilities/../utilities/.svn/text-base/setup_win32.py.svn-base:84</b><br/><pre> pexe['innosetup'] = os.environ.get('INNOSETUP') # TODO:
+base-85- pexe['inno_templates'] = "template.iss"
+base-86- pexe['app_name'] = 'pyMoul'
+base-87- pexe['includes'].extend(findPyTz())
+</pre></li><li><b>File: utilities/../utilities/.svn/text-base/distutils_upx.py.svn-base:117</b><br/><pre> sys.exit(retcode) # XXX
+base-118-
+base-119- def _upxAvailable(self):
+base-120- """Search for UPX in search path
+</pre></li><li><b>File: utilities/../utilities/.svn/text-base/ez_setup.py.svn-base:92</b><br/><pre> # XXX could we install in a subprocess here?
+base-93- print >>sys.stderr, (
+base-94- "The required version of setuptools (>=%s) is not available, and\n"
+base-95- "can't be installed while this script is running. Please install\n"
+</pre></li><li><b>File: utilities/../utilities/setup_win32.py:84</b><br/><pre> pexe['innosetup'] = os.environ.get('INNOSETUP') # TODO:
+ pexe['inno_templates'] = "template.iss"
+ pexe['app_name'] = 'pyMoul'
+ pexe['includes'].extend(findPyTz())
+</pre></li><li><b>File: utilities/../utilities/distutils_upx.py:117</b><br/><pre> sys.exit(retcode) # XXX
+
+ def _upxAvailable(self):
+ """Search for UPX in search path
+</pre></li><ol></body></html>
\ No newline at end of file
Deleted: pymoul/trunk/ez_setup.py
===================================================================
--- pymoul/trunk/ez_setup.py 2007-02-02 17:13:40 UTC (rev 120)
+++ pymoul/trunk/ez_setup.py 2007-02-02 17:22:22 UTC (rev 121)
@@ -1,228 +0,0 @@
-#!python
-"""Bootstrap setuptools installation
-
-If you want to use setuptools in your package's setup.py, just include this
-file in the same directory with it, and add this to the top of your setup.py::
-
- from ez_setup import use_setuptools
- use_setuptools()
-
-If you want to require a specific version of setuptools, set a download
-mirror, or use an alternate download directory, you can do so by supplying
-the appropriate options to ``use_setuptools()``.
-
-This file can also be run as a script to install or upgrade setuptools.
-"""
-import sys
-DEFAULT_VERSION = "0.6c5"
-DEFAULT_URL = "http://cheeseshop.python.org/packages/%s/s/setuptools/" % sys.version[:3]
-
-md5_data = {
- 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca',
- 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb',
- 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b',
- 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a',
- 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618',
- 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac',
- 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5',
- 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4',
- 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c',
- 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b',
- 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27',
- 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277',
- 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa',
- 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e',
- 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e',
- 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f',
- 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2',
- 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc',
- 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167',
- 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64',
- 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d',
-}
-
-import sys, os
-
-def _validate_md5(egg_name, data):
- if egg_name in md5_data:
- from md5 import md5
- digest = md5(data).hexdigest()
- if digest != md5_data[egg_name]:
- print >>sys.stderr, (
- "md5 validation of %s failed! (Possible download problem?)"
- % egg_name
- )
- sys.exit(2)
- return data
-
-
-def use_setuptools(
- version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
- download_delay=15
-):
- """Automatically find/download setuptools and make it available on sys.path
-
- `version` should be a valid setuptools version number that is available
- as an egg for download under the `download_base` URL (which should end with
- a '/'). `to_dir` is the directory where setuptools will be downloaded, if
- it is not already available. If `download_delay` is specified, it should
- be the number of seconds that will be paused before initiating a download,
- should one be required. If an older version of setuptools is installed,
- this routine will print a message to ``sys.stderr`` and raise SystemExit in
- an attempt to abort the calling script.
- """
- try:
- import setuptools
- if setuptools.__version__ == '0.0.1':
- print >>sys.stderr, (
- "You have an obsolete version of setuptools installed. Please\n"
- "remove it from your system entirely before rerunning this script."
- )
- sys.exit(2)
- except ImportError:
- egg = download_setuptools(version, download_base, to_dir, download_delay)
- sys.path.insert(0, egg)
- import setuptools; setuptools.bootstrap_install_from = egg
-
- import pkg_resources
- try:
- pkg_resources.require("setuptools>="+version)
-
- except pkg_resources.VersionConflict, e:
- # XXX could we install in a subprocess here?
- print >>sys.stderr, (
- "The required version of setuptools (>=%s) is not available, and\n"
- "can't be installed while this script is running. Please install\n"
- " a more recent version first.\n\n(Currently using %r)"
- ) % (version, e.args[0])
- sys.exit(2)
-
-def download_setuptools(
- version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
- delay = 15
-):
- """Download setuptools from a specified location and return its filename
-
- `version` should be a valid setuptools version number that is available
- as an egg for download under the `download_base` URL (which should end
- with a '/'). `to_dir` is the directory where the egg will be downloaded.
- `delay` is the number of seconds to pause before an actual download attempt.
- """
- import urllib2, shutil
- egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3])
- url = download_base + egg_name
- saveto = os.path.join(to_dir, egg_name)
...
[truncated message content] |