~jaap.karssenberg/zim/pyzim-gtk3

« back to all changes in this revision

Viewing changes to zim/formats/__init__.py

  • Committer: Jaap Karssenberg
  • Date: 2014-11-11 20:26:12 UTC
  • Revision ID: jaap.karssenberg@gmail.com-20141111202612-9b20odbya6kyd5hd
Fixing regressions due to setlocale

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
BLOCK_LEVEL = (PARAGRAPH, HEADING, VERBATIM_BLOCK, BLOCK, OBJECT, IMAGE, LISTITEM)
132
132
 
133
133
 
 
134
_letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
 
135
 
134
136
def increase_list_iter(listiter):
135
137
        '''Get the next item in a list for a numbered list
136
138
        E.g if C{listiter} is C{"1"} this function returns C{"2"}, if it
144
146
                return str(i + 1)
145
147
        except ValueError:
146
148
                try:
147
 
                        i = string.letters.index(listiter)
148
 
                        return string.letters[i+1]
 
149
                        i = _letters.index(listiter)
 
150
                        return _letters[i+1]
149
151
                except ValueError: # listiter is not a letter
150
152
                        return None
151
153
                except IndexError: # wrap to start of list
152
 
                        return string.letters[0]
 
154
                        return _letters[0]
153
155
 
154
156
def encode_xml(text):
155
157
        '''Encode text such that it can be used in xml