appy.pod: solved bug https://bugs.launchpad.net/appy/+bug/719270; appy.gen: bugfix in Date intervals coming from search.pt.
This commit is contained in:
parent
1bb4dbf20a
commit
91c657238d
|
@ -558,12 +558,15 @@ class ToolMixin(BaseMixin):
|
|||
if setMin: day = 1
|
||||
else: day = 31
|
||||
DateTime = self.getProductConfig().DateTime
|
||||
# Set the hour
|
||||
if setMin: hour = '00:00'
|
||||
else: hour = '23:59'
|
||||
# We loop until we find a valid date. For example, we could loop from
|
||||
# 2009/02/31 to 2009/02/28.
|
||||
dateIsWrong = True
|
||||
while dateIsWrong:
|
||||
try:
|
||||
res = DateTime('%s/%s/%s' % (year, month, day))
|
||||
res = DateTime('%s/%s/%s %s' % (year, month, day, hour))
|
||||
dateIsWrong = False
|
||||
except:
|
||||
day = int(day)-1
|
||||
|
|
|
@ -228,8 +228,8 @@ class Renderer:
|
|||
stylesMapping = self.stylesManager.checkStylesMapping(stylesMapping)
|
||||
ns = self.currentParser.env.namespaces
|
||||
# xhtmlString is only a chunk of XHTML. So we must surround it a tag in
|
||||
# order to get a XML-compliant file (we need a root tag)
|
||||
xhtmlContent = '<podXhtml>%s</podXhtml>' % xhtmlString
|
||||
# order to get a XML-compliant file (we need a root tag).
|
||||
xhtmlContent = '<p>%s</p>' % xhtmlString
|
||||
return Xhtml2OdtConverter(xhtmlContent, encoding, self.stylesManager,
|
||||
stylesMapping, ns).run()
|
||||
|
||||
|
|
|
@ -151,9 +151,9 @@ class StylesParser(OdfParser):
|
|||
# Record this style in the environment
|
||||
e.styles[style.name] = style
|
||||
e.currentStyle = style
|
||||
outlineLevelKey = '%s:default-outline-level' % e.ns(e.NS_STYLE)
|
||||
if attrs.has_key(outlineLevelKey):
|
||||
style.outlineLevel = int(attrs[outlineLevelKey])
|
||||
levelKey = '%s:default-outline-level' % e.ns(e.NS_STYLE)
|
||||
if attrs.has_key(levelKey) and attrs[levelKey].strip():
|
||||
style.outlineLevel = int(attrs[levelKey])
|
||||
else:
|
||||
if e.state == PARSING_STYLE:
|
||||
# I am parsing tags within the style.
|
||||
|
|
3395
pod/test/Tests.rtf
3395
pod/test/Tests.rtf
File diff suppressed because it is too large
Load diff
Binary file not shown.
Binary file not shown.
|
@ -18,7 +18,7 @@ from appy.pod import *
|
|||
HTML_2_ODT = {'h1':'h', 'h2':'h', 'h3':'h', 'h4':'h', 'h5':'h', 'h6':'h',
|
||||
'p':'p', 'b':'span', 'i':'span', 'strong':'span', 'strike':'span',
|
||||
'u':'span', 'em': 'span', 'sub': 'span', 'sup': 'span',
|
||||
'br': 'line-break', 'div': 'span', 'podxhtml':'p'}
|
||||
'br': 'line-break', 'div': 'span'}
|
||||
DEFAULT_ODT_STYLES = {'b': 'podBold', 'strong':'podBold', 'i': 'podItalic',
|
||||
'u': 'podUnderline', 'strike': 'podStrike',
|
||||
'em': 'podItalic', 'sup': 'podSup', 'sub':'podSub',
|
||||
|
@ -37,8 +37,7 @@ class HtmlElement:
|
|||
'''Every time an HTML element is encountered during the SAX parsing,
|
||||
an instance of this class is pushed on the stack of currently parsed
|
||||
elements.'''
|
||||
elemTypes = {'p':'para', 'li':'para','ol':'list','ul':'list',
|
||||
'podxhtml': 'para'}
|
||||
elemTypes = {'p':'para', 'li':'para','ol':'list','ul':'list'}
|
||||
def __init__(self, elem, attrs):
|
||||
self.elem = elem
|
||||
# Keep "class" attribute (useful for finding the corresponding ODT
|
||||
|
|
Loading…
Reference in a new issue