annotate upmana/updatemana.py @ 72:8bc955faf819 ornery-dev

Fixing a few mistakes from the last update. When Controls is finished I will be happy because users won't miss an file change due to these small updates.
author sirebral
date Thu, 20 Aug 2009 03:45:45 -0500
parents 52a5fa913008
children fdcca00696ea
rev   line source
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
1 import wx
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
2 import manifest
70
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
3 from orpg.orpgCore import *
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
4 #import tempfile
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
5 import shutil
72
8bc955faf819 Fixing a few mistakes from the last update. When Controls is finished I will be happy because users won't miss an file change due to these small updates.
sirebral
parents: 70
diff changeset
6
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 62
diff changeset
7 from orpg.dirpath import dir_struct
70
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
8 from orpg.tools.orpg_log import logger
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
9 from orpg.tools.decorators import debugging
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
10 from upmana.validate import validate
61
f3d8101211c4 Traipse Dev 'OpenRPG' {090813-00}
sirebral
parents: 60
diff changeset
11 from mercurial import ui, hg, commands, repo, revlog, cmdutil, util
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
12
46
599f727e3833 Getting ready to test!! Main functions seem to be working.
sirebral
parents: 45
diff changeset
13
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
14 class Updater(wx.Panel):
70
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
15 @debugging
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 62
diff changeset
16 def __init__(self, parent, component, manifest):
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
17 wx.Panel.__init__(self, parent)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
18
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
19 ### Update Manager
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
20 self.ui = ui.ui()
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
21 self.repo = hg.repository(self.ui, ".")
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
22 self.c = self.repo.changectx('tip')
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
23 self.manifest = manifest
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
24 self.parent = parent
70
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
25 #logger.debug("Enter updaterFrame") #Need to set logging level
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
26 self.SetBackgroundColour(wx.WHITE)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
27 self.sizer = wx.GridBagSizer(hgap=1, vgap=1)
61
f3d8101211c4 Traipse Dev 'OpenRPG' {090813-00}
sirebral
parents: 60
diff changeset
28 self.changelog = wx.TextCtrl(self, wx.ID_ANY, size=(325, -1), style=wx.TE_MULTILINE | wx.TE_READONLY)
f3d8101211c4 Traipse Dev 'OpenRPG' {090813-00}
sirebral
parents: 60
diff changeset
29 self.filelist = wx.TextCtrl(self, wx.ID_ANY, size=(275, 300), style=wx.TE_MULTILINE | wx.TE_READONLY)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
30 self.buttons = {}
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
31 self.buttons['progress_bar'] = wx.Gauge(self, wx.ID_ANY, 100)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
32 self.buttons['auto_text'] = wx.StaticText(self, wx.ID_ANY, "Auto Update")
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
33 self.buttons['auto_check'] = wx.CheckBox(self, wx.ID_ANY)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
34 self.buttons['no_text'] = wx.StaticText(self, wx.ID_ANY, "No Update")
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
35 self.buttons['no_check'] = wx.CheckBox(self, wx.ID_ANY)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
36 self.buttons['advanced'] = wx.Button(self, wx.ID_ANY, "Package Select")
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
37 self.buttons['update'] = wx.Button(self, wx.ID_ANY, "Update Now")
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
38 self.buttons['finish'] = wx.Button(self, wx.ID_ANY, "Finish")
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
39
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
40 self.sizer.Add(self.changelog, (0,0), span=(4,1), flag=wx.EXPAND)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
41 self.sizer.Add(self.filelist, (0,1), span=(1,3), flag=wx.EXPAND)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
42
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
43 self.sizer.Add(self.buttons['progress_bar'], (1,1), span=(1,3), flag=wx.EXPAND)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
44 self.sizer.Add(self.buttons['auto_text'], (2,1))
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
45 self.sizer.Add(self.buttons['auto_check'], (2,2), flag=wx.EXPAND)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
46 self.sizer.Add(self.buttons['no_text'], (3,1))
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
47 self.sizer.Add(self.buttons['no_check'], (3,2), flag=wx.EXPAND)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
48 self.sizer.Add(self.buttons['advanced'], (2,3), flag=wx.EXPAND)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
49 self.sizer.Add(self.buttons['update'], (3,3), flag=wx.EXPAND)
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
50 self.sizer.Add(self.buttons['finish'], (4,3), flag=wx.EXPAND)
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
51 self.buttons['finish'].Disable()
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
52 self.sizer.AddGrowableCol(0)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
53 self.sizer.AddGrowableRow(0)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
54 self.SetSizer(self.sizer)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
55 self.SetAutoLayout(True)
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
56 self.get_package
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
57
48
0aeee1992423 This updates fixes three things. Branch names are now current to your udpate
sirebral
parents: 47
diff changeset
58 self.current = self.repo.dirstate.branch()
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
59 self.BranchInfo(self.current)
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
60
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
61 if self.manifest.GetString("updatemana", "no_update", "") == 'on': self.buttons['no_check'].SetValue(True)
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
62 else: self.buttons['no_check'].SetValue(False)
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
63 if self.manifest.GetString("updatemana", "auto_update", "") == 'on': self.buttons['auto_check'].SetValue(True)
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
64 else: self.buttons['auto_check'].SetValue(False)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
65
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
66 ## Event Handlers
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
67 self.Bind(wx.EVT_BUTTON, self.Update, self.buttons['update'])
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
68 self.Bind(wx.EVT_BUTTON, self.Finish, self.buttons['finish'])
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
69 self.Bind(wx.EVT_BUTTON, self.ChooseBranch, self.buttons['advanced'])
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
70 self.Bind(wx.EVT_CHECKBOX, self.ToggleAutoUpdate, self.buttons['auto_check'])
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
71 self.Bind(wx.EVT_CHECKBOX, self.ToggleNoUpdate, self.buttons['no_check'])
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
72
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
73 def ToggleAutoUpdate(self, event):
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
74 if self.buttons['auto_check'].GetValue() == True:
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
75 if self.buttons['no_check'].GetValue() == True:
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
76 self.buttons['no_check'].SetValue(False)
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
77 self.manifest.SetString("updatemana", "no_update", "off")
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
78 self.manifest.SetString("updatemana", "auto_update", "on")
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
79 else: self.manifest.SetString("updatemana", "auto_update", "off")
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
80
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
81 def ToggleNoUpdate(self, event):
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
82 if self.buttons['no_check'].GetValue() == True:
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
83 if self.buttons['auto_check'].GetValue() == True:
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
84 self.buttons['auto_check'].SetValue(False)
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
85 self.manifest.SetString("updatemana", "auto_update", "off")
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
86 self.manifest.SetString("updatemana", "no_update", "on")
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
87 else: self.manifest.SetString("updatemana", "no_update", "off")
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
88
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
89 def Update(self, evt=None):
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
90 self.ui = ui.ui()
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
91 self.repo = hg.repository(self.ui, ".")
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
92 self.c = self.repo.changectx('tip')
48
0aeee1992423 This updates fixes three things. Branch names are now current to your udpate
sirebral
parents: 47
diff changeset
93 filename = 'ignorelist.txt'
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 62
diff changeset
94 self.filename = dir_struct["home"] + 'upmana' + os.sep + filename
70
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
95 component.get('validate').config_file(filename, "default_ignorelist.txt")
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
96 self.mana = self.LoadDoc()
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
97 for ignore in self.ignorelist:
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 62
diff changeset
98 shutil.copy(ignore, dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep +ignore.split('/')[len(ignore.split('/')) - 1])
48
0aeee1992423 This updates fixes three things. Branch names are now current to your udpate
sirebral
parents: 47
diff changeset
99 hg.clean(self.repo, self.current)
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
100 for ignore in self.ignorelist:
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 62
diff changeset
101 shutil.copyfile(dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep + ignore.split('/')[len(ignore.split('/')) - 1], ignore)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 62
diff changeset
102 os.remove(dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep + ignore.split('/')[len(ignore.split('/')) - 1])
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
103
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
104 def LoadDoc(self):
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
105 ignore = open(self.filename)
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
106 self.ignorelist = []
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
107 for i in ignore: self.ignorelist.append(str(i [:len(i)-1]))
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
108 manifest = ignore.readlines()
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
109 ignore.close()
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
110
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
111 def Finish(self, evt=None):
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
112 try: self.parent.Destroy()
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
113 except:
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
114 print 'Fail'; exit()
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
115
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
116 def ChooseBranch(self, evt=None):
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
117 dlg = wx.Dialog(self, wx.ID_ANY, "Package Selector", style=wx.DEFAULT_DIALOG_STYLE)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 62
diff changeset
118 if wx.Platform == '__WXMSW__': icon = wx.Icon(dir_struct["icon"]+'d20.ico', wx.BITMAP_TYPE_ICO)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 62
diff changeset
119 else: icon = wx.Icon(dir_struct["icon"]+"d20.xpm", wx.BITMAP_TYPE_XPM )
48
0aeee1992423 This updates fixes three things. Branch names are now current to your udpate
sirebral
parents: 47
diff changeset
120 dlg.SetIcon(icon)
0aeee1992423 This updates fixes three things. Branch names are now current to your udpate
sirebral
parents: 47
diff changeset
121
0aeee1992423 This updates fixes three things. Branch names are now current to your udpate
sirebral
parents: 47
diff changeset
122 self.ui = ui.ui()
0aeee1992423 This updates fixes three things. Branch names are now current to your udpate
sirebral
parents: 47
diff changeset
123 self.repo = hg.repository(self.ui, ".")
0aeee1992423 This updates fixes three things. Branch names are now current to your udpate
sirebral
parents: 47
diff changeset
124 self.c = self.repo.changectx('tip')
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
125
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
126 dlgsizer = wx.GridBagSizer(hgap=1, vgap=1)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
127 Yes = wx.Button( dlg, wx.ID_OK, "Ok" )
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
128 Yes.SetDefault()
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
129 rgroup = wx.RadioButton(dlg, wx.ID_ANY, "group_start", style=wx.RB_GROUP)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
130 rgroup.Hide()
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
131
37
cd8f740a8ffc Whoops! Broke the Package Selecter. Now fixed!! Does anyone evene read these?
sirebral
parents: 36
diff changeset
132 self.get_packages()
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
133 if self.package_list == None: return
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
134 types = self.package_list
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
135 row=0; col=0
48
0aeee1992423 This updates fixes three things. Branch names are now current to your udpate
sirebral
parents: 47
diff changeset
136 self.current = self.repo.dirstate.branch()
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
137 self.package_type = self.current
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
138 self.btnlist = {}; self.btn = {}
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
139 self.id = 1
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
140
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
141 for t in types:
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
142 self.btnName = str(t)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
143 self.btn[self.id] = wx.RadioButton(dlg, wx.ID_ANY, str(t), name=self.btnName)
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
144 if self.btnName == self.current: self.btn[self.id].SetValue(True)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
145 self.btnlist[self.id] = self.btnName
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
146 dlgsizer.Add(self.btn[self.id], (row, col))
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
147 col += 1; self.id += 1
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
148 if col == 3: row += 1; col = 0
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
149
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
150 dlgsizer.Add(Yes, (row+1,col/2))
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
151 dlgsizer.AddGrowableCol(0)
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
152 dlgsizer.AddGrowableRow(0)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
153 dlg.SetAutoLayout( True )
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
154 dlg.SetSizer( dlgsizer )
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
155 dlgsizer.Fit( dlg )
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
156 dlg.Centre()
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
157 dlg.Bind(wx.EVT_RADIOBUTTON, self.PackageSet)
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
158 if dlg.ShowModal(): dlg.Destroy()
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
159
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
160 def PackageSet(self, event):
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
161 for btn in self.btn:
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
162 if self.btn[btn].GetValue() == True: self.current = self.btnlist[btn]
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
163
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
164 branches = self.repo.branchtags()
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
165 heads = dict.fromkeys(self.repo.heads(), 1)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
166 l = [((n in heads), self.repo.changelog.rev(n), n, t) for t, n in branches.items()]
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
167
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
168 if self.current != type:
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
169 heads = dict.fromkeys(self.repo.heads(), self.repo.branchtags())
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
170 branches = dict.copy(self.repo.branchtags())
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
171 self.BranchInfo(self.current)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
172
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
173 def BranchInfo(self, branch):
61
f3d8101211c4 Traipse Dev 'OpenRPG' {090813-00}
sirebral
parents: 60
diff changeset
174 cs = self.repo.changectx( self.current ).changeset()
62
e8029caed892 Traipse Dev 'OpenRPG' {090813-01}
sirebral
parents: 61
diff changeset
175 rev = self.repo.changelog.rev(self.repo.branchtags()[self.current]) #Current revision number. Use in Controls
70
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
176 #print self.repo.changelog.reachable(self.repo.branchtags()[self.current])
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
177 #for heads in self.repo.changelog.reachable(self.repo.branchtags()[self.current]):
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
178 # print self.repo.changelog.rev(heads)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
179 self.changelog.SetValue('')
61
f3d8101211c4 Traipse Dev 'OpenRPG' {090813-00}
sirebral
parents: 60
diff changeset
180 changelog = cs[4]
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
181 self.changelog.AppendText(changelog + '\n')
61
f3d8101211c4 Traipse Dev 'OpenRPG' {090813-00}
sirebral
parents: 60
diff changeset
182 self.filelist.SetValue('')
70
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
183 self.filelist.AppendText("Currently selected branch: " + branch + "\n\nAuthor: "+cs[1]+"\n\n")
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
184 self.filelist.AppendText("Files Modified (in update): \n")
62
e8029caed892 Traipse Dev 'OpenRPG' {090813-01}
sirebral
parents: 61
diff changeset
185 for f in cs[3]: self.filelist.AppendText(f+"\n")
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
186
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
187 def get_packages(self, type=None):
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
188 #Fixed and ready for Test. Can be cleaner
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
189 self.package_list = []
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
190 b = self.repo.branchtags()
62
e8029caed892 Traipse Dev 'OpenRPG' {090813-01}
sirebral
parents: 61
diff changeset
191 heads = dict.fromkeys(self.repo.heads(), 1) #The code below looks superfluous but there is good info inside
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
192 l = [((n in heads), self.repo.changelog.rev(n), n, t) for t, n in b.items()]
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
193 l.sort()
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
194 l.reverse()
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
195 for ishead, r, n, t in l: self.package_list.append(t)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
196
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
197 def get_package(self):
37
cd8f740a8ffc Whoops! Broke the Package Selecter. Now fixed!! Does anyone evene read these?
sirebral
parents: 36
diff changeset
198 self.get_packages()
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
199 if self.package_list == None: return None
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
200 return None
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
201
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
202 class Repos(wx.Panel):
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
203 def __init__(self, parent, openrpg, manifest):
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
204 wx.Panel.__init__(self, parent)
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
205
42
81254b3935fb Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents: 41
diff changeset
206 ### Update Manager
81254b3935fb Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents: 41
diff changeset
207 self.ui = ui.ui()
81254b3935fb Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents: 41
diff changeset
208 self.r = hg.repository(self.ui, ".")
81254b3935fb Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents: 41
diff changeset
209 self.c = self.r.changectx('tip')
81254b3935fb Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents: 41
diff changeset
210
48
0aeee1992423 This updates fixes three things. Branch names are now current to your udpate
sirebral
parents: 47
diff changeset
211 #mainpanel = self
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
212 self.openrpg = openrpg
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
213 self.manifest = manifest
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
214 self.buttons = {}
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
215 self.texts = {}
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
216
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
217 ## Section Sizers (with frame edges and text captions)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
218 self.box_sizers = {}
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
219 self.box_sizers["newbutton"] = wx.StaticBox(self, -1)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
220
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
221 ## Layout Sizers
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
222 self.sizers = {}
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
223 self.sizers["main"] = wx.GridBagSizer(hgap=2, vgap=2)
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
224 self.sizers["button"] = wx.GridBagSizer(hgap=2, vgap=2)
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
225
36
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
226 #Button Layout
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
227 self.sizers["newbutton"] = wx.StaticBoxSizer(self.box_sizers["newbutton"], wx.VERTICAL)
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
228 self.sizers["newrepo_layout"] = wx.FlexGridSizer(rows=1, cols=2, hgap=2, vgap=5)
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
229 empty = wx.StaticText(self, -1, "")
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
230 reponame = wx.StaticText(self, -1, "Name:")
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
231 self.texts["reponame"] = wx.TextCtrl(self, -1, '')
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
232 self.buttons['addrepo'] = wx.Button(self, wx.ID_NEW)
36
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
233
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
234 ##Build Button
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
235 self.sizers["newrepo_layout"].Add(self.buttons['addrepo'], -1, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL)
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
236 self.sizers["newrepo_layout"].Add(empty, -1)
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
237 self.sizers["newrepo_layout"].Add(reponame, -1, wx.ALIGN_CENTER|wx.ALIGN_CENTER_VERTICAL|wx.ALL)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
238 self.sizers["newrepo_layout"].Add(self.texts["reponame"], -1, wx.EXPAND)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
239 self.sizers["newrepo_layout"].AddGrowableCol(1)
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
240 self.sizers["newbutton"].Add(self.sizers["newrepo_layout"], -1, wx.EXPAND)
62
e8029caed892 Traipse Dev 'OpenRPG' {090813-01}
sirebral
parents: 61
diff changeset
241
40
95db4430caed If you have nothing in the list, New button works now. Adds duplicates though
sirebral
parents: 39
diff changeset
242 #Repo List Panel
36
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
243 self.repopanel = wx.ScrolledWindow(self)
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
244 self.repopanel.SetScrollbars(20,20,55,40)
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
245 self.repopanel.Scroll(50,10)
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
246 self.box_sizers["repolist"] = wx.StaticBox(self.repopanel, -1, "Current Repo List")
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
247 self.sizers["repolist"] = wx.StaticBoxSizer(self.box_sizers["repolist"], wx.VERTICAL)
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
248 self.sizers["repo"] = wx.GridBagSizer(hgap=2, vgap=2)
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
249 self.sizers["repolist_layout"] = wx.FlexGridSizer(rows=1, cols=1, hgap=2, vgap=5)
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
250 self.manifest = manifest
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
251
44
15a76be834dc Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents: 43
diff changeset
252 self.NewRepoList(None)
39
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
253 self.BuildRepoList(None)
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
254
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
255 self.sizers["repolist_layout"].AddGrowableCol(0)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
256 self.sizers["repolist"].Add(self.sizers["repolist_layout"], -1, wx.EXPAND)
36
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
257 self.sizers["repo"].Add(self.sizers["repolist"], (0,0), flag=wx.EXPAND)
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
258 self.sizers["repo"].AddGrowableCol(0)
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
259 self.sizers['repo'].AddGrowableRow(0)
40
95db4430caed If you have nothing in the list, New button works now. Adds duplicates though
sirebral
parents: 39
diff changeset
260 self.sizers['repo'].AddGrowableRow(1)
36
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
261 self.repopanel.SetSizer(self.sizers['repo'])
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
262 self.repopanel.SetAutoLayout(True)
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
263
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
264 #Build Main Sizer
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
265 self.sizers["main"].Add(self.sizers["newbutton"], (0,0), flag=wx.EXPAND)
36
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
266 self.sizers["main"].Add(self.repopanel, (1,0), flag=wx.EXPAND)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
267 self.sizers["main"].AddGrowableCol(0)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
268 self.sizers["main"].AddGrowableCol(1)
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
269 self.sizers["main"].AddGrowableRow(1)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
270 self.SetSizer(self.sizers["main"])
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
271 self.SetAutoLayout(True)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
272 self.Fit()
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
273 self.Bind(wx.EVT_BUTTON, self.AddRepo, self.buttons['addrepo'])
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
274
44
15a76be834dc Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents: 43
diff changeset
275 def NewRepoList(self, event):
15a76be834dc Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents: 43
diff changeset
276 self.id = -1; self.box = {}; self.box_name= {}; self.main = {}; self.container = {}; self.layout = {}
15a76be834dc Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents: 43
diff changeset
277 self.name = {}; self.url = {}; self.url_list = {}; self.pull = {}; self.uri = {}; self.delete = {}
15a76be834dc Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents: 43
diff changeset
278 self.defaultcheck = {}; self.default = {}; self.repotrac = {}
15a76be834dc Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents: 43
diff changeset
279 self.pull_list = {}; self.delete_list = {}; self.defchecklist = {}
15a76be834dc Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents: 43
diff changeset
280
39
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
281 def BuildRepoList(self, event):
40
95db4430caed If you have nothing in the list, New button works now. Adds duplicates though
sirebral
parents: 39
diff changeset
282 self.repolist = self.manifest.GetList('UpdateManifest', 'repolist', '')
41
6d18ee109e02 Duplicates removed, refresh button still prints. Moving to Pull command
sirebral
parents: 40
diff changeset
283 try: self.repolist = self.repo
6d18ee109e02 Duplicates removed, refresh button still prints. Moving to Pull command
sirebral
parents: 40
diff changeset
284 except: pass
39
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
285
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
286 #wx.Yeild() For future refrence.
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
287
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
288 for repo in self.repolist:
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
289 self.id += 1
42
81254b3935fb Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents: 41
diff changeset
290 #Build Constructs
39
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
291 self.box[self.id] = wx.StaticBox(self.repopanel, -1, str(repo))
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
292 self.main[self.id] = wx.GridBagSizer(hgap=2, vgap=2)
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
293 self.container[self.id] = wx.StaticBoxSizer(self.box[self.id], wx.VERTICAL)
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
294 self.layout[self.id] = wx.FlexGridSizer(rows=1, cols=4, hgap=2, vgap=5)
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
295 self.name[self.id] = wx.StaticText(self.repopanel, -1, 'URL')
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
296 self.uri[self.id] = self.manifest.GetString('updaterepo', repo, '')
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
297 self.url[self.id] = wx.TextCtrl(self.repopanel, -1, self.uri[self.id])
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
298 self.pull[self.id] = wx.Button(self.repopanel, wx.ID_REFRESH)
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
299 self.delete[self.id] = wx.Button(self.repopanel, wx.ID_DELETE)
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
300 self.delete_list[self.delete[self.id]] = self.id
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
301 self.defaultcheck[self.id] = wx.CheckBox(self.repopanel, -1)
42
81254b3935fb Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents: 41
diff changeset
302 self.default[self.id] = wx.StaticText(self.repopanel, -1, 'Default')
81254b3935fb Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents: 41
diff changeset
303 #Build Retraceables
81254b3935fb Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents: 41
diff changeset
304 self.box_name[self.id] = str(repo)
81254b3935fb Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents: 41
diff changeset
305 self.pull_list[self.pull[self.id]] = self.id
39
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
306 self.defchecklist[self.defaultcheck[self.id]] = self.id
42
81254b3935fb Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents: 41
diff changeset
307 #Build Layout
39
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
308 self.layout[self.id].Add(self.name[self.id], -1, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL)
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
309 self.layout[self.id].Add(self.url[self.id], -1, wx.EXPAND)
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
310 self.layout[self.id].Add(self.pull[self.id], -1, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.ALL)
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
311 self.layout[self.id].Add(self.delete[self.id], -1, wx.EXPAND)
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
312 self.layout[self.id].Add(self.defaultcheck[self.id], -1, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.ALL)
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
313 self.layout[self.id].Add(self.default[self.id], -1, wx.EXPAND)
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
314 self.layout[self.id].AddGrowableCol(1)
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
315 self.container[self.id].Add(self.layout[self.id], -1, wx.EXPAND)
43
f00b02fbf511 Delete works, GUI updates wrong. Refresh now Force pulls.
sirebral
parents: 42
diff changeset
316 #Button Events
39
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
317 self.Bind(wx.EVT_BUTTON, self.RefreshRepo, self.pull[self.id])
43
f00b02fbf511 Delete works, GUI updates wrong. Refresh now Force pulls.
sirebral
parents: 42
diff changeset
318 self.Bind(wx.EVT_BUTTON, self.DelRepo, self.delete[self.id])
52
c9694d854a61 Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents: 51
diff changeset
319 self.Bind(wx.EVT_CHECKBOX, self.SetDefault, self.defaultcheck[self.id])
39
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
320 self.sizers["repolist_layout"].Insert(0, self.container[self.id], -1, wx.EXPAND)
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
321 self.sizers['repolist_layout'].Layout()
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
322
52
c9694d854a61 Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents: 51
diff changeset
323 #Set Default Repo Button
c9694d854a61 Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents: 51
diff changeset
324 capture = self.manifest.GetString('updaterepo', 'default', '')
54
5d89a6eaf492 WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents: 52
diff changeset
325 if capture != '':
5d89a6eaf492 WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents: 52
diff changeset
326 for caught in self.uri:
5d89a6eaf492 WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents: 52
diff changeset
327 if capture == self.uri[caught]: self.id = caught; pass
5d89a6eaf492 WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents: 52
diff changeset
328 else: continue
5d89a6eaf492 WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents: 52
diff changeset
329 self.defaultcheck[self.id].SetValue(True)
52
c9694d854a61 Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents: 51
diff changeset
330
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
331 def AddRepo(self, event):
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
332 repo = self.texts['reponame'].GetValue(); repo = repo.replace(' ', '_'); repo = 'repo-' + repo
41
6d18ee109e02 Duplicates removed, refresh button still prints. Moving to Pull command
sirebral
parents: 40
diff changeset
333 self.manifest.SetString('updaterepo', repo, ''); self.repo = repo.split(',')
40
95db4430caed If you have nothing in the list, New button works now. Adds duplicates though
sirebral
parents: 39
diff changeset
334 repolist = self.manifest.GetList('UpdateManifest', 'repolist', '')
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
335 if repolist == '': pass
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
336 else: repolist = repolist + self.repo
41
6d18ee109e02 Duplicates removed, refresh button still prints. Moving to Pull command
sirebral
parents: 40
diff changeset
337 self.manifest.SetList('UpdateManifest', 'repolist', repolist)
39
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
338 self.BuildRepoList(None)
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
339
43
f00b02fbf511 Delete works, GUI updates wrong. Refresh now Force pulls.
sirebral
parents: 42
diff changeset
340 def DelRepo(self, event):
f00b02fbf511 Delete works, GUI updates wrong. Refresh now Force pulls.
sirebral
parents: 42
diff changeset
341 self.id = self.delete_list[event.GetEventObject()]
44
15a76be834dc Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents: 43
diff changeset
342 self.sizers["repolist_layout"].Hide(self.container[self.id])
15a76be834dc Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents: 43
diff changeset
343 try: del self.box_name[self.id]
15a76be834dc Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents: 43
diff changeset
344 except: pass
15a76be834dc Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents: 43
diff changeset
345 self.manifest.SetList('UpdateManifest', 'repolist', list(self.box_name.values()))
43
f00b02fbf511 Delete works, GUI updates wrong. Refresh now Force pulls.
sirebral
parents: 42
diff changeset
346 self.sizers['repolist_layout'].Layout()
f00b02fbf511 Delete works, GUI updates wrong. Refresh now Force pulls.
sirebral
parents: 42
diff changeset
347
36
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
348 def RefreshRepo(self, event):
42
81254b3935fb Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents: 41
diff changeset
349 self.id = self.pull_list[event.GetEventObject()]
81254b3935fb Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents: 41
diff changeset
350 self.manifest.SetString('updaterepo', str(self.box_name[self.id]), self.url[self.id].GetValue())
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
351 try: commands.pull(self.ui, self.r, self.url[self.id].GetValue(), rev='', update=False, force=True)
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
352 except: pass
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
353
52
c9694d854a61 Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents: 51
diff changeset
354 def SetDefault(self, event):
c9694d854a61 Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents: 51
diff changeset
355 self.id = self.defchecklist[event.GetEventObject()]
c9694d854a61 Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents: 51
diff changeset
356 self.manifest.SetString('updaterepo', 'default', self.uri[self.id])
c9694d854a61 Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents: 51
diff changeset
357 for all in self.defaultcheck:
c9694d854a61 Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents: 51
diff changeset
358 self.defaultcheck[all].SetValue(False)
c9694d854a61 Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents: 51
diff changeset
359 self.defaultcheck[self.id].SetValue(True)
c9694d854a61 Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents: 51
diff changeset
360
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
361 class Manifest(wx.Panel):
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
362 def __init__(self, parent):
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
363 wx.Panel.__init__(self, parent)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
364 self.ui = ui.ui()
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
365 self.repo = hg.repository(self.ui, ".")
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
366 self.c = self.repo.changectx('tip')
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
367 self.manifestlist = []
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
368 self.manifestlist = self.c.manifest().keys()
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
369 for mana in self.manifestlist: mana = os.sep + 'orpg' + os.sep + mana
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
370 self.manifestlist.sort()
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
371 self.SetBackgroundColour(wx.WHITE)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
372 self.sizer = wx.GridBagSizer(hgap=1, vgap=1)
36
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
373 self.manifestlog = wx.CheckListBox( self, -1, wx.DefaultPosition, wx.DefaultSize, self.manifestlist,
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
374 wx.LC_REPORT|wx.SUNKEN_BORDER|wx.EXPAND|wx.LC_HRULES)
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
375 filename = 'ignorelist.txt'
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 62
diff changeset
376 self.filename = dir_struct["home"] + 'upmana' + os.sep + filename
70
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
377 component.get('validate').config_file(filename, "default_ignorelist.txt")
45
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
378 self.mana = self.LoadDoc()
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
379 self.manifestlog.Bind(wx.EVT_CHECKLISTBOX, self.GetChecked)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
380 self.sizer.Add(self.manifestlog, (0,0), flag=wx.EXPAND)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
381 self.sizer.AddGrowableCol(0)
36
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
382 self.sizer.AddGrowableRow(0)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
383 self.SetSizer(self.sizer)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
384 self.SetAutoLayout(True)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
385
45
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
386 def GetChecked(self, event):
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
387 self.mana = []
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
388 for manifest in self.manifestlog.GetChecked(): self.mana.append(self.manifestlist[manifest])
45
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
389 self.SaveDoc()
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
390
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
391 def SaveDoc(self):
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
392 f = open(self.filename, "w")
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
393 for mana in self.mana: f.write(mana+'\n')
45
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
394 f.close()
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
395
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
396 def LoadDoc(self):
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
397 ignore = open(self.filename)
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
398 ignorelist = []
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
399 for i in ignore: ignorelist.append(str(i [:len(i)-1]))
52
c9694d854a61 Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents: 51
diff changeset
400 for i in ignorelist: #Adds previously ignored files to manifestlistlog if they are not in changesets.
c9694d854a61 Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents: 51
diff changeset
401 if self.c.manifest().has_key(i): continue
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
402 else: self.manifestlist.append(i); self.manifestlist.sort()
59
5aff3ef1ae46 New dev branch for Ornery Orc. Adds CSS styling to chat messages. Updates
sirebral
parents: 58
diff changeset
403 self.manifestlog = wx.CheckListBox( self, -1, wx.DefaultPosition, wx.DefaultSize, self.manifestlist,
5aff3ef1ae46 New dev branch for Ornery Orc. Adds CSS styling to chat messages. Updates
sirebral
parents: 58
diff changeset
404 wx.LC_REPORT|wx.SUNKEN_BORDER|wx.EXPAND|wx.LC_HRULES)
45
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
405 self.manifestlog.SetCheckedStrings(ignorelist)
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
406 manifest = ignore.readlines()
45
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
407 ignore.close()
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
408
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
409 class Control(wx.Panel):
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
410 def __init__(self, parent):
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
411 wx.Panel.__init__(self, parent)
70
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
412
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
413 ### Control Panel
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
414 self.ui = ui.ui()
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
415 self.repo = hg.repository(self.ui, ".")
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
416 self.c = self.repo.changectx('tip')
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
417 self.manifest = manifest
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
418 self.parent = parent
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
419 #logger.debug("Enter updaterFrame") #Need to set logging level
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
420
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
421 self.get_packages()
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
422 self.SetBackgroundColour(wx.WHITE)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
423 self.sizer = wx.GridBagSizer(hgap=1, vgap=1)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
424
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
425 self.buttons = {}
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
426
70
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
427 ## Changelog / File List
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
428 changelogcp = wx.Panel(self)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
429 self.changelogcp = wx.GridBagSizer(hgap=1, vgap=1)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
430 self.changelog = wx.TextCtrl(changelogcp, wx.ID_ANY, size=(300, 240), style=wx.TE_MULTILINE | wx.TE_READONLY)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
431 self.filelist = wx.TextCtrl(changelogcp, wx.ID_ANY, size=(300, 240), style=wx.TE_MULTILINE | wx.TE_READONLY)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
432 self.changelogcp.Add(self.changelog, (0,0), flag=wx.EXPAND)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
433 self.changelogcp.Add(self.filelist, (1,0), flag=wx.EXPAND)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
434 changelogcp.SetSizer(self.changelogcp)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
435 self.changelogcp.AddGrowableCol(0)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
436 self.changelogcp.AddGrowableRow(0)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
437 self.changelogcp.AddGrowableRow(1)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
438 changelogcp.SetAutoLayout(True)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
439
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
440 ## Branches / Revisions
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
441 branchcp = wx.Panel(self)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
442 self.branchcp = wx.GridBagSizer(hgap=1, vgap=1)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
443 self.branches = wx.Choice(branchcp, wx.ID_ANY, size=(125, 25), choices=self.package_list)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
444 self.branch_txt = wx.StaticText(branchcp, wx.ID_ANY, "Branches")
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
445
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
446 revlistcp = wx.Panel(self)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
447 self.revlistcp = wx.GridBagSizer(hgap=1, vgap=1)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
448 self.revlist1 = wx.ListCtrl(revlistcp, -1, wx.DefaultPosition, size=(290, 240), style=wx.LC_REPORT|wx.SUNKEN_BORDER|wx.LC_HRULES)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
449 self.revlist1.InsertColumn(0, 'Revs', 145)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
450 self.revlist1.InsertColumn(1, 'Revs', 145)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
451 self.revlistcp.Add(self.revlist1, (0,0), span=(1,2), flag=wx.EXPAND)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
452 revlistcp.SetSizer(self.revlistcp)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
453 self.revlistcp.AddGrowableCol(0)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
454 self.revlistcp.AddGrowableRow(0)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
455 self.revlistcp.AddGrowableRow(1)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
456 revlistcp.SetAutoLayout(True)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
457
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
458 self.branchcp.Add(self.branches, (0,0), flag=wx.ALIGN_LEFT)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
459 self.branchcp.Add(self.branch_txt, (0,1), flag=wx.ALIGN_CENTER_VERTICAL)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
460 self.branchcp.Add(revlistcp, (1,13), flag=wx.EXPAND|wx.ALIGN_RIGHT)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
461 branchcp.SetSizer(self.branchcp)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
462 self.branchcp.AddGrowableCol(1)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
463 self.branchcp.AddGrowableRow(0)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
464 branchcp.SetAutoLayout(True)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
465
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
466 ## Control Panel
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
467 cp = wx.Panel(self)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
468 self.cp = wx.GridBagSizer(hgap=1, vgap=1)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
469 self.buttons['update'] = wx.Button(cp, wx.ID_ANY, "Revision Update")
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
470 self.buttons['delete'] = wx.Button(cp, wx.ID_ANY, "Delete Branch")
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
471 self.cp.Add(self.buttons['update'], (0,0))
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
472 self.cp.Add(self.buttons['delete'], (0,1))
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
473 cp.SetSizer(self.cp)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
474 self.cp.AddGrowableCol(0)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
475 self.cp.AddGrowableRow(0)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
476 cp.SetAutoLayout(True)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
477
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
478 self.sizer.Add(changelogcp, (0,0), span=(2,1),flag=wx.EXPAND)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
479 self.sizer.Add(branchcp, (0,1))
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
480 self.sizer.Add(cp, (1,1), span=(2,1))
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
481
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
482 self.buttons['delete'].Disable()
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
483 self.sizer.AddGrowableCol(0)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
484 self.sizer.AddGrowableRow(0)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
485 self.sizer.AddGrowableCol(1)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
486 self.sizer.AddGrowableRow(1)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
487 self.SetSizer(self.sizer)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
488 self.SetAutoLayout(True)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
489
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
490 self.current = self.repo.dirstate.branch()
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
491 self.BranchInfo(self.current)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
492
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
493 def BranchInfo(self, branch):
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
494 cs = self.repo.changectx( self.current ).changeset()
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
495 rev = self.repo.changelog.rev(self.repo.branchtags()[self.current]) #Current revision number. Use in Controls
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
496 #print self.repo.changelog.reachable(self.repo.branchtags()[self.current])
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
497 #for heads in self.repo.changelog.reachable(self.repo.branchtags()[self.current]): #grabs revision list depending on branch.
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
498 # print self.repo.changelog.rev(heads)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
499 #self.changelog.SetValue('')
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
500 changelog = cs[4]
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
501 #self.changelog.AppendText(changelog + '\n')
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
502 #self.filelist.SetValue('')
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
503 #self.filelist.AppendText("Currently selected branch: " + branch + "\n\nAuthor: "+cs[1]+"\n\n")
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
504 #self.filelist.AppendText("Files Modified (in update): \n")
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
505 #for f in cs[3]: self.filelist.AppendText(f+"\n")
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
506
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
507 def get_packages(self, type=None):
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
508 #Fixed and ready for Test. Can be cleaner
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
509 self.package_list = []
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
510 b = self.repo.branchtags()
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
511 heads = dict.fromkeys(self.repo.heads(), 1) #The code below looks superfluous but there is good info inside
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
512 l = [((n in heads), self.repo.changelog.rev(n), n, t) for t, n in b.items()]
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
513 l.sort()
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
514 l.reverse()
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
515 for ishead, r, n, t in l: self.package_list.append(t)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
516
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
517 def get_package(self):
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
518 self.get_packages()
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
519 if self.package_list == None: return None
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
520 return None
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
521
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
522 class updaterFrame(wx.Frame):
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
523 def __init__(self, parent, title, openrpg, manifest, main):
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
524
61
f3d8101211c4 Traipse Dev 'OpenRPG' {090813-00}
sirebral
parents: 60
diff changeset
525 wx.Frame.__init__(self, None, wx.ID_ANY, title, size=(600,480), style=wx.DEFAULT_FRAME_STYLE)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 62
diff changeset
526 if wx.Platform == '__WXMSW__': icon = wx.Icon(dir_struct["icon"]+'d20.ico', wx.BITMAP_TYPE_ICO)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 62
diff changeset
527 else: icon = wx.Icon(dir_struct["icon"]+"d20.xpm", wx.BITMAP_TYPE_XPM )
70
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
528
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
529 self.SetIcon(icon)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
530 self.CenterOnScreen()
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
531 self.main = main
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
532 ####### Panel Stuff ######
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
533 p = wx.Panel(self)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
534 nb = wx.Notebook(p)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
535
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
536 # create the page windows as children of the notebook
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
537 page1 = Updater(nb, openrpg, manifest)
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
538 page2 = Repos(nb, openrpg, manifest)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
539 page3 = Manifest(nb)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
540 page4 = Control(nb)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
541
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
542 # add the pages to the notebook with the label to show on the tab
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
543 nb.AddPage(page1, "Updater")
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
544 nb.AddPage(page2, "Repos")
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
545 nb.AddPage(page3, "Manifest")
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
546 nb.AddPage(page4, "Control")
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
547
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
548 # finally, put the notebook in a sizer for the panel to manage
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
549 # the layout
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
550 sizer = wx.BoxSizer()
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
551 sizer.Add(nb, 1, wx.EXPAND)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
552 p.SetSizer(sizer)
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
553 self.Bind(wx.EVT_CLOSE, self.OnClose)
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
554
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
555 def OnClose(self, event):
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
556 if self.main == False: self.Destroy()
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
557 if self.main == True: self.Hide()
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
558
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
559 class updateApp(wx.App):
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
560 def OnInit(self):
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
561 self.main = False
70
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
562 #logger.setLogToConsol(False)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
563 #logger. ??? ("Updater Start", ORPG_NOTE)
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
564 self.manifest = manifest.ManifestChanges()
70
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
565 component.add('validate', validate)
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
566 self.updater = updaterFrame(self, "OpenRPG Update Manager 0.7.2 (open beta)",
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
567 component, self.manifest, self.main)
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
568 if self.manifest.GetString("updatemana", "auto_update", "") == 'on' and self.main == False:
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
569 self.AutoUpdate(); self.OnExit()
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
570 else: pass
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
571 if self.manifest.GetString('updatemana', 'no_update', '') == 'on' and self.main == False:
51
14d4270d5e5d Fixed Auto Update not finding current branch, no pull associated yet!
sirebral
parents: 49
diff changeset
572 self.OnExit()
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
573 else: pass
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
574 try:
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
575 self.updater.Show()
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
576 self.updater.Fit()
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
577 except: pass
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
578 return True
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
579
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
580 def AutoUpdate(self):
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
581 self.ui = ui.ui()
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
582 self.repo = hg.repository(self.ui, ".")
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
583 self.c = self.repo.changectx('tip')
51
14d4270d5e5d Fixed Auto Update not finding current branch, no pull associated yet!
sirebral
parents: 49
diff changeset
584 self.current = self.repo.dirstate.branch()
54
5d89a6eaf492 WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents: 52
diff changeset
585
52
c9694d854a61 Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents: 51
diff changeset
586 capture = self.manifest.GetString('updaterepo', 'default', '')
54
5d89a6eaf492 WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents: 52
diff changeset
587 if capture != '':
5d89a6eaf492 WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents: 52
diff changeset
588 commands.pull(self.ui, self.repo, capture, rev='', update=False, force=True)
5d89a6eaf492 WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents: 52
diff changeset
589 filename = 'ignorelist.txt'
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 62
diff changeset
590 self.filename = dir_struct["home"] + 'upmana' + os.sep + filename
70
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
591 component.get('validate').config_file(filename, "default_ignorelist.txt")
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
592
54
5d89a6eaf492 WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents: 52
diff changeset
593 self.mana = self.LoadDoc()
57
9014d7861bb3 Removed some extra print messages from the server. Cleaned up the Manifest
sirebral
parents: 55
diff changeset
594 for ignore in self.ignorelist:
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 62
diff changeset
595 shutil.copy(ignore, dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep +ignore.split('/')[len(ignore.split('/')) - 1])
54
5d89a6eaf492 WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents: 52
diff changeset
596 hg.clean(self.repo, self.current)
5d89a6eaf492 WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents: 52
diff changeset
597 for ignore in self.ignorelist:
57
9014d7861bb3 Removed some extra print messages from the server. Cleaned up the Manifest
sirebral
parents: 55
diff changeset
598 print ignore.split('/')[len(ignore.split('/')) - 1]
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 62
diff changeset
599 shutil.copyfile(dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep + ignore.split('/')[len(ignore.split('/')) - 1], ignore)
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 62
diff changeset
600 os.remove(dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep + ignore.split('/')[len(ignore.split('/')) - 1])
70
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
601 else: print 'No default repository set, skipping Auto Update!' #Add better warning!
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
602
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
603 def LoadDoc(self):
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
604 ignore = open(self.filename)
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
605 self.ignorelist = []
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
606 for i in ignore: self.ignorelist.append(str(i [:len(i)-1]))
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
607 manifest = ignore.readlines()
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
608 ignore.close()
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
609
46
599f727e3833 Getting ready to test!! Main functions seem to be working.
sirebral
parents: 45
diff changeset
610 def OnExit(self):
70
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
611 imported = ['manifest', 'orpg.dirpath', 'orpg.orpgCore', 'orpg.orpg_version',
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
612 'orpg.tools.orpg_log', 'orpg.tools.orpg_log', 'orpg.orpg_xml', 'orpg.dirpath',
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
613 'orpg.dirpath', 'upmana.validate', 'mercurial.ui', 'mercurial.hg',
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
614 'mercurial.commands', 'mercurial.repo', 'mercurial.revlog', 'mercurial.cmdutil', 'shutil']
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
615 for name in imported:
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
616 if name in sys.modules: del sys.modules[name]
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
617
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
618 try: self.updater.Destroy()
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
619 except: pass