comparison MoinMoin/scripts/_util.py @ 33:55ff4feb0f59

src cosmetics: remove TODOs, CVS stuff imported from: moin--main--1.5--patch-34
author Thomas Waldmann <tw@waldmann-edv.de>
date Sun, 25 Sep 2005 11:36:51 +0000
parents 77665d8e2254
children
comparison
equal deleted inserted replaced
32:5153d7c2b1c1 33:55ff4feb0f59
3 MoinMoin - Command line utilities 3 MoinMoin - Command line utilities
4 4
5 @copyright: 2000, 2001, 2002 by Jürgen Hermann <jh@web.de> 5 @copyright: 2000, 2001, 2002 by Jürgen Hermann <jh@web.de>
6 @license: GNU GPL, see COPYING for details. 6 @license: GNU GPL, see COPYING for details.
7 """ 7 """
8 __version__ = "$Revision: 1.6 $"[11:-2]
9 8
10 # Imports
11 import os, sys 9 import os, sys
12 10
13 # Globals
14 flag_quiet = 0 11 flag_quiet = 0
15 script_module = '__main__' 12 script_module = '__main__'
16 13
17 14
18 ############################################################################# 15 #############################################################################
53 50
54 import optparse 51 import optparse
55 from MoinMoin import version 52 from MoinMoin import version
56 53
57 cmd = self.script_module.__name__.split('.')[-1].replace('_', '-') 54 cmd = self.script_module.__name__.split('.')[-1].replace('_', '-')
58 ver = self.script_module.__version__ 55 rev = "%s %s [%s]" % (version.project, version.release, version.revision)
59 rev = "%s (%s %s [%s])" % (
60 ver, version.project, version.release, version.revision)
61 sys.argv[0] = cmd 56 sys.argv[0] = cmd
62 57
63 self.parser = optparse.OptionParser( 58 self.parser = optparse.OptionParser(
64 usage= 59 usage="%(cmd)s %(usage)s\n\n" % {'cmd': cmd, 'usage': usage, },
65 "%(cmd)s %(usage)s\n"
66 "\n"
67 "%(cmd)s v%(ver)s, Copyright (c) 2002, 2003 by Jürgen Hermann <jh@web.de>"
68 % {'cmd': cmd, 'usage': usage, 'ver': ver},
69 version=rev) 60 version=rev)
70 self.parser.add_option( 61 self.parser.add_option(
71 "-q", "--quiet", 62 "-q", "--quiet",
72 action="store_true", dest="quiet", 63 action="store_true", dest="quiet",
73 help="Be quiet (no informational messages)" 64 help="Be quiet (no informational messages)"