Changeset 2344 for pykota/trunk/pykota/tool.py
- Timestamp:
- 07/08/05 18:52:50 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/tool.py
r2307 r2344 40 40 from mx import DateTime 41 41 42 from pykota import version, config, storage, logger, accounter, pdlanalyzer 42 from pykota import config, storage, logger, accounter, pdlanalyzer 43 from pykota.version import __version__, __author__, __years__, __gplblurb__ 43 44 44 45 def N_(message) : … … 61 62 for line in traceback.format_exception(*sys.exc_info()) : 62 63 lines.extend([l for l in line.split("\n") if l]) 63 msg = "ERROR: ".join(["%s\n" % l for l in (["ERROR: PyKota v%s" % version.__version__, message] + lines)])64 msg = "ERROR: ".join(["%s\n" % l for l in (["ERROR: PyKota v%s" % __version__, message] + lines)]) 64 65 sys.stderr.write(msg) 65 66 sys.stderr.flush() … … 68 69 class Tool : 69 70 """Base class for tools with no database access.""" 70 def __init__(self, lang="", charset=None, doc="PyKota v% s (c) %s %s" % (version.__version__, version.__copyright__, version.__author__)) :71 def __init__(self, lang="", charset=None, doc="PyKota v%(__version__)s (c) %(__years__)s %(__author__)s") : 71 72 """Initializes the command line tool.""" 72 73 # did we drop priviledges ? … … 206 207 except AttributeError : 207 208 pass 208 print version.__version__209 print __version__ 209 210 sys.exit(0) 210 211 … … 215 216 except AttributeError : 216 217 pass 217 print _(self.documentation) % (version.__version__, version.__copyright__, version.__author__, version.__author__) 218 print _(self.documentation) % globals() 219 print __gplblurb__ 220 print 221 print _("Please report bugs to :"), __author__ 218 222 sys.exit(0) 219 223 … … 232 236 server.sendmail(admin, [admin, crashrecipient], \ 233 237 "From: %s\nTo: %s\nCc: %s\nSubject: PyKota v%s crash traceback !\n\n%s" % \ 234 (admin, crashrecipient, admin, version.__version__, fullmessage))238 (admin, crashrecipient, admin, __version__, fullmessage)) 235 239 server.quit() 236 240 except : … … 299 303 class PyKotaTool(Tool) : 300 304 """Base class for all PyKota command line tools.""" 301 def __init__(self, lang="", charset=None, doc="PyKota %s (c) 2003-2004 %s" % (version.__version__, version.__author__)) :305 def __init__(self, lang="", charset=None, doc="PyKota v%(__version__)s (c) %(__years__)s %(__author__)s") : 302 306 """Initializes the command line tool and opens the database.""" 303 307 Tool.__init__(self, lang, charset, doc)