diff options
author | Ian Weller <ianweller@gmail.com> | 2008-11-06 20:02:32 -0600 |
---|---|---|
committer | Ian Weller <ianweller@gmail.com> | 2008-11-06 20:02:32 -0600 |
commit | 7160f64fd2d506d5f9021ed6639805e9af7ce357 (patch) | |
tree | 3b0007b10c54db5dc10c8100ce279671f5bc473f /fedora_business_cards/generate.py | |
parent | 6a3752bf45daead85162f4b1469f8de1747f7ae2 (diff) | |
download | fedora-business-cards-7160f64fd2d506d5f9021ed6639805e9af7ce357.tar.gz fedora-business-cards-7160f64fd2d506d5f9021ed6639805e9af7ce357.tar.xz fedora-business-cards-7160f64fd2d506d5f9021ed6639805e9af7ce357.zip |
Use configuration file to determine templates
Diffstat (limited to 'fedora_business_cards/generate.py')
-rw-r--r-- | fedora_business_cards/generate.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/fedora_business_cards/generate.py b/fedora_business_cards/generate.py index aa22485..91f1e14 100644 --- a/fedora_business_cards/generate.py +++ b/fedora_business_cards/generate.py @@ -23,9 +23,6 @@ Generates both sides of the business card. from xml.dom import minidom -# local imports -import config - def find_node(doc_node, tag_name, attribute_name, attribute_value): """ @@ -40,12 +37,11 @@ def find_node(doc_node, tag_name, attribute_name, attribute_value): return element -def gen_front(name, title, lines, template="northamerica"): +def gen_front(name, title, lines, template_loc): """ Generates the front of the business card. """ - dom = minidom.parse(config.parser.get('location', 'templates')+'/front-'+\ - template+'.svg') + dom = minidom.parse(template_loc) namenode = find_node(dom, 'text', 'id', 'fullname') namenode.appendChild(dom.createTextNode(name)) titlenode = find_node(dom, 'text', 'id', 'title') @@ -56,10 +52,9 @@ def gen_front(name, title, lines, template="northamerica"): return dom.toxml() -def gen_back(template="northamerica"): +def gen_back(template_loc): """ Generates the back of the business card. """ - dom = minidom.parse(config.parser.get('location', 'templates')+'/back-'+\ - template+'.svg') + dom = minidom.parse(template_loc) return dom.toxml() |