Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/shudac/z3c.rml into shuda…
Browse files Browse the repository at this point in the history
…c-master

Conflicts:
	src/z3c/rml/interfaces.py
  • Loading branch information
strichter committed Oct 2, 2015
2 parents b1ad381 + 584d8e0 commit ac3b93b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/z3c/rml/interfaces.py
Expand Up @@ -38,8 +38,9 @@
TEXT_TRANSFORM_CHOICES = ('uppercase', 'lowercase')
LIST_FORMATS = ('I', 'i', '123', 'ABC', 'abc')
ORDERED_LIST_TYPES = ('I', 'i', '1', 'A', 'a', 'l', 'L', 'O', 'o', 'R', 'r')
UNORDERED_BULLET_VALUES = ('bullet', 'circle', 'square', 'disc', 'diamond',
'rarrowhead')
UNORDERED_BULLET_VALUES = (
'bulletchar', 'bullet', 'circle', 'square', 'disc', 'diamond',
'rarrowhead')
LOG_LEVELS = {
'DEBUG': logging.DEBUG,
'INFO': logging.INFO,
Expand Down
17 changes: 15 additions & 2 deletions src/z3c/rml/rml2pdf.py
Expand Up @@ -19,6 +19,7 @@
import zope.interface
from lxml import etree
from z3c.rml import document, interfaces
import argparse

zope.interface.moduleProvides(interfaces.IRML2PDF)

Expand All @@ -42,7 +43,7 @@ def parseString(xml, removeEncodingLine=True, filename=None):

def go(xmlInputName, outputFileName=None, outDir=None, dtdDir=None):
if dtdDir is not None:
sys.stderr.write('The ``dtdDir`` option is not yet supported.')
sys.stderr.write('The ``dtdDir`` option is not yet supported.\n')

xmlFile = open(xmlInputName, 'rb')
root = etree.parse(xmlFile).getroot()
Expand All @@ -67,8 +68,20 @@ def go(xmlInputName, outputFileName=None, outDir=None, dtdDir=None):

def main(args=None):
if args is None:
args = sys.argv[1:]
parser = argparse.ArgumentParser(
prog='rml2pdf',
description='Converts file in RML format into PDF file.',
epilog='Copyright (c) 2007 Zope Foundation and Contributors.'
)
parser.add_argument('xmlInputName', help='RML file to be processed')
parser.add_argument('outputFileName', nargs='?', help='output PDF file name')
parser.add_argument('outDir', nargs='?', help='output directory')
parser.add_argument('dtdDir', nargs='?', help='directory with XML DTD (not yet supported)')
pargs = parser.parse_args()
args = (pargs.xmlInputName, pargs.outputFileName, pargs.outDir, pargs.dtdDir)

go(*args)


if __name__ == '__main__':
canvas = go(sys.argv[1])
2 changes: 1 addition & 1 deletion src/z3c/rml/special.py
Expand Up @@ -80,7 +80,7 @@ def getName(self, elem, canvas):
)

def evalString(self, elem, canvas):
return do_eval(self._getText(elem, canvas))
return do_eval(self._getText(elem, canvas, False))

def namedString(self, elem, canvas):
self._getManager().names[elem.get('id')] = self._getText(
Expand Down

0 comments on commit ac3b93b

Please sign in to comment.