Package svnmailer :: Module util :: Class _LocaleFile
[show private | hide private]
[frames | no frames]

Class _LocaleFile

object --+
         |
        _LocaleFile


Transform filenames according to locale
Method Summary
  __init__(self, _locale, _os, _sys)
Initialization
basestring fromLocale(self, name, locale_enc)
Transform a file name from locale repr to unicode (hopefully)
basestring toLocale(self, name, name_enc, locale_enc, force)
Transforms a file name to the locale representation
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name...
  __getattribute__(...)
x.__getattribute__('name') <==> x.name...
  __hash__(x)
x.__hash__() <==> hash(x)...
  __reduce__(...)
helper for pickle...
  __reduce_ex__(...)
helper for pickle...
  __repr__(x)
x.__repr__() <==> repr(x)...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value...
  __str__(x)
x.__str__() <==> str(x)...
    Inherited from type
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T...

Instance Variable Summary
str from_enc: The default encoding of filenames coming from the environment
str to_enc: The default encoding of filenames written to disk
bool unicode_system: Does the system support unicode file names?

Method Details

__init__(self, _locale=<module 'locale' from '/usr/lib/python2.3/locale.pyc'>, _os=<module 'os' from '/usr/lib/python2.3/os.pyc'>, _sys=<module 'sys' (built-in)>)
(Constructor)

Initialization
Overrides:
__builtin__.object.__init__

fromLocale(self, name, locale_enc=None)

Transform a file name from locale repr to unicode (hopefully)
Parameters:
name - The name to decode
           (type=basestring)
locale_enc - The locale encoding
           (type=str)
Returns:
The decoded name
           (type=basestring)
Raises:
UnicodeError - An error happend while recoding

toLocale(self, name, name_enc=None, locale_enc=None, force=False)

Transforms a file name to the locale representation
Parameters:
name - The name to consider
           (type=basestring)
name_enc - The source encoding of name, if it's not unicode already
           (type=str)
locale_enc - The file system encoding (used only if it's not a unicode supporting OS)
           (type=str)
force - force transcoding even if unicode system?
           (type=bool)
Returns:
The name in locale representation
           (type=basestring)
Raises:
UnicodeError - An error happened while recoding

Instance Variable Details

from_enc

The default encoding of filenames coming from the environment
Type:
str

to_enc

The default encoding of filenames written to disk
Type:
str

unicode_system

Does the system support unicode file names?
Type:
bool

Generated by Epydoc 2.0 on Sun Sep 25 20:49:06 2005 http://epydoc.sf.net