[Repoze-checkins] r669 - in repoze.trac/trunk: . repoze/trac
Chris McDonough
chrism at agendaless.com
Wed Feb 6 00:33:52 UTC 2008
Author: Chris McDonough <chrism at agendaless.com>
Date: Tue Feb 5 19:33:52 2008
New Revision: 669
Log:
Cause mktracinstance console_script to get installed.
Modified:
repoze.trac/trunk/repoze/trac/__init__.py
repoze.trac/trunk/setup.py
Modified: repoze.trac/trunk/repoze/trac/__init__.py
==============================================================================
--- repoze.trac/trunk/repoze/trac/__init__.py (original)
+++ repoze.trac/trunk/repoze/trac/__init__.py Tue Feb 5 19:33:52 2008
@@ -1,4 +1,6 @@
+import optparse
import os
+import os.path
import re
import sys
@@ -45,3 +47,15 @@
targetfile = os.path.join(sandbox, 'etc', target)
if not os.path.exists(targetfile):
open(targetfile, 'w').write(result)
+
+def main(argv=sys.argv):
+ """ Console script target """
+ parser = optparse.OptionParser(
+ usage='%prog [PATH]'
+ )
+ options, args = parser.parse_args(sys.argv)
+ if len(args) != 2:
+ parser.print_help(sys.stderr)
+ sys.exit(1)
+ path = os.path.realpath(args[1])
+ make_instance(path)
Modified: repoze.trac/trunk/setup.py
==============================================================================
--- repoze.trac/trunk/setup.py (original)
+++ repoze.trac/trunk/setup.py Tue Feb 5 19:33:52 2008
@@ -12,7 +12,7 @@
#
##############################################################################
-__version__ = '0.2'
+__version__ = '0.3'
import os
@@ -56,6 +56,9 @@
[paste.app_factory]
trac = repoze.trac:make_trac
+
+ [console_scripts]
+ mktracinstance = repoze.trac:main
"""
)
More information about the Repoze-checkins
mailing list