comparison trunk/src/translator/project.py @ 481:04adc4e3fdda

Translator: some fixes and additions. Projects can be saved now. Documents can be switched using Ctrl+Tab and Ctrl+Shift+Tab. Some items in ProjectTree can be edited now. Added my last will to the file AUTHORS.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Wed, 14 Nov 2007 22:07:50 +0100
parents 3b5421d40f9b
children 1401e38d1e2e
comparison
equal deleted inserted replaced
480:f25985f6b222 481:04adc4e3fdda
36 36
37 def verify(self): 37 def verify(self):
38 doc = self.doc 38 doc = self.doc
39 self.checkType(doc, dict) 39 self.checkType(doc, dict)
40 try: 40 try:
41 self.name = str(doc["Name"]) 41 self.name = unicode(doc["Name"])
42 self.srcLangFilePath = str(doc["SourceLangFile"]) 42 self.srcLangFilePath = str(doc["SourceLangFile"])
43 self.langFilePaths = list(doc["LangFiles"]) 43 self.langFilePaths = list(doc["LangFiles"])
44 self.msgIDs = list(doc["MsgIDs"]) 44 self.msgIDs = list(doc["MsgIDs"])
45 self.creationDate = str(doc["CreationDate"]) 45 self.creationDate = str(doc["CreationDate"])
46 self.buildScript = str(doc["BuildScript"]) 46 self.buildScript = str(doc["BuildScript"])
89 if not os.path.exists(filePath2): 89 if not os.path.exists(filePath2):
90 raise LoadingError("Project: Language file '%s' doesn't exist"%filePath) 90 raise LoadingError("Project: Language file '%s' doesn't exist"%filePath)
91 filePath = filePath2 91 filePath = filePath2
92 return langfile.LangFile(filePath) 92 return langfile.LangFile(filePath)
93 93
94 def setName(self, name):
95 self.name = name
96
94 def save(self): 97 def save(self):
95 pass 98 self.doc["Name"] = self.name
99 file_ = open(self.projectPath, "w")
100 yaml.dump(self.doc, stream=file_, allow_unicode=True)
101 file_.close()