Package translate :: Package storage :: Module txt

[hide private]
[frames] | no frames]

# Module txt

source code

This class implements the functionality for handling plain text files, or similar wiki type files.

Supported formats are

- Plain text
- dokuwiki
- MediaWiki

Classes | [hide private]

| TxtUnit This class represents a block of text from a text file
| TxtFile This class represents a text file, made up of txtunits

Variables | [hide private]

| dokuwiki = ``[``(``'``Dokuwiki heading``'``,` re.compile(r'`(` `?`=`{2,6}`\s`*``)``(`.`+``...``
| mediawiki = ``[``(``'``MediaWiki heading``'``,` re.compile(r'`(`=`{2,5}`\s`*``)``(`.`+``...``
| flavours = ``{`None`:` `[``]``,` `'``dokuwiki``'``:` `[``(``'``Dokuwiki heading``'``,` re.com`...``

Imports: base, re

Variables Details | [hide private]

### dokuwiki

Value:

      [('Dokuwiki heading',
        re.compile(r'( ?={2,6}\s*)(.+)'),
        re.compile(r'(\s*={2,6}\s*)$')),
       ('Dokuwiki bullet',
        re.compile(r'(\s{2,}\*\s*)(.+)'),
        re.compile(r'\s+$')),
       ('Dokuwiki numbered item',
        re.compile(r'(\s{2,}-\s*)(.+)'),
      ...

### mediawiki

Value:

      [('MediaWiki heading',
        re.compile(r'(={2,5}\s*)(.+)'),
        re.compile(r'(\s*={2,5}\s*)$')),
       ('MediaWiki bullet',
        re.compile(r'(\*+\s*)(.+)'),
        re.compile(r'\s+$')),
       ('MediaWiki numbered item',
        re.compile(r'(#+\s*)(.+)'),
      ...

### flavours

Value:

      {None: [],
       'dokuwiki': [('Dokuwiki heading',
                     re.compile(r'( ?={2,6}\s*)(.+)'),
                     re.compile(r'(\s*={2,6}\s*)$')),
                    ('Dokuwiki bullet',
                     re.compile(r'(\s{2,}\*\s*)(.+)'),
                     re.compile(r'\s+$')),
                    ('Dokuwiki numbered item', re.compile(r'(\s{2,}-\s*)(.+)
      ...