i18n/polib.py
branchstable
changeset 49366 288de6f5d724
parent 48946 642e31cb55f0
equal deleted inserted replaced
49364:e8ea403b1c46 49366:288de6f5d724
    11 
    11 
    12 **polib** provides a simple and pythonic API via the :func:`~polib.pofile` and
    12 **polib** provides a simple and pythonic API via the :func:`~polib.pofile` and
    13 :func:`~polib.mofile` convenience functions.
    13 :func:`~polib.mofile` convenience functions.
    14 """
    14 """
    15 
    15 
    16 from __future__ import absolute_import
       
    17 
    16 
    18 __author__ = 'David Jean Louis <izimobil@gmail.com>'
    17 __author__ = 'David Jean Louis <izimobil@gmail.com>'
    19 __version__ = '1.0.7'
    18 __version__ = '1.0.7'
    20 __all__ = [
    19 __all__ = [
    21     'pofile',
    20     'pofile',
    41 try:
    40 try:
    42     import io
    41     import io
    43 except ImportError:
    42 except ImportError:
    44     # replacement of io.open() for python < 2.6
    43     # replacement of io.open() for python < 2.6
    45     # we use codecs instead
    44     # we use codecs instead
    46     class io(object):
    45     class io:
    47         @staticmethod
    46         @staticmethod
    48         def open(fpath, mode='r', encoding=None):
    47         def open(fpath, mode='r', encoding=None):
    49             return codecs.open(fpath, mode, encoding)
    48             return codecs.open(fpath, mode, encoding)
    50 
    49 
    51 
    50 
   815 
   814 
   816 # }}}
   815 # }}}
   817 # class _BaseEntry {{{
   816 # class _BaseEntry {{{
   818 
   817 
   819 
   818 
   820 class _BaseEntry(object):
   819 class _BaseEntry:
   821     """
   820     """
   822     Base class for :class:`~polib.POEntry` and :class:`~polib.MOEntry` classes.
   821     Base class for :class:`~polib.POEntry` and :class:`~polib.MOEntry` classes.
   823     This class should **not** be instanciated directly.
   822     This class should **not** be instanciated directly.
   824     """
   823     """
   825 
   824 
  1226 
  1225 
  1227 # }}}
  1226 # }}}
  1228 # class _POFileParser {{{
  1227 # class _POFileParser {{{
  1229 
  1228 
  1230 
  1229 
  1231 class _POFileParser(object):
  1230 class _POFileParser:
  1232     """
  1231     """
  1233     A finite state machine to parse efficiently and correctly po
  1232     A finite state machine to parse efficiently and correctly po
  1234     file format.
  1233     file format.
  1235     """
  1234     """
  1236 
  1235 
  1705 
  1704 
  1706 # }}}
  1705 # }}}
  1707 # class _MOFileParser {{{
  1706 # class _MOFileParser {{{
  1708 
  1707 
  1709 
  1708 
  1710 class _MOFileParser(object):
  1709 class _MOFileParser:
  1711     """
  1710     """
  1712     A class to parse binary mo files.
  1711     A class to parse binary mo files.
  1713     """
  1712     """
  1714 
  1713 
  1715     def __init__(self, mofile, *args, **kwargs):
  1714     def __init__(self, mofile, *args, **kwargs):