class BiaCVExporter:
def __init__ (self):
self.data = {}
+ self.exporter_name = ""
+ self.export_filter = ""
# set the document data
def set_data (self, data):
# set the template directory and the files within
def set_template_directory (self, templatedir):
+ # load the meta file for exporter title and name
+ file_meta = os.path.join (templatedir, "META-INFO")
+ lst_file_meta = (codecs.open (file_meta, 'r', "utf-8").read ()).splitlines ()
+ self.exporter_name = lst_file_meta[0]
+ self.export_filter = lst_file_meta[1]
+
# set the template file names
# main document template
self.lang_strings = lang_str.splitlines ()
+
# set the output file
def set_output (self, output):
self.file_output = output
ERROR_DATE = "There is a problem with the date range selected."
SAVE_TITLE = "Save File As"
OPEN_TITLE = "Open File"
-EXPORT_TITLE = "Export As"
OPEN_TEMPLATE_TITLE = "Choose Export Template directory"
ABOUT_TITLE = "About BiaCV"
ABOUT_TEXT = """BiaCV - A resume creator/editor
if templatedir == "":
return
- # get the output file path
- outputfile = PyQt4.QtGui.QFileDialog.getSaveFileName (self,
- lang.EXPORT_TITLE)
-
- if outputfile == "":
- return
-
# create a new exporter object
exp = exporter.BiaCVExporter ()
# set the template directory
exp.set_template_directory (unicode (templatedir.toUtf8(), "utf-8"))
+ # get the output file path
+ outputfile = PyQt4.QtGui.QFileDialog.getSaveFileName (self,
+ exp.exporter_name, filter=exp.export_filter)
+
+ if outputfile == "":
+ return
+
+
# set the output file
exp.set_output (unicode (outputfile.toUtf8(), "utf-8"))
--- /dev/null
+Export as Flat OpenDocument Text
+FODT file(*.fodt);;All files(*.*)
\ No newline at end of file
--- /dev/null
+Export as XHTML
+XHTML file(*.html);;All files(*.*)
\ No newline at end of file