Mercurial > p > roundup > code
comparison roundup-admin @ 160:002249ffa5d0
init help now lists templates and backends
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 30 Jul 2001 03:52:55 +0000 |
| parents | b07b9a5b6aa9 |
| children | a49c8a2ddd26 |
comparison
equal
deleted
inserted
replaced
| 159:764db91c0dea | 160:002249ffa5d0 |
|---|---|
| 1 #! /usr/bin/python | 1 #! /usr/bin/python |
| 2 # $Id: roundup-admin,v 1.8 2001-07-30 02:37:07 richard Exp $ | 2 # $Id: roundup-admin,v 1.9 2001-07-30 03:52:55 richard Exp $ |
| 3 | 3 |
| 4 import sys | 4 import sys |
| 5 if int(sys.version[0]) < 2: | 5 if int(sys.version[0]) < 2: |
| 6 print 'Roundup requires python 2.0 or later.' | 6 print 'Roundup requires python 2.0 or later.' |
| 7 sys.exit(1) | 7 sys.exit(1) |
| 301 for k, v in globals().items(): | 301 for k, v in globals().items(): |
| 302 if k[:3] == 'do_': | 302 if k[:3] == 'do_': |
| 303 d[k[3:]] = v | 303 d[k[3:]] = v |
| 304 return d | 304 return d |
| 305 | 305 |
| 306 def printInitOptions(): | |
| 307 import roundup.templates | |
| 308 templates = roundup.templates.listTemplates() | |
| 309 print 'Templates:', ', '.join(templates) | |
| 310 import roundup.backends | |
| 311 backends = roundup.backends.__all__ | |
| 312 print 'Back ends:', ', '.join(backends) | |
| 313 | |
| 306 def main(): | 314 def main(): |
| 307 opts, args = getopt.getopt(sys.argv[1:], 'i:u:hc') | 315 opts, args = getopt.getopt(sys.argv[1:], 'i:u:hc') |
| 308 | 316 |
| 309 # handle command-line args | 317 # handle command-line args |
| 310 instance_home = os.environ.get('ROUNDUP_INSTANCE', '') | 318 instance_home = os.environ.get('ROUNDUP_INSTANCE', '') |
| 341 command = figureCommands().get(args[1], None) | 349 command = figureCommands().get(args[1], None) |
| 342 if not command: | 350 if not command: |
| 343 usage('no such command "%s"'%args[1]) | 351 usage('no such command "%s"'%args[1]) |
| 344 return 1 | 352 return 1 |
| 345 print command.__doc__ | 353 print command.__doc__ |
| 354 if args[1] == 'init': | |
| 355 printInitOptions() | |
| 346 return 0 | 356 return 0 |
| 347 usage() | 357 usage() |
| 348 return 0 | 358 return 0 |
| 349 if command == 'morehelp': | 359 if command == 'morehelp': |
| 350 moreusage() | 360 moreusage() |
| 392 if __name__ == '__main__': | 402 if __name__ == '__main__': |
| 393 sys.exit(main()) | 403 sys.exit(main()) |
| 394 | 404 |
| 395 # | 405 # |
| 396 # $Log: not supported by cvs2svn $ | 406 # $Log: not supported by cvs2svn $ |
| 407 # Revision 1.8 2001/07/30 02:37:07 richard | |
| 408 # Freshen is really broken. Commented out. | |
| 409 # | |
| 397 # Revision 1.7 2001/07/30 01:28:46 richard | 410 # Revision 1.7 2001/07/30 01:28:46 richard |
| 398 # Bugfixes | 411 # Bugfixes |
| 399 # | 412 # |
| 400 # Revision 1.6 2001/07/30 00:57:51 richard | 413 # Revision 1.6 2001/07/30 00:57:51 richard |
| 401 # Now uses getopt, much improved command-line parsing. Much fuller help. Much | 414 # Now uses getopt, much improved command-line parsing. Much fuller help. Much |
