comparison roundup/admin.py @ 649:29f7e41ee437

Ran it through pychecker, made fixes
author Richard Jones <richard@users.sourceforge.net>
date Wed, 27 Feb 2002 03:28:21 +0000
parents 300e17e7045c
children eae9b69a0115
comparison
equal deleted inserted replaced
648:07422fe57db2 649:29f7e41ee437
14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
18 # 18 #
19 # $Id: admin.py,v 1.7 2002-02-20 05:04:32 richard Exp $ 19 # $Id: admin.py,v 1.8 2002-02-27 03:28:21 richard Exp $
20 20
21 import sys, os, getpass, getopt, re, UserDict, shlex 21 import sys, os, getpass, getopt, re, UserDict, shlex
22 try: 22 try:
23 import csv 23 import csv
24 except ImportError: 24 except ImportError:
69 try: 69 try:
70 return self.db.getclass(classname) 70 return self.db.getclass(classname)
71 except KeyError: 71 except KeyError:
72 raise UsageError, _('no such class "%(classname)s"')%locals() 72 raise UsageError, _('no such class "%(classname)s"')%locals()
73 73
74 def props_from_args(self, args, klass=None): 74 def props_from_args(self, args):
75 props = {} 75 props = {}
76 for arg in args: 76 for arg in args:
77 if arg.find('=') == -1: 77 if arg.find('=') == -1:
78 raise UsageError, _('argument "%(arg)s" not propname=value')%locals() 78 raise UsageError, _('argument "%(arg)s" not propname=value')%locals()
79 try: 79 try:
1008 self.usage(str(e)) 1008 self.usage(str(e))
1009 return 1 1009 return 1
1010 1010
1011 # handle command-line args 1011 # handle command-line args
1012 self.instance_home = os.environ.get('ROUNDUP_INSTANCE', '') 1012 self.instance_home = os.environ.get('ROUNDUP_INSTANCE', '')
1013 # TODO: reinstate the user/password stuff (-u arg too)
1013 name = password = '' 1014 name = password = ''
1014 if os.environ.has_key('ROUNDUP_LOGIN'): 1015 if os.environ.has_key('ROUNDUP_LOGIN'):
1015 l = os.environ['ROUNDUP_LOGIN'].split(':') 1016 l = os.environ['ROUNDUP_LOGIN'].split(':')
1016 name = l[0] 1017 name = l[0]
1017 if len(l) > 1: 1018 if len(l) > 1:
1040 tool = AdminTool() 1041 tool = AdminTool()
1041 sys.exit(tool.main()) 1042 sys.exit(tool.main())
1042 1043
1043 # 1044 #
1044 # $Log: not supported by cvs2svn $ 1045 # $Log: not supported by cvs2svn $
1046 # Revision 1.7 2002/02/20 05:04:32 richard
1047 # Wasn't handling the cvs parser feeding properly.
1048 #
1045 # Revision 1.6 2002/01/23 07:27:19 grubert 1049 # Revision 1.6 2002/01/23 07:27:19 grubert
1046 # . allow abbreviation of "help" in admin tool too. 1050 # . allow abbreviation of "help" in admin tool too.
1047 # 1051 #
1048 # Revision 1.5 2002/01/21 16:33:19 rochecompaan 1052 # Revision 1.5 2002/01/21 16:33:19 rochecompaan
1049 # You can now use the roundup-admin tool to pack the database 1053 # You can now use the roundup-admin tool to pack the database

Roundup Issue Tracker: http://roundup-tracker.org/