Save new version when updating
offlate/manager.py
74 | 74 | "info": data}) | |
75 | 75 | self.writeProjects() | |
76 | 76 | ||
77 | + | def update(self): | |
78 | + | for p in self.projects: | |
79 | + | proj = self.project_list[p['name']] | |
80 | + | p['info'] = proj.data | |
81 | + | ||
77 | 82 | def writeProjects(self): | |
78 | 83 | with open(self.basedir + '/projects.json', 'w') as f: | |
79 | 84 | f.write(json.dumps(self.projects)) |
offlate/systems/tp.py
23 | 23 | self.name = name | |
24 | 24 | self.lang = lang | |
25 | 25 | self.basedir = '' | |
26 | - | self.info = data | |
26 | + | self.data = data | |
27 | 27 | if "version" in data: | |
28 | 28 | self.version = data['version'] | |
29 | 29 | ||
… | |||
64 | 64 | tree = html.fromstring(page.content) | |
65 | 65 | pot = tree.xpath('//a[contains(@href,"POT-file")]/text()') | |
66 | 66 | self.version = re.sub(self.name+'-(.*).pot$', '\\1', str(pot[0])) | |
67 | + | self.data['version'] = self.version | |
67 | 68 | ||
68 | 69 | def updateFileName(self): | |
69 | 70 | self.filename = self.name + '-' + self.version + '.' + self.lang + '.po' |
offlate/window.py
456 | 456 | ||
457 | 457 | def update(self): | |
458 | 458 | self.tabs.currentWidget().update() | |
459 | + | self.manager.update() | |
460 | + | self.manager.writeProjects() | |
459 | 461 | ||
460 | 462 | def closeProject(self): | |
461 | 463 | self.tabs.removeTab(self.tabs.currentIndex()) |