# fill education data template bit
str_education = self._get_education ()
+ # fill the profile highlight template bit
+ str_profile = self._get_profile ()
+
# fill the professional history template bit
str_profession = self._get_profession ()
# fill the main template
str_main = self._get_main (
+ str_profile,
str_education,
str_profession,
str_shorttermobjectives,
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):
+ def _get_main (self, profile, education, profession, shortterm, longterm, skills, languages):
# main template
tpl_main = string.Template (codecs.open (self.fil_main, "r", "utf-8").read ())
lastname = self.data["lastname"],
dateofbirth = self.data["dateofbirth"],
maritalstatus = str_marital,
+ profile = profile,
shortterm = shortterm,
longterm = longterm,
skills = skills,
return str_main
+ # get the profile highlights list
+ def _get_profile (self):
+ tpl_profile = string.Template (codecs.open (self.fil_profile, "r", "utf-8").read ())
+
+ lst_profile = []
+ # loop through each item
+ for item in self.data["profile"]:
+ str_profile = tpl_profile.safe_substitute (
+ profile_item = item
+ )
+ lst_profile.append (str_profile)
+
+ return u'\n'.join (lst_profile)
+
# get the language list
def _get_languages (self):
tpl_language = string.Template (codecs.open (self.fil_language, "r", "utf-8").read ())
)
lst_languages.append (str_lang)
- return "\n".join (lst_languages)
+ return u'\n'.join (lst_languages)
# get the skills
def _get_skills (self):
)
lst_skills.append (str_skill)
- return "\n".join (lst_skills)
+ return u'\n'.join (lst_skills)
# get short term career objectives
def _get_career (self):
)
lst_longtermgoals.append (str_career)
- return "\n".join (lst_shorttermcareer), "\n".join (lst_longtermgoals)
+ return u'\n'.join (lst_shorttermcareer), u'\n'.join (lst_longtermgoals)
# fill the professional history template
def _get_profession (self):
)
lst_profession.append (str_profession)
- return "\n".join (lst_profession)
+ return u'\n'.join (lst_profession)
# fill the education template
def _get_education (self):
)
lst_education.append (str_education)
- return "\n".join (lst_education)
+ return u'\n'.join (lst_education)
# set the template directory and the files within
def set_template_directory (self, templatedir):
self.fil_skills = os.path.join (templatedir, "skill_bit.tpl")
# languages learned bit
self.fil_language = os.path.join (templatedir, "language_bit.tpl")
+ # profile bit
+ self.fil_profile = os.path.join (templatedir, "profile_bit.tpl")
# load language strings
lang_str = codecs.open (os.path.join (templatedir, "misc_strings.txt"), "r", "utf-8").read ()