- Timestamp:
- 06/16/06 16:25:49 (18 years ago)
- Location:
- pykota/trunk/pykota
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/accounter.py
r2635 r2945 24 24 25 25 import sys 26 import os 27 import imp 26 28 27 29 class PyKotaAccounterError(Exception): … … 96 98 (backend, args) = kotafilter.config.getAccounterBackend(kotafilter.PrinterName) 97 99 try : 98 exec "from pykota.accounters import %s as accounterbackend" % backend.lower() 100 accounterbackend = imp.load_source("accounterbackend", 101 os.path.join(os.path.dirname(__file__), 102 "storages", 103 "%s.py" % backend.lower())) 99 104 except ImportError : 100 105 raise PyKotaAccounterError, _("Unsupported accounter backend %s") % backend -
pykota/trunk/pykota/logger.py
r2622 r2945 23 23 # 24 24 25 import os 26 import imp 27 25 28 class PyKotaLoggingError(Exception): 26 29 """An exception for logging related stuff.""" … … 35 38 """Returns the appropriate logger subsystem object.""" 36 39 try : 37 exec "from pykota.loggers import %s as loggingbackend" % backend.lower() 40 loggingbackend = imp.load_source("loggingbackend", 41 os.path.join(os.path.dirname(__file__), 42 "loggers", 43 "%s.py" % backend.lower())) 38 44 except ImportError : 39 45 raise PyKotaLoggingError, _("Unsupported logging subsystem %s") % backend -
pykota/trunk/pykota/reporter.py
r2879 r2945 23 23 # 24 24 25 import os 26 import imp 25 27 from mx import DateTime 26 28 … … 142 144 """Returns a reporter instance of the proper reporter.""" 143 145 try : 144 exec "from pykota.reporters import %s as reporterbackend" % reporttype.lower() 146 reporterbackend = imp.load_source("reporterbackend", 147 os.path.join(os.path.dirname(__file__), 148 "reporters", 149 "%s.py" % reporttype.lower())) 145 150 except ImportError : 146 151 raise PyKotaReporterError, _("Unsupported reporter backend %s") % reporttype -
pykota/trunk/pykota/storage.py
r2937 r2945 23 23 # 24 24 25 import os 26 import imp 25 27 from mx import DateTime 26 28 … … 750 752 backend = backendinfo["storagebackend"] 751 753 try : 752 exec "from pykota.storages import %s as storagebackend" % backend.lower() 754 storagebackend = imp.load_source("storagebackend", 755 os.path.join(os.path.dirname(__file__), 756 "storages", 757 "%s.py" % backend.lower())) 753 758 except ImportError : 754 759 raise PyKotaStorageError, _("Unsupported quota storage backend %s") % backend