@@ -64,12 +82,12 @@ class ScourOptions:
style_to_xml = True
group_collapse = True
strip_ids = False
- digits = 5
- embed_rasters = False
+ digits = 5
# params are the form elements (if a checkbox is unchecked it will not be present)
def fetch(req, indoc,**params):
req.content_type = "image/svg+xml"
+ fs = req.form
options = ScourOptions()
# interpret form options
@@ -83,5 +101,11 @@ def fetch(req, indoc,**params):
options.simple_colors = False
options.digits = int(params['digits'])
- req.write(scourString(indoc,options))
+ fileitem = fs['upload']
+ if fileitem.filename:
+ req.write(scourString(fileitem.file.read()))
+ else:
+ req.write(scourString(indoc,options))
+
+ req.write( '')