VirtualMailManager/__init__.py
branchv0.6.x
changeset 174 974bafa59330
parent 162 0ac9ef587769
child 185 6e1ef32fbd82
equal deleted inserted replaced
173:c0e2c7687dd3 174:974bafa59330
    36     for arg in args:
    36     for arg in args:
    37         _write(arg.encode(ENCODING, 'replace'))
    37         _write(arg.encode(ENCODING, 'replace'))
    38         _write('\n')
    38         _write('\n')
    39     os.sys.exit(code)
    39     os.sys.exit(code)
    40 
    40 
       
    41 def get_unicode(string):
       
    42     """Converts `string` to `unicode`, if necessary."""
       
    43     if isinstance(string, unicode):
       
    44         return string
       
    45     return unicode(string, ENCODING, 'replace')
       
    46 
    41 __all__ = [
    47 __all__ = [
    42         # imported modules
    48         # imported modules
    43         'os', 're', 'locale',
    49         'os', 're', 'locale',
    44         # version information from VERSION
    50         # version information from VERSION
    45         '__author__', '__date__', '__version__',
    51         '__author__', '__date__', '__version__',
    46         # error codes
    52         # error codes
    47         'ERR',
    53         'ERR',
    48         # defined stuff
    54         # defined stuff
    49         'ENCODING', 'w_std', 'w_err'
    55         'ENCODING', 'get_unicode', 'w_std', 'w_err'
    50         ]
    56         ]
    51 # EOF
    57 # EOF