Unicode support added for export
[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, country, 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["country"] = country
36 self.data["countrycode_landline"] = countrycode_landline
37 self.data["landline"] = landline
38 self.data["countrycode_mobile"] = countrycode_mobile
39 self.data["mobile"] = mobile
40 self.data["email"] = email
41 self.data["maritalstatus"] = maritalstatus
42
43 # set the educational qualifications
44 def set_educational_qualifications (self, listofqualifications):
45 self.data["educationalqualifications"] = listofqualifications
46
47 # set the professional history
48 def set_professional_history (self, listofprofessionalhistory):
49 self.data["professionalhistory"] = listofprofessionalhistory
50
51 # set the career objectives
52 def set_career_objectives (self, listofshortterm, listoflongterm):
53 self.data["shorttermobjectives"] = listofshortterm
54 self.data["longtermgoals"] = listoflongterm
55
56 # set the skill sets
57 def set_skillsets (self, listofskills):
58 self.data["skillsets"] = listofskills
59
60 # set the additional information
61 def set_additional_information (self, listoflanguages, additionalinformation):
62 self.data["languagesknown"] = listoflanguages
63 self.data["additionalinformation"] = additionalinformation