# document fields.
import string
+import codecs
import os.path
class BiaCVExporter:
str_languages)
# write to export file
- file (self.file_output, "w").write (str_main)
+ codecs.open (self.file_output, "w", "utf-8").write (str_main)
# fill up the main template
def _get_main (self, education, profession, shortterm, longterm, skills, languages):
# main template
- tpl_main = string.Template (file (self.fil_main, "r").read ())
+ tpl_main = string.Template (codecs.open (self.fil_main, "r", "utf-8").read ())
if self.data["maritalstatus"] is True:
str_marital = self.lang_strings[3]
# get the language list
def _get_languages (self):
- tpl_language = string.Template (file (self.fil_language, "r").read ())
+ tpl_language = string.Template (codecs.open (self.fil_language, "r", "utf-8").read ())
lst_languages = []
# loop through each item
# get the skills
def _get_skills (self):
# load the template
- tpl_skill = string.Template (file (self.fil_skills, "r").read ())
+ tpl_skill = string.Template (codecs.open (self.fil_skills, "r", "utf-8").read ())
lst_skills = []
# loop through each item
# get short term career objectives
def _get_career (self):
# load the template
- tpl_career = string.Template (file (self.fil_career, "r").read ())
+ tpl_career = string.Template (codecs.open (self.fil_career, "r", "utf-8").read ())
lst_shorttermcareer = []
lst_longtermgoals = []
# fill the professional history template
def _get_profession (self):
# load the template
- tpl_profession = string.Template (file (self.fil_profession, "r").read ())
+ tpl_profession = string.Template (codecs.open (self.fil_profession, "r", "utf-8").read ())
lst_profession = []
# loop through each item
# fill the education template
def _get_education (self):
# load the template
- tpl_education = string.Template (file (self.fil_education, "r").read ())
+ tpl_education = string.Template (codecs.open (self.fil_education, "r", "utf-8").read ())
lst_education = []
# loop through each item
self.fil_language = os.path.join (templatedir, "language_bit.tpl")
# load language strings
- self.lang_strings = file (os.path.join (templatedir, "misc_strings.txt"), "r").readlines ()
+ lang_str = codecs.open (os.path.join (templatedir, "misc_strings.txt"), "r", "utf-8").read ()
+
+ self.lang_strings = lang_str.splitlines ()
# set the output file
def set_output (self, output):