Completed default XHTML template for exporter
[biacv.git] / biacv_data.py
1 # class to save/restore data from a BiaCV file and to export BiaCV to different
2 # formats
3
4 import json
5
6 class BiaCVData:
7 def __init__ (self):
8 # initialize the data to an empty dictionary
9 self.data = {}
10
11 # save the data into a file
12 def save_data (self, filepath):
13 json.dump (self.data, file (filepath, "w"), indent=4)
14
15 # load the data from a file
16 def load_data (self, filepath):
17 self.data = json.load (file (filepath, "rb"))
18
19 # set the document title
20 def set_document_title (self, title):
21 self.data["title"] = title
22
23 # set personal information from gui
24 def set_personal_info (self, nametitle, firstname, lastname, dateofbirth,
25 street, area, city, areacode, countrycode_landline, landline,
26 countrycode_mobile, mobile, email, maritalstatus):
27 self.data["nametitle"] = nametitle
28 self.data["firstname"] = firstname
29 self.data["lastname"] = lastname
30 self.data["dateofbirth"] = dateofbirth
31 self.data["street"] = street
32 self.data["area"] = area
33 self.data["city"] = city
34 self.data["areacode"] = areacode
35 self.data["countrycode_landline"] = countrycode_landline
36 self.data["landline"] = landline
37 self.data["countrycode_mobile"] = countrycode_mobile
38 self.data["mobile"] = mobile
39 self.data["email"] = email
40 self.data["maritalstatus"] = maritalstatus
41
42 # set the educational qualifications
43 def set_educational_qualifications (self, listofqualifications):
44 self.data["educationalqualifications"] = listofqualifications
45
46 # set the professional history
47 def set_professional_history (self, listofprofessionalhistory):
48 self.data["professionalhistory"] = listofprofessionalhistory
49
50 # set the career objectives
51 def set_career_objectives (self, listofshortterm, listoflongterm):
52 self.data["shorttermobjectives"] = listofshortterm
53 self.data["longtermgoals"] = listoflongterm
54
55 # set the skill sets
56 def set_skillsets (self, listofskills):
57 self.data["skillsets"] = listofskills
58
59 # set the additional information
60 def set_additional_information (self, listoflanguages, additionalinformation):
61 self.data["languagesknown"] = listoflanguages
62 self.data["additionalinformation"] = additionalinformation