Completed default XHTML template for exporter
[biacv.git] / biacv_exporter.py
diff --git a/biacv_exporter.py b/biacv_exporter.py
new file mode 100644 (file)
index 0000000..43bc635
--- /dev/null
@@ -0,0 +1,36 @@
+# class to export data in BiaCV native format to any external format as
+# specified by a template set. The final document is produced by putting
+# together the template "bits" into a single document and filling in the
+# document fields.
+
+import string.Template
+
+class BiaCVExporter:
+       def __init__ (self):
+               self.data = {}
+
+       # set the document data
+       def set_data (self, data):
+               # document data
+               self.data = data
+
+       # set the template directory and the files within
+       def set_template_directory (self, templatedir):
+               # set the template file names
+
+               # main document template
+               self.fil_main = os.path.join (templatedir, "main.tpl")
+               # education qualification bit
+               self.fil_education = os.path.join (templatedir, "education_bit.tpl")
+               # profession history bit
+               self.fil_profession = os.path.join (templatedir, "profession_bit.tpl")
+               # career list bit
+               self.fil_career = os.path.join (templatedir, "career_bit.tpl")
+               # skills bit
+               self.fil_skills = os.path.join (templatedir, "skill_bit.tpl")
+               # languages learned bit
+               self.fil_language = os.path.join (templatedir, "language_bit.tpl")
+
+       # set the output file
+       def set_output (self, output):
+               self.file_output = output