Changeset 697
- Timestamp:
- 02/05/03 23:02:22 (22 years ago)
- Location:
- pykota/trunk/pykota
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/logger.py
r695 r697 15 15 # 16 16 # $Log$ 17 # Revision 1.2 2003/02/05 22:02:22 jalet 18 # __import__ statement didn't work as expected 19 # 17 20 # Revision 1.1 2003/02/05 21:28:17 jalet 18 21 # Initial import into CVS … … 36 39 backend = config.getLoggingBackend() 37 40 try : 38 module = __import__("pykota.loggers." + backend.lower()) 41 if not isalpha(backend) : 42 # don't trust user input 43 raise ImportError 44 exec "from pykota.loggers import %s as loggingbackend" % backend.lower() 39 45 except ImportError : 40 46 raise PyKotaLoggingError, "Unsupported logging subsystem %s" % backend 41 47 else : 42 return getattr( module, "Logger")()48 return getattr(loggingbackend, "Logger")() -
pykota/trunk/pykota/requester.py
r695 r697 15 15 # 16 16 # $Log$ 17 # Revision 1.2 2003/02/05 22:02:22 jalet 18 # __import__ statement didn't work as expected 19 # 17 20 # Revision 1.1 2003/02/05 21:28:17 jalet 18 21 # Initial import into CVS … … 34 37 backend = config.getRequesterBackend(printername) 35 38 try : 36 module = __import__("pykota.requesters." + backend.lower()) 39 if not isalpha(backend) : 40 # don't trust user input 41 raise ImportError 42 exec "from pykota.requesters import %s as requesterbackend" % backend.lower() 37 43 except ImportError : 38 44 raise PyKotaRequesterError, "Unsupported requester backend %s" % backend 39 45 else : 40 return getattr( module, "Requester")(config, printername)46 return getattr(requesterbackend, "Requester")(config, printername) -
pykota/trunk/pykota/storage.py
r695 r697 15 15 # 16 16 # $Log$ 17 # Revision 1.2 2003/02/05 22:02:22 jalet 18 # __import__ statement didn't work as expected 19 # 17 20 # Revision 1.1 2003/02/05 21:28:17 jalet 18 21 # Initial import into CVS … … 34 37 (backend, host, database, admin, user) = config.getStorageBackend() 35 38 try : 36 module = __import__("pykota.storages." + backend.lower()) 39 if not isalpha(backend) : 40 # don't trust user input 41 raise ImportError 42 exec "from pykota.storages import %s as storagebackend" % backend.lower() 37 43 except ImportError : 38 44 raise PyKotaStorageError, "Unsupported quota storage backend %s" % backend 39 45 else : 40 return getattr( module, "Storage")(host, database, (asadmin and admin) or user)46 return getattr(storagebackend, "Storage")(host, database, (asadmin and admin) or user)