comparison upmana/updatemana.py @ 222:bb7b9648792c beta

Traipse Beta 'OpenRPG' {100502-00} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the productivity of the user. Update Summary (Patch-2) New Features: New Namespace method with two new syntaxes New Namespace Internal is context sensitive, always! New Namespace External is 'as narrow as you make it' New Namespace FutureCheck helps ensure you don't receive an incorrect node New PluginDB access for URL2Link plugin New to Forms, they now show their content in Design Mode New to Update Manager, checks Repo for updates on software start New to Mini Lin node, change title in design mode New to Game Tree, never lose a node, appends a number to the end of corrupted trees New to Server GUI, Traipse Suite's Debug Console New Namespace plugin, Allows Traipse users to use the Standard syntax !@ :: @! Updates: Update to White Board layer, uses a pencil image for color button Update to Grid Layer, uses a grid image for color button Update to Chat Window, size of drop down menus Update to default lobby message Update to template Text node Update to 4e PC Sheet node Fixes: Fix to Server GUI startup errors Fix to Server GUI Rooms tab updating Fix to Chat and Settings if non existant die roller is picked Fix to Dieroller and .open() used with .vs(). Successes are correctly calculated Fix to Alias Lib's Export to Tree, Open, Save features Fix to alias node, now works properly Fix to Splitter node, minor GUI cleanup Fix to Backgrounds not loading through remote loader Fix to Node name errors Fix to rolling dice in chat Whispers Fix to Splitters Sizing issues Fix to URL2Link plugin, modified regex compilation should remove memory leak Fix to mapy.py, a roll back due to zoomed grid issues Fix to whiteboard_handler, Circles work by you clicking the center of the circle Fix to Servers parse_incoming_dom which was outdated and did not respect XML Fix to a broken link in the server welcome message Fix to InterParse and logger requiring traceback Fix to Update Manager Status Bar Fix to failed image and erroneous pop up Fix to Mini Lib node that was preventing use Fix to plugins that parce dice but did not call InterParse Fix to nodes for name changing by double click Fix to Game Tree, node ordering on drag and drop corrected Fix to Game Tree, corrupted error message was not showing Fix to Update Manager, checks for internet connection Fix to Update Manager, Auto Update corrections
author sirebral
date Sun, 02 May 2010 16:30:28 -0500
parents 13054be69834
children 9230a33defd9
comparison
equal deleted inserted replaced
217:c719a07cd28d 222:bb7b9648792c
81 self.Bind(wx.EVT_CHECKBOX, self.ToggleAutoUpdate, self.buttons['auto_check']) 81 self.Bind(wx.EVT_CHECKBOX, self.ToggleAutoUpdate, self.buttons['auto_check'])
82 self.Bind(wx.EVT_CHECKBOX, self.ToggleNoUpdate, self.buttons['no_check']) 82 self.Bind(wx.EVT_CHECKBOX, self.ToggleNoUpdate, self.buttons['no_check'])
83 self.Bind(wx.EVT_TIMER, self.OnTimer, self.timer) 83 self.Bind(wx.EVT_TIMER, self.OnTimer, self.timer)
84 84
85 def OnTimer(self, event): 85 def OnTimer(self, event):
86 statbar.SetStatusText('Checking For Updates')
86 self.count = self.count + 1 87 self.count = self.count + 1
87 self.buttons['progress_bar'].SetValue(self.count) 88 self.buttons['progress_bar'].SetValue(self.count)
88 if self.count == 100: 89 if self.count == 100:
89 self.timer.Stop() 90 self.timer.Stop()
90 statbar.SetStatusText('Checking For Updates') 91 statbar.SetStatusText('No Updates Available')
91 92
92 def UpdateCheck(self): 93 def UpdateCheck(self):
93 self.timer.Start(100) 94 self.timer.Start(100)
94 self.count = 3 95 self.count = 3
95 self.buttons['progress_bar'].SetValue(3) 96 self.buttons['progress_bar'].SetValue(3)
96 doUpdate = commands.incoming(self.ui, self.repo, 97 try:
97 manifest.GetString('default', 'repo', ''), force=True, bundle=False) 98 doUpdate = commands.incoming(self.ui, self.repo,
98 if doUpdate: 99 manifest.GetString('default', 'repo', ''),
99 statbar.SetStatusText('No Updates Available') 100 force=True, bundle=False)
101 if doUpdate:
102 statbar.SetStatusText('No Updates Available')
103 self.buttons['progress_bar'].SetValue(100)
104 self.timer.Stop()
105 else:
106 statbar.SetStatusText('Refresh Repo For Updated Source')
107 self.buttons['progress_bar'].SetValue(100)
108 self.timer.Stop()
109 except:
110 statbar.SetStatusText('No Connection Found')
100 self.buttons['progress_bar'].SetValue(100) 111 self.buttons['progress_bar'].SetValue(100)
101 self.timer.Stop() 112 self.timer.Stop()
102 else: 113
103 statbar.SetStatusText('Refresh Repo For Updated Source')
104 self.buttons['progress_bar'].SetValue(100)
105 self.timer.Stop()
106 114
107 def ToggleAutoUpdate(self, event): 115 def ToggleAutoUpdate(self, event):
108 if self.buttons['auto_check'].GetValue() == True: 116 if self.buttons['auto_check'].GetValue() == True:
109 if self.buttons['no_check'].GetValue() == True: 117 if self.buttons['no_check'].GetValue() == True:
110 self.buttons['no_check'].SetValue(False) 118 self.buttons['no_check'].SetValue(False)
147 dir1 += ignore.split('/')[gets] + os.sep 155 dir1 += ignore.split('/')[gets] + os.sep
148 gets += 1 156 gets += 1
149 os.removedirs(temp+dir1) 157 os.removedirs(temp+dir1)
150 158
151 def LoadDoc(self): 159 def LoadDoc(self):
152 ignore = open(self.filename) 160 manifest = open(self.filename)
153 self.ignorelist = [] 161 self.ignorelist = []
154 for i in ignore: self.ignorelist.append(str(i [:len(i)-1])) 162 ignore = manifest.readlines()
155 manifest = ignore.readlines() 163 for i in ignore: print i; self.ignorelist.append(str(i[:len(i)-1]))
156 ignore.close() 164 manifest.close()
157 165
158 def Finish(self, evt=None): 166 def Finish(self, evt=None):
159 component.get('upmana-win').OnClose(None) 167 component.get('upmana-win').OnClose(None)
160 168
161 def ChooseBranch(self, evt=None): 169 def ChooseBranch(self, evt=None):
609 os.remove(temp + ignore.split('/')[len(ignore.split('/')) - 1]) 617 os.remove(temp + ignore.split('/')[len(ignore.split('/')) - 1])
610 else: 618 else:
611 dlg.Destroy(); pass 619 dlg.Destroy(); pass
612 620
613 def LoadDoc(self): 621 def LoadDoc(self):
614 ignore = open(self.filename) 622 manifest = open(self.filename)
615 self.ignorelist = [] 623 self.ignorelist = []
616 for i in ignore: self.ignorelist.append(str(i [:len(i)-1])) 624 ignore = manifest.readlines()
617 manifest = ignore.readlines() 625 for i in ignore: print i; self.ignorelist.append(str(i[:len(i)-1]))
618 ignore.close() 626 manifest.close()
619 627
620 def get_packages(self, type=None): 628 def get_packages(self, type=None):
621 #Can be cleaner 629 #Can be cleaner
622 self.package_list = [] 630 self.package_list = []
623 b = self.repo.branchtags() 631 b = self.repo.branchtags()
745 if self.main == False: self.Destroy() 753 if self.main == False: self.Destroy()
746 if self.main == True: self.Hide() 754 if self.main == True: self.Hide()
747 755
748 class updateApp(wx.App): 756 class updateApp(wx.App):
749 def OnInit(self): 757 def OnInit(self):
750 self.main = False 758 self.main = False; self.autoUpdate = False; self.noUpdate = False
751
752 logger._set_log_to_console(False) 759 logger._set_log_to_console(False)
753 logger.note("Updater Start") 760 logger.note("Updater Start")
754 component.add('validate', validate) 761 component.add('validate', validate)
755 self.updater = updaterFrame(self, "OpenRPG Update Manager 1.2", 762 self.updater = updaterFrame(self, "OpenRPG Update Manager 1.2",
756 component, manifest, self.main) 763 component, manifest, self.main)
757 if manifest.GetString("updatemana", "auto_update", "") == 'on' and self.main == False: 764 if manifest.GetString("updatemana", "auto_update", "") == 'on' and self.main == False:
758 self.AutoUpdate(); self.OnExit() 765 self.AutoUpdate(); self.OnExit(); self.autoUpdate = True
759 else: pass 766 else: pass
760 if manifest.GetString('updatemana', 'no_update', '') == 'on' and self.main == False: 767 if manifest.GetString('updatemana', 'no_update', '') == 'on' and self.main == False:
761 self.OnExit() 768 self.OnExit(); self.noUpdate = True
762 else: pass 769 else: pass
763 try: 770 if not (self.autoUpdate or self.noUpdate):
764 self.updater.Show() 771 try:
765 self.updater.Fit() 772 self.updater.Show()
766 except: pass 773 self.updater.Fit()
767 if not self.main: self.updater.page1.UpdateCheck() 774 if not self.main: self.updater.page1.UpdateCheck()
775 except: pass
768 return True 776 return True
769 777
770 def AutoUpdate(self): 778 def AutoUpdate(self):
771 self.ui = ui.ui() 779 self.ui = ui.ui()
772 self.repo = hg.repository(self.ui, ".") 780 self.repo = hg.repository(self.ui, ".")
773 self.c = self.repo.changectx('tip') 781 self.c = self.repo.changectx('tip')
774 self.current = self.repo.dirstate.branch() 782 self.current = self.repo.dirstate.branch()
775 783
776 capture = manifest.GetString('updaterepo', 'default', '') 784 capture = manifest.GetString('default', 'repo', '')
777 if capture != '': 785 if capture != '':
778 commands.pull(self.ui, self.repo, capture, rev='', update=False, force=True) 786 try: commands.pull(self.ui, self.repo, capture, rev='', update=False, force=True)
787 except:
788 wx.MessageBox('No Connection Found. Skipping Auto Update!', 'Info')
789 return
779 filename = 'ignorelist.txt' 790 filename = 'ignorelist.txt'
780 self.filename = dir_struct["home"] + 'upmana' + os.sep + filename 791 self.filename = dir_struct["home"] + 'upmana' + os.sep + filename
781 component.get('validate').config_file(filename, "default_ignorelist.txt") 792 component.get('validate').config_file(filename, "default_ignorelist.txt")
782 self.mana = self.LoadDoc() 793 self.mana = self.LoadDoc(); ignored = []
783 temp = dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep 794 temp = dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep
784 for ignore in self.ignorelist: 795 for ignore in self.ignorelist:
785 if len(ignore.split('/')) > 1: 796 if len(ignore.split('/')) > 1:
786 gets = 0; dir1 = '' 797 gets = 0; dir1 = ''
787 while gets != len(ignore.split('/'))-1: 798 while gets != len(ignore.split('/'))-1:
788 dir1 += ignore.split('/')[gets] + os.sep 799 dir1 += ignore.split('/')[gets] + os.sep
789 gets += 1 800 gets += 1
790 os.makedirs(temp+dir1) 801 os.makedirs(temp+dir1)
791 shutil.copy(ignore, temp + dir1 + ignore.split('/')[len(ignore.split('/')) - 1]) 802 ignoredfile = temp + dir1 + ignore.split('/')[len(ignore.split('/')) - 1]
803 ignored.append(ignoredfile)
804 shutil.copy(ignore, ignoredfile)
792 hg.clean(self.repo, self.current) 805 hg.clean(self.repo, self.current)
793 for ignore in self.ignorelist: 806 for ignore in self.ignorelist:
794 shutil.copyfile(temp + ignore.split('/')[len(ignore.split('/')) - 1], ignore) 807 shutil.copyfile(ignored.index(ignore), ignore)
795 os.remove(temp + ignore.split('/')[len(ignore.split('/')) - 1]) 808 os.remove(ignored.index(ignore))
796 if len(ignore.split('/')) > 1: 809 if len(ignore.split('/')) > 1:
797 gets = 0; dir1 = '' 810 gets = 0; dir1 = ''
798 while gets != len(ignore.split('/'))-1: 811 while gets != len(ignore.split('/'))-1:
799 dir1 += ignore.split('/')[gets] + os.sep 812 dir1 += ignore.split('/')[gets] + os.sep
800 gets += 1 813 gets += 1
801 os.removedirs(temp+dir1) 814 os.removedirs(temp+dir1)
802 else: wx.MessageBox('No default Rpository set. Skipping Auto Update!', 'Info') 815 else: wx.MessageBox('Default Repo Not Found. Skipping Auto Update!', 'Info')
803 816
804 def LoadDoc(self): 817 def LoadDoc(self):
805 ignore = open(self.filename) 818 manifest = open(self.filename)
806 self.ignorelist = [] 819 self.ignorelist = []
807 for i in ignore: self.ignorelist.append(str(i [:len(i)-1])) 820 ignore = manifest.readlines()
808 manifest = ignore.readlines() 821 for i in ignore: print i; self.ignorelist.append(str(i[:len(i)-1]))
809 ignore.close() 822 manifest.close()
810 823
811 def OnExit(self): 824 def OnExit(self):
812 imported = ['manifest', 'orpg.dirpath', 'orpg.orpgCore', 'orpg.orpg_version', 825 imported = ['manifest', 'orpg.dirpath', 'orpg.orpgCore', 'orpg.orpg_version',
813 'orpg.tools.orpg_log', 'orpg.tools.orpg_log', 'orpg.orpg_xml', 'orpg.dirpath', 826 'orpg.tools.orpg_log', 'orpg.tools.orpg_log', 'orpg.orpg_xml', 'orpg.dirpath',
814 'orpg.dirpath', 'upmana.validate', 'mercurial.ui', 'mercurial.hg', 827 'orpg.dirpath', 'upmana.validate', 'mercurial.ui', 'mercurial.hg',