comparison upmana/updatemana.py @ 54:5d89a6eaf492 traipse_dev

WinXP seems to have lost some boxes unless the screen is resized. Weird. Stable (enough) Version. Preparing to stable.
author sirebral
date Thu, 06 Aug 2009 17:22:17 -0500
parents c9694d854a61
children 0b79d5dbbe9e
comparison
equal deleted inserted replaced
53:ebe281aeb63a 54:5d89a6eaf492
193 193
194 def BranchInfo(self, branch): 194 def BranchInfo(self, branch):
195 self.filelist.SetValue('') 195 self.filelist.SetValue('')
196 self.filelist.AppendText("Files that will change\n\n") 196 self.filelist.AppendText("Files that will change\n\n")
197 self.changelog.SetValue('') 197 self.changelog.SetValue('')
198 changelog = "Traipse 'OpenRPG' Update Manager.\n\nThis is Dev Build 0.6.7 of the Update Manager. This version is nearly 100% functional. Users can now add repositories of OpenRPG, choose from different branches available from those repositories, and add files to an ignore list.\n\nThe Update Manager is divided into tabs, Updater, Repos, Manifest, and Control. The Updater says it all, choose a branch and update to that branch. Repos is a new feature that I hope users take advantage of. Clone the repo, build your own, and then share it with your friends! The Manifest is the ignore list. Want to make sure a test run doesn't delete important files ... then add them to the Manifest'. Control is not functional yet, but when it is users will be able to update to specific revision dates and delete branches.\n\nThis is a good start. Enjoy the freedom!!" 198 changelog = "Traipse 'OpenRPG' Update Manager.\n\nThis is Dev Build 0.6.9(stable) of the Update Manager. This version is nearly 100% functional. Users can now add repositories of OpenRPG, choose from different branches available from those repositories, and add files to an ignore list.\n\nThe Update Manager is divided into tabs, Updater, Repos, Manifest, and Control. \n\nThe Updater says it all, choose a branch and update to that branch. Repos is a new feature that I hope users take advantage of. Clone the repo, build your own, and then share it with your friends! The Manifest is the ignore list. Want to make sure a test run doesn't delete important files ... then add them to the Manifest'. Control is not functional yet, but when it is users will be able to update to specific revision dates and delete branches.\n\nThis is a good start. Enjoy the freedom!!"
199 self.changelog.AppendText(changelog + '\n') 199 self.changelog.AppendText(changelog + '\n')
200 self.filelist.AppendText("Update to " + branch + "\n\nWhen Update Manager is fully functional this area will show the files that will be affected by the yoru branch selection.") 200 self.filelist.AppendText("Update to " + branch + "\n\nWhen Update Manager is fully functional this area will show the files that will be affected by the yoru branch selection.")
201 201
202 #### Files works but not fully without the change log information, pulled for Dev 0.1 202 #### Files works but not fully without the change log information, pulled for Dev 0.1
203 #for f in files: 203 #for f in files:
340 self.sizers["repolist_layout"].Insert(0, self.container[self.id], -1, wx.EXPAND) 340 self.sizers["repolist_layout"].Insert(0, self.container[self.id], -1, wx.EXPAND)
341 self.sizers['repolist_layout'].Layout() 341 self.sizers['repolist_layout'].Layout()
342 342
343 #Set Default Repo Button 343 #Set Default Repo Button
344 capture = self.manifest.GetString('updaterepo', 'default', '') 344 capture = self.manifest.GetString('updaterepo', 'default', '')
345 for caught in self.uri: 345 if capture != '':
346 if capture == self.uri[caught]: self.id = caught; pass 346 for caught in self.uri:
347 else: continue 347 if capture == self.uri[caught]: self.id = caught; pass
348 if capture != '': self.defaultcheck[self.id].SetValue(True) 348 else: continue
349 self.defaultcheck[self.id].SetValue(True)
349 350
350 def AddRepo(self, event): 351 def AddRepo(self, event):
351 repo = self.texts['reponame'].GetValue(); repo = repo.replace(' ', '_'); repo = 'repo-' + repo 352 repo = self.texts['reponame'].GetValue(); repo = repo.replace(' ', '_'); repo = 'repo-' + repo
352 self.manifest.SetString('updaterepo', repo, ''); self.repo = repo.split(',') 353 self.manifest.SetString('updaterepo', repo, ''); self.repo = repo.split(',')
353 repolist = self.manifest.GetList('UpdateManifest', 'repolist', '') 354 repolist = self.manifest.GetList('UpdateManifest', 'repolist', '')
493 def AutoUpdate(self): 494 def AutoUpdate(self):
494 self.ui = ui.ui() 495 self.ui = ui.ui()
495 self.repo = hg.repository(self.ui, ".") 496 self.repo = hg.repository(self.ui, ".")
496 self.c = self.repo.changectx('tip') 497 self.c = self.repo.changectx('tip')
497 self.current = self.repo.dirstate.branch() 498 self.current = self.repo.dirstate.branch()
498 filename = 'ignorelist.txt' 499
499 self.filename = orpg.dirpath.dir_struct["home"] + 'upmana' + os.sep + filename
500 orpg.tools.validate.Validate(orpg.dirpath.dir_struct["home"] + 'upmana' + os.sep).config_file(filename, "default_ignorelist.txt")
501 self.mana = self.LoadDoc()
502 for ignore in self.ignorelist: #Checked or not, if it is here, it is ignored.
503 try: shutil.copy(ignore, orpg.dirpath.dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep)
504 except: pass
505 capture = self.manifest.GetString('updaterepo', 'default', '') 500 capture = self.manifest.GetString('updaterepo', 'default', '')
506 commands.pull(self.ui, self.repo, capture, rev='', update=False, force=True) 501 if capture != '':
507 hg.clean(self.repo, self.current) 502 commands.pull(self.ui, self.repo, capture, rev='', update=False, force=True)
508 for ignore in self.ignorelist: 503 filename = 'ignorelist.txt'
509 try: shutil.copyfile(orpg.dirpath.dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep + ignore.split('/')[len(ignore.split('/')) - 1], ignore) 504 self.filename = orpg.dirpath.dir_struct["home"] + 'upmana' + os.sep + filename
510 except: pass 505 orpg.tools.validate.Validate(orpg.dirpath.dir_struct["home"] + 'upmana' + os.sep).config_file(filename, "default_ignorelist.txt")
511 try: os.remove(orpg.dirpath.dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep + ignore.split('/')[len(ignore.split('/')) - 1]) 506 self.mana = self.LoadDoc()
512 except: pass 507 for ignore in self.ignorelist: #Checked or not, if it is here, it is ignored.
508 try: shutil.copy(ignore, orpg.dirpath.dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep)
509 except: pass
510 hg.clean(self.repo, self.current)
511 for ignore in self.ignorelist:
512 try: shutil.copyfile(orpg.dirpath.dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep + ignore.split('/')[len(ignore.split('/')) - 1], ignore)
513 except: pass
514 try: os.remove(orpg.dirpath.dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep + ignore.split('/')[len(ignore.split('/')) - 1])
515 except: pass
516 else: print 'No default repository set, skipping Auto Update!'
513 517
514 def LoadDoc(self): 518 def LoadDoc(self):
515 ignore = open(self.filename) 519 ignore = open(self.filename)
516 self.ignorelist = [] 520 self.ignorelist = []
517 for i in ignore: self.ignorelist.append(str(i [:len(i)-1])) 521 for i in ignore: self.ignorelist.append(str(i [:len(i)-1]))