comparison roundup/admin.py @ 489:5db2dad23f09

[SF#500140] AdminTool.get_class() returns nothing
author Richard Jones <richard@users.sourceforge.net>
date Mon, 07 Jan 2002 10:41:44 +0000
parents b35f229dd049
children 3df718d48a5d
comparison
equal deleted inserted replaced
488:ab9e236cd524 489:5db2dad23f09
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.1 2002-01-05 02:11:22 richard Exp $ 19 # $Id: admin.py,v 1.2 2002-01-07 10:41:44 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:
65 65
66 def get_class(self, classname): 66 def get_class(self, classname):
67 '''Get the class - raise an exception if it doesn't exist. 67 '''Get the class - raise an exception if it doesn't exist.
68 ''' 68 '''
69 try: 69 try:
70 cl = 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(args, klass=None): 74 def props_from_args(args, klass=None):
75 props = {} 75 props = {}
993 tool = AdminTool() 993 tool = AdminTool()
994 sys.exit(tool.main()) 994 sys.exit(tool.main())
995 995
996 # 996 #
997 # $Log: not supported by cvs2svn $ 997 # $Log: not supported by cvs2svn $
998 # Revision 1.1 2002/01/05 02:11:22 richard
999 # I18N'ed roundup admin - and split the code off into a module so it can be used
1000 # elsewhere.
1001 # Big issue with this is the doc strings - that's the help. We're probably going to
1002 # have to switch to not use docstrings, which will suck a little :(
1003 #
998 # 1004 #
999 # 1005 #
1000 # vim: set filetype=python ts=4 sw=4 et si 1006 # vim: set filetype=python ts=4 sw=4 et si

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