Show
Ignore:
Timestamp:
06/16/06 16:25:49 (18 years ago)
Author:
jerome
Message:

Replaced the 'exec' statements with the use of the standard 'imp' module.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/accounter.py

    r2635 r2945  
    2424 
    2525import sys 
     26import os 
     27import imp 
    2628 
    2729class PyKotaAccounterError(Exception): 
     
    9698        (backend, args) = kotafilter.config.getAccounterBackend(kotafilter.PrinterName) 
    9799    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())) 
    99104    except ImportError : 
    100105        raise PyKotaAccounterError, _("Unsupported accounter backend %s") % backend