/usr/lib/python2.6/site-packages/tablib/packages/odf3
NameSizeModeActions
anim.py18720644editdlrm
anim.pyc27240644editdlrm
attrconverters.py682100644editdlrm
attrconverters.pyc573550644editdlrm
chart.py26360644editdlrm
chart.pyc46240644editdlrm
config.py14200644editdlrm
config.pyc13910644editdlrm
dc.py22250644editdlrm
dc.pyc14640644editdlrm
dr3d.py14480644editdlrm
dr3d.pyc15240644editdlrm
draw.py55900644editdlrm
draw.pyc103430644editdlrm
easyliststyle.py37730644editdlrm
easyliststyle.pyc23120644editdlrm
element.py204730755editdlrm
element.pyc222500644editdlrm
elementtypes.py99330755editdlrm
elementtypes.pyc87290644editdlrm
form.py32700644editdlrm
form.pyc63900644editdlrm
grammar.py1933880644editdlrm
grammar.pyc1064580644editdlrm
load.py39630755editdlrm
load.pyc34090644editdlrm
manifest.py13890755editdlrm
manifest.pyc13440644editdlrm
math.py10680644editdlrm
math.pyc4590644editdlrm
meta.py21380644editdlrm
meta.pyc32430644editdlrm
namespaces.py39430644editdlrm
namespaces.pyc33140644editdlrm
number.py31370644editdlrm
number.pyc57430644editdlrm
odf2moinmoin.py181920644editdlrm
odf2moinmoin.pyc187740644editdlrm
odf2xhtml.py650580755editdlrm
odf2xhtml.pyc646200644editdlrm
odfmanifest.py35700755editdlrm
odfmanifest.pyc40720644editdlrm
office.py33460644editdlrm
office.pyc58950644editdlrm
opendocument.py259070644editdlrm
opendocument.pyc255300644editdlrm
presentation.py27160644editdlrm
presentation.pyc45550644editdlrm
script.py11060644editdlrm
script.pyc4840644editdlrm
style.py46720644editdlrm
style.pyc90620644editdlrm
svg.py17900644editdlrm
svg.pyc24060644editdlrm
table.py94080644editdlrm
table.pyc205930644editdlrm
teletype.py51810644editdlrm
teletype.pyc44600644editdlrm
text.py172150644editdlrm
text.pyc391260644editdlrm
thumbnail.py317360755editdlrm
thumbnail.pyc318640644editdlrm
userfield.py53940755editdlrm
userfield.pyc51590644editdlrm
xforms.py12330644editdlrm
xforms.pyc8730644editdlrm
__init__.py00644editdlrm
__init__.pyc1480644editdlrm
Edit: /usr/lib/python2.6/site-packages/tablib/packages/odf3/easyliststyle.py (3773B)
# -*- coding: utf-8 -*- # Create a element from a text string. # Copyright (C) 2008 J. David Eisenberg # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # # Contributor(s): # import re from .style import Style, TextProperties, ListLevelProperties from .text import ListStyle,ListLevelStyleNumber,ListLevelStyleBullet """ Create a element from a string or array. List styles require a lot of code to create one level at a time. These routines take a string and delimiter, or a list of strings, and creates a element for you. Each item in the string (or array) represents a list level * style for levels 1-10.

* *

If an item contains 1, I, * i, A, or a, then it is presumed * to be a numbering style; otherwise it is a bulleted style.

""" _MAX_LIST_LEVEL = 10 SHOW_ALL_LEVELS = True SHOW_ONE_LEVEL = False def styleFromString(name, specifiers, delim, spacing, showAllLevels): specArray = specifiers.split(delim) return styleFromList( name, specArray, spacing, showAllLevels ) def styleFromList( styleName, specArray, spacing, showAllLevels): bullet = "" numPrefix = "" numSuffix = "" numberFormat = "" cssLengthNum = 0 cssLengthUnits = "" numbered = False displayLevels = 0 listStyle = ListStyle(name=styleName) numFormatPattern = re.compile("([1IiAa])") cssLengthPattern = re.compile("([^a-z]+)\\s*([a-z]+)?") m = cssLengthPattern.search( spacing ) if (m != None): cssLengthNum = float(m.group(1)) if (m.lastindex == 2): cssLengthUnits = m.group(2) i = 0 while i < len(specArray): specification = specArray[i] m = numFormatPattern.search(specification) if (m != None): numberFormat = m.group(1) numPrefix = specification[0:m.start(1)] numSuffix = specification[m.end(1):] bullet = "" numbered = True if (showAllLevels): displayLevels = i + 1 else: displayLevels = 1 else: # it's a bullet style bullet = specification numPrefix = "" numSuffix = "" numberFormat = "" displayLevels = 1 numbered = False if (numbered): lls = ListLevelStyleNumber(level=(i+1)) if (numPrefix != ''): lls.setAttribute('numprefix', numPrefix) if (numSuffix != ''): lls.setAttribute('numsuffix', numSuffix) lls.setAttribute('displaylevels', displayLevels) else: lls = ListLevelStyleBullet(level=(i+1),bulletchar=bullet[0]) llp = ListLevelProperties() llp.setAttribute('spacebefore', str(cssLengthNum * (i+1)) + cssLengthUnits) llp.setAttribute('minlabelwidth', str(cssLengthNum) + cssLengthUnits) lls.addElement( llp ) listStyle.addElement(lls) i += 1 return listStyle # vim: set expandtab sw=4 :