Mercurial > traipse_dev
annotate upmana/updatemana.py @ 142:2345c12d93a7 beta
Traipse Beta 'OpenRPG' {091123-01}
Traipse is a distribution of OpenRPG that is designed to be easy to setup and go.
Traipse also makes it easy for developers to work on code without fear of
sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the
code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the
productivity of the user.
Update Summary (Beta)
Added Bookmarks
Fix to Remote Admin Commands
Minor fix to text based Server
Fix to Pretty Print, from Core
Fix to Splitter Nodes not being created
Fix to massive amounts of images loading, from Core
Added 'boot' command to remote admin
Added confirmation window for sent nodes
Minor changes to allow for portability to an OpenSUSE linux OS
Miniatures Layer pop up box allows users to turn off Mini labels, from FlexiRPG
Zoom Mouse plugin added
Images added to Plugin UI
Switching to Element Tree
Map efficiency, from FlexiRPG
Added Status Bar to Update Manager
default_manifest.xml renamed to default_upmana.xml
Cleaner clode for saved repositories
New TrueDebug Class in orpg_log (See documentation for usage)
Mercurial's hgweb folder is ported to upmana
Pretty important update that can help remove thousands of dead children from your
gametree.
Children, <forms />, <group_atts />, <horizontal />, <cols />, <rows />, <height
/>, etc... are all tags now. Check your gametree and look for dead children!!
New Gametree Recursion method, mapping, and context sensitivity. !Infinite Loops
return error instead of freezing the software!
New Syntax added for custom PC sheets
Tip of the Day added, from Core and community
Fixed Whiteboard ID to prevent random line or text deleting. Modified ID's to
prevent non updated clients from ruining the fix.
author | sirebral |
---|---|
date | Mon, 23 Nov 2009 12:20:51 -0600 |
parents | dcf4fbe09b70 |
children | 6c5f46a5924b |
rev | line source |
---|---|
135 | 1 import wx, sys, os #just .sep maybe |
2 from manifest 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 import shutil |
80
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
4 |
74 | 5 from orpg.orpgCore import component |
135 | 6 from orpg.dirpath import dir_struct |
80
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
7 from orpg.tools.orpg_log import logger, crash |
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.decorators import debugging |
135 | 9 from upmana.validate import validate |
10 from orpg.dirpath import dir_struct | |
61 | 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 |
135 | 13 class Term2Win(object): |
14 # A stdout redirector. Allows the messages from Mercurial to be seen in the Install Window | |
15 def write(self, text): | |
16 statbar.SetStatusText(text) | |
17 wx.Yield() | |
142 | 18 #sys.__stdout__.write(text) |
46
599f727e3833
Getting ready to test!! Main functions seem to be working.
sirebral
parents:
45
diff
changeset
|
19 |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
20 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
|
21 @debugging |
135 | 22 def __init__(self, parent, component): |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
23 wx.Panel.__init__(self, parent) |
135 | 24 ### Status Bar ### |
25 #statbar.SetStatusText('Select a Package and Update') | |
26 statbar.SetStatusText('New Status Bar') | |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
27 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
28 ### Update Manager |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
29 self.ui = ui.ui() |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
30 self.repo = hg.repository(self.ui, ".") |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
31 self.c = self.repo.changectx('tip') |
75 | 32 self.parent = parent |
135 | 33 self.SetBackgroundColour(wx.WHITE) |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
34 self.sizer = wx.GridBagSizer(hgap=1, vgap=1) |
135 | 35 self.changelog = wx.TextCtrl(self, wx.ID_ANY, size=(300, -1), |
36 style=wx.TE_MULTILINE | wx.TE_READONLY) | |
37 self.filelist = wx.TextCtrl(self, wx.ID_ANY, size=(275, 300), | |
38 style=wx.TE_MULTILINE | wx.TE_READONLY) | |
39 self.buttons = {} | |
40 self.buttons['progress_bar'] = wx.Gauge(self, wx.ID_ANY, 100) | |
41 self.buttons['auto_text'] = wx.StaticText(self, wx.ID_ANY, "Auto Update") | |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
42 self.buttons['auto_check'] = wx.CheckBox(self, wx.ID_ANY) |
135 | 43 self.buttons['no_text'] = wx.StaticText(self, wx.ID_ANY, "No Update") |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
44 self.buttons['no_check'] = wx.CheckBox(self, wx.ID_ANY) |
135 | 45 self.buttons['advanced'] = wx.Button(self, wx.ID_ANY, "Package Select") |
46 self.buttons['update'] = wx.Button(self, wx.ID_ANY, "Update Now") | |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
47 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
|
48 |
135 | 49 self.sizer.Add(self.changelog, (0,0), span=(4,1), flag=wx.EXPAND) |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
50 self.sizer.Add(self.filelist, (0,1), span=(1,3), flag=wx.EXPAND) |
135 | 51 |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
52 self.sizer.Add(self.buttons['progress_bar'], (1,1), span=(1,3), flag=wx.EXPAND) |
135 | 53 self.sizer.Add(self.buttons['auto_text'], (2,1)) |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
54 self.sizer.Add(self.buttons['auto_check'], (2,2), flag=wx.EXPAND) |
135 | 55 self.sizer.Add(self.buttons['no_text'], (3,1)) |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
56 self.sizer.Add(self.buttons['no_check'], (3,2), flag=wx.EXPAND) |
135 | 57 self.sizer.Add(self.buttons['advanced'], (2,3), flag=wx.EXPAND) |
58 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
|
59 self.sizer.Add(self.buttons['finish'], (4,3), flag=wx.EXPAND) |
135 | 60 self.buttons['finish'].Disable() |
61 self.sizer.AddGrowableCol(0) | |
62 self.sizer.AddGrowableRow(0) | |
63 self.SetSizer(self.sizer) | |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
64 self.SetAutoLayout(True) |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
65 self.get_package |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
66 |
48
0aeee1992423
This updates fixes three things. Branch names are now current to your udpate
sirebral
parents:
47
diff
changeset
|
67 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
|
68 self.BranchInfo(self.current) |
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
69 |
135 | 70 if manifest.GetString("updatemana", "no_update", "") == 'on': self.buttons['no_check'].SetValue(True) |
71 else: self.buttons['no_check'].SetValue(False) | |
72 if manifest.GetString("updatemana", "auto_update", "") == 'on': self.buttons['auto_check'].SetValue(True) | |
73 else: self.buttons['auto_check'].SetValue(False) | |
74 | |
75 ## Event Handlers | |
76 self.Bind(wx.EVT_BUTTON, self.Update, self.buttons['update']) | |
77 self.Bind(wx.EVT_BUTTON, self.Finish, self.buttons['finish']) | |
78 self.Bind(wx.EVT_BUTTON, self.ChooseBranch, self.buttons['advanced']) | |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
79 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
|
80 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
|
81 |
135 | 82 def ToggleAutoUpdate(self, event): |
49
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: |
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
84 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
|
85 self.buttons['no_check'].SetValue(False) |
135 | 86 manifest.SetString("updatemana", "no_update", "off") |
87 manifest.SetString("updatemana", "auto_update", "on") | |
88 else: 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
|
89 |
135 | 90 def ToggleNoUpdate(self, event): |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
91 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
|
92 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
|
93 self.buttons['auto_check'].SetValue(False) |
135 | 94 manifest.SetString("updatemana", "auto_update", "off") |
95 manifest.SetString("updatemana", "no_update", "on") | |
96 else: manifest.SetString("updatemana", "no_update", "off") | |
97 | |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
98 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
|
99 self.ui = ui.ui() |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
100 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
|
101 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
|
102 filename = 'ignorelist.txt' |
66 | 103 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
|
104 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
|
105 self.mana = self.LoadDoc() |
74 | 106 temp = dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep |
47
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
107 for ignore in self.ignorelist: |
74 | 108 shutil.copy(ignore, temp + 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
|
109 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
|
110 for ignore in self.ignorelist: |
74 | 111 shutil.copyfile(temp + ignore.split('/')[len(ignore.split('/')) - 1], ignore) |
112 os.remove(temp + 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
|
113 |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
114 def LoadDoc(self): |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
115 ignore = open(self.filename) |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
116 self.ignorelist = [] |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
117 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
|
118 manifest = ignore.readlines() |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
119 ignore.close() |
135 | 120 |
121 def Finish(self, evt=None): | |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
122 try: self.parent.Destroy() |
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
123 except: |
135 | 124 print 'Fail'; exit() |
125 | |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
126 def ChooseBranch(self, evt=None): |
135 | 127 dlg = wx.Dialog(self, wx.ID_ANY, "Package Selector", style=wx.DEFAULT_DIALOG_STYLE) |
128 if wx.Platform == '__WXMSW__': icon = wx.Icon(dir_struct["icon"]+'d20.ico', wx.BITMAP_TYPE_ICO) | |
129 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
|
130 dlg.SetIcon(icon) |
0aeee1992423
This updates fixes three things. Branch names are now current to your udpate
sirebral
parents:
47
diff
changeset
|
131 |
0aeee1992423
This updates fixes three things. Branch names are now current to your udpate
sirebral
parents:
47
diff
changeset
|
132 self.ui = ui.ui() |
0aeee1992423
This updates fixes three things. Branch names are now current to your udpate
sirebral
parents:
47
diff
changeset
|
133 self.repo = hg.repository(self.ui, ".") |
135 | 134 self.c = self.repo.changectx('tip') |
135 | |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
136 dlgsizer = wx.GridBagSizer(hgap=1, vgap=1) |
135 | 137 Yes = wx.Button( dlg, wx.ID_OK, "Ok" ) |
138 Yes.SetDefault() | |
139 rgroup = wx.RadioButton(dlg, wx.ID_ANY, "group_start", style=wx.RB_GROUP) | |
140 rgroup.Hide() | |
141 | |
37
cd8f740a8ffc
Whoops! Broke the Package Selecter. Now fixed!! Does anyone evene read these?
sirebral
parents:
36
diff
changeset
|
142 self.get_packages() |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
143 if self.package_list == None: return |
135 | 144 types = self.package_list |
145 row=0; col=0 | |
48
0aeee1992423
This updates fixes three things. Branch names are now current to your udpate
sirebral
parents:
47
diff
changeset
|
146 self.current = self.repo.dirstate.branch() |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
147 self.package_type = self.current |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
148 self.btnlist = {}; self.btn = {} |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
149 self.id = 1 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
150 |
135 | 151 for t in types: |
152 self.btnName = str(t) | |
153 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
|
154 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
|
155 self.btnlist[self.id] = self.btnName |
135 | 156 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
|
157 col += 1; self.id += 1 |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
158 if col == 3: row += 1; col = 0 |
135 | 159 |
47
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
160 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
|
161 dlgsizer.AddGrowableCol(0) |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
162 dlgsizer.AddGrowableRow(0) |
135 | 163 dlg.SetAutoLayout( True ) |
47
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
164 dlg.SetSizer( dlgsizer ) |
135 | 165 dlgsizer.Fit( dlg ) |
166 dlg.Centre() | |
167 dlg.Bind(wx.EVT_RADIOBUTTON, self.PackageSet) | |
168 if dlg.ShowModal(): dlg.Destroy() | |
169 | |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
170 def PackageSet(self, event): |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
171 for btn in self.btn: |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
172 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
|
173 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
174 branches = self.repo.branchtags() |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
175 heads = dict.fromkeys(self.repo.heads(), 1) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
176 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
|
177 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
178 if self.current != type: |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
179 heads = dict.fromkeys(self.repo.heads(), self.repo.branchtags()) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
180 branches = dict.copy(self.repo.branchtags()) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
181 self.BranchInfo(self.current) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
182 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
183 def BranchInfo(self, branch): |
61 | 184 cs = self.repo.changectx( self.current ).changeset() |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
185 self.changelog.SetValue('') |
61 | 186 changelog = cs[4] |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
187 self.changelog.AppendText(changelog + '\n') |
61 | 188 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
|
189 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
|
190 self.filelist.AppendText("Files Modified (in update): \n") |
62 | 191 for f in cs[3]: self.filelist.AppendText(f+"\n") |
135 | 192 |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
193 def get_packages(self, type=None): |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
194 #Fixed and ready for Test. Can be cleaner |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
195 self.package_list = [] |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
196 b = self.repo.branchtags() |
62 | 197 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
|
198 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
|
199 l.sort() |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
200 l.reverse() |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
201 for ishead, r, n, t in l: self.package_list.append(t) |
135 | 202 |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
203 def get_package(self): |
135 | 204 self.get_packages() |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
205 if self.package_list == None: return None |
135 | 206 return None |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
207 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
208 class Repos(wx.Panel): |
135 | 209 def __init__(self, parent, openrpg): |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
210 wx.Panel.__init__(self, parent) |
135 | 211 ### Status Bar ### |
212 #statbar.SetStatusText('Add, Delete, or Refresh your source Tracs') | |
213 statbar.SetStatusText('New Status Bar') | |
42
81254b3935fb
Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents:
41
diff
changeset
|
214 ### Update Manager |
81254b3935fb
Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents:
41
diff
changeset
|
215 self.ui = ui.ui() |
81254b3935fb
Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents:
41
diff
changeset
|
216 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
|
217 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
|
218 |
48
0aeee1992423
This updates fixes three things. Branch names are now current to your udpate
sirebral
parents:
47
diff
changeset
|
219 #mainpanel = self |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
220 self.openrpg = openrpg |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
221 self.buttons = {} |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
222 self.texts = {} |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
223 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
224 ## Section Sizers (with frame edges and text captions) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
225 self.box_sizers = {} |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
226 self.box_sizers["newbutton"] = wx.StaticBox(self, -1) |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
227 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
228 ## Layout Sizers |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
229 self.sizers = {} |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
230 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
|
231 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
|
232 |
36
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
233 #Button Layout |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
234 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
|
235 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
|
236 empty = wx.StaticText(self, -1, "") |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
237 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
|
238 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
|
239 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
|
240 |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
241 ##Build Button |
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
242 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
|
243 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
|
244 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
|
245 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
|
246 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
|
247 self.sizers["newbutton"].Add(self.sizers["newrepo_layout"], -1, wx.EXPAND) |
62 | 248 |
40
95db4430caed
If you have nothing in the list, New button works now. Adds duplicates though
sirebral
parents:
39
diff
changeset
|
249 #Repo List Panel |
36
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
250 self.repopanel = wx.ScrolledWindow(self) |
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
251 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
|
252 self.repopanel.Scroll(50,10) |
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
253 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
|
254 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
|
255 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
|
256 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
|
257 |
44
15a76be834dc
Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents:
43
diff
changeset
|
258 self.NewRepoList(None) |
39
93a27aea09ce
Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents:
38
diff
changeset
|
259 self.BuildRepoList(None) |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
260 |
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
261 self.sizers["repolist_layout"].AddGrowableCol(0) |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
262 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
|
263 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
|
264 self.sizers["repo"].AddGrowableCol(0) |
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
265 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
|
266 self.sizers['repo'].AddGrowableRow(1) |
36
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
267 self.repopanel.SetSizer(self.sizers['repo']) |
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
268 self.repopanel.SetAutoLayout(True) |
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
269 |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
270 #Build Main Sizer |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
271 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
|
272 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
|
273 self.sizers["main"].AddGrowableCol(0) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
274 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
|
275 self.sizers["main"].AddGrowableRow(1) |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
276 self.SetSizer(self.sizers["main"]) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
277 self.SetAutoLayout(True) |
135 | 278 #self.Fit() |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
279 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
|
280 |
44
15a76be834dc
Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents:
43
diff
changeset
|
281 def NewRepoList(self, event): |
135 | 282 self.id = -1 |
283 self.box = {}; self.box_name= {}; self.main = {}; self.container = {}; self.layout = {} | |
44
15a76be834dc
Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents:
43
diff
changeset
|
284 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
|
285 self.defaultcheck = {}; self.default = {}; self.repotrac = {} |
135 | 286 self.pull_list = {}; self.delete_list = {}; self.defchecklist = {}; self.repolist = [] |
44
15a76be834dc
Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents:
43
diff
changeset
|
287 |
39
93a27aea09ce
Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents:
38
diff
changeset
|
288 def BuildRepoList(self, event): |
135 | 289 repolist = manifest.PluginChildren('updaterepo') |
290 appendlist = [] | |
291 for repo in repolist: | |
292 if repo not in self.repolist: appendlist.append(repo) | |
293 self.repolist = repolist | |
39
93a27aea09ce
Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents:
38
diff
changeset
|
294 |
135 | 295 for repo in appendlist: |
39
93a27aea09ce
Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents:
38
diff
changeset
|
296 self.id += 1 |
42
81254b3935fb
Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents:
41
diff
changeset
|
297 #Build Constructs |
39
93a27aea09ce
Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents:
38
diff
changeset
|
298 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
|
299 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
|
300 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
|
301 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
|
302 self.name[self.id] = wx.StaticText(self.repopanel, -1, 'URL') |
135 | 303 self.uri[self.id] = manifest.GetString('updaterepo', repo, '') |
304 #except: self.uri[self.id] = '' | |
39
93a27aea09ce
Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents:
38
diff
changeset
|
305 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
|
306 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
|
307 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
|
308 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
|
309 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
|
310 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
|
311 #Build Retraceables |
81254b3935fb
Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents:
41
diff
changeset
|
312 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
|
313 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
|
314 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
|
315 #Build Layout |
135 | 316 self.layout[self.id].Add(self.name[self.id], |
317 -1, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL) | |
318 self.layout[self.id].Add(self.url[self.id], | |
319 -1, wx.EXPAND) | |
320 self.layout[self.id].Add(self.pull[self.id], | |
321 -1, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.ALL) | |
39
93a27aea09ce
Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents:
38
diff
changeset
|
322 self.layout[self.id].Add(self.delete[self.id], -1, wx.EXPAND) |
135 | 323 self.layout[self.id].Add(self.defaultcheck[self.id], |
324 -1, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.ALL) | |
39
93a27aea09ce
Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents:
38
diff
changeset
|
325 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
|
326 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
|
327 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
|
328 #Button Events |
39
93a27aea09ce
Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents:
38
diff
changeset
|
329 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
|
330 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
|
331 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
|
332 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
|
333 self.sizers['repolist_layout'].Layout() |
135 | 334 self.Layout() |
39
93a27aea09ce
Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents:
38
diff
changeset
|
335 |
52
c9694d854a61
Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents:
51
diff
changeset
|
336 #Set Default Repo Button |
135 | 337 capture = manifest.GetString('default', 'repo', '') |
54
5d89a6eaf492
WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents:
52
diff
changeset
|
338 if capture != '': |
5d89a6eaf492
WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents:
52
diff
changeset
|
339 for caught in self.uri: |
5d89a6eaf492
WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents:
52
diff
changeset
|
340 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
|
341 else: continue |
5d89a6eaf492
WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents:
52
diff
changeset
|
342 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
|
343 |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
344 def AddRepo(self, event): |
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
345 repo = self.texts['reponame'].GetValue(); repo = repo.replace(' ', '_'); repo = 'repo-' + repo |
142 | 346 manifest.SetString('updaterepo', repo, '') |
39
93a27aea09ce
Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents:
38
diff
changeset
|
347 self.BuildRepoList(None) |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
348 |
43
f00b02fbf511
Delete works, GUI updates wrong. Refresh now Force pulls.
sirebral
parents:
42
diff
changeset
|
349 def DelRepo(self, event): |
f00b02fbf511
Delete works, GUI updates wrong. Refresh now Force pulls.
sirebral
parents:
42
diff
changeset
|
350 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
|
351 self.sizers["repolist_layout"].Hide(self.container[self.id]) |
135 | 352 manifest.DelString('updaterepo', self.box_name[self.id]) |
44
15a76be834dc
Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents:
43
diff
changeset
|
353 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
|
354 except: pass |
43
f00b02fbf511
Delete works, GUI updates wrong. Refresh now Force pulls.
sirebral
parents:
42
diff
changeset
|
355 self.sizers['repolist_layout'].Layout() |
135 | 356 self.repolist = manifest.PluginChildren('updaterepo') |
43
f00b02fbf511
Delete works, GUI updates wrong. Refresh now Force pulls.
sirebral
parents:
42
diff
changeset
|
357 |
36
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
358 def RefreshRepo(self, event): |
42
81254b3935fb
Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents:
41
diff
changeset
|
359 self.id = self.pull_list[event.GetEventObject()] |
135 | 360 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
|
361 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
|
362 except: pass |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
363 |
52
c9694d854a61
Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents:
51
diff
changeset
|
364 def SetDefault(self, event): |
c9694d854a61
Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents:
51
diff
changeset
|
365 self.id = self.defchecklist[event.GetEventObject()] |
135 | 366 manifest.SetString('default', 'repo', self.uri[self.id]) |
52
c9694d854a61
Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents:
51
diff
changeset
|
367 for all in self.defaultcheck: |
c9694d854a61
Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents:
51
diff
changeset
|
368 self.defaultcheck[all].SetValue(False) |
c9694d854a61
Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents:
51
diff
changeset
|
369 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
|
370 |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
371 class Manifest(wx.Panel): |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
372 def __init__(self, parent): |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
373 wx.Panel.__init__(self, parent) |
135 | 374 ### Status Bar ### |
375 #statbar.SetStatusText('Create an Ignore List') | |
376 statbar.SetStatusText('New Status Bar') | |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
377 self.ui = ui.ui() |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
378 self.repo = hg.repository(self.ui, ".") |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
379 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
|
380 self.manifestlist = [] |
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
381 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
|
382 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
|
383 self.manifestlist.sort() |
135 | 384 self.SetBackgroundColour(wx.WHITE) |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
385 self.sizer = wx.GridBagSizer(hgap=1, vgap=1) |
74 | 386 self.manifestlog = wx.CheckListBox( self, -1, wx.DefaultPosition, wx.DefaultSize, |
387 self.manifestlist, 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
|
388 filename = 'ignorelist.txt' |
66 | 389 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
|
390 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
|
391 self.mana = self.LoadDoc() |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
392 self.manifestlog.Bind(wx.EVT_CHECKLISTBOX, self.GetChecked) |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
393 self.sizer.Add(self.manifestlog, (0,0), flag=wx.EXPAND) |
135 | 394 self.sizer.AddGrowableCol(0) |
36
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
395 self.sizer.AddGrowableRow(0) |
135 | 396 self.SetSizer(self.sizer) |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
397 self.SetAutoLayout(True) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
398 |
45
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
399 def GetChecked(self, event): |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
400 self.mana = [] |
47
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
401 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
|
402 self.SaveDoc() |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
403 |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
404 def SaveDoc(self): |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
405 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
|
406 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
|
407 f.close() |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
408 |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
409 def LoadDoc(self): |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
410 ignore = open(self.filename) |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
411 ignorelist = [] |
47
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
412 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
|
413 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
|
414 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
|
415 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
|
416 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
|
417 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
|
418 self.manifestlog.SetCheckedStrings(ignorelist) |
47
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
419 manifest = ignore.readlines() |
45
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
420 ignore.close() |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
421 |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
422 class Control(wx.Panel): |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
423 def __init__(self, parent): |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
424 wx.Panel.__init__(self, parent) |
135 | 425 ### Status Bar ### |
426 #statbar.SetStatusText('Advanced Controls & Rollback') | |
427 statbar.SetStatusText('New Status Bar') | |
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
|
428 ### 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
|
429 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
|
430 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
|
431 self.c = self.repo.changectx('tip') |
135 | 432 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
|
433 #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
|
434 |
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.get_packages() |
135 | 436 self.SetBackgroundColour(wx.WHITE) |
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
|
437 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
|
438 self.buttons = {} |
135 | 439 |
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
|
440 ## 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
|
441 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
|
442 self.changelogcp = wx.GridBagSizer(hgap=1, vgap=1) |
78
57887ab0df51
Finishing up Controls GUI. Update Manager's GUI will see refinement later on. Getting ready to add revision controls.
sirebral
parents:
75
diff
changeset
|
443 self.changelog = wx.TextCtrl(changelogcp, wx.ID_ANY, size=wx.DefaultSize, style=wx.TE_MULTILINE | wx.TE_READONLY) |
57887ab0df51
Finishing up Controls GUI. Update Manager's GUI will see refinement later on. Getting ready to add revision controls.
sirebral
parents:
75
diff
changeset
|
444 self.filelist = wx.TextCtrl(changelogcp, wx.ID_ANY, size=wx.DefaultSize, style=wx.TE_MULTILINE | wx.TE_READONLY) |
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
|
445 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
|
446 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
|
447 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
|
448 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
|
449 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
|
450 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
|
451 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
|
452 |
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 ## 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
|
454 branchcp = wx.Panel(self) |
92 | 455 self.current = self.repo.dirstate.branch() |
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
|
456 self.branchcp = wx.GridBagSizer(hgap=1, vgap=1) |
78
57887ab0df51
Finishing up Controls GUI. Update Manager's GUI will see refinement later on. Getting ready to add revision controls.
sirebral
parents:
75
diff
changeset
|
457 self.branches = wx.Choice(branchcp, wx.ID_ANY, choices=self.package_list) |
92 | 458 self.branches.SetSelection(self.package_list.index(self.current)) |
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
|
459 self.branch_txt = wx.StaticText(branchcp, wx.ID_ANY, "Branches") |
78
57887ab0df51
Finishing up Controls GUI. Update Manager's GUI will see refinement later on. Getting ready to add revision controls.
sirebral
parents:
75
diff
changeset
|
460 self.branchcp.Add(self.branches, (0,0)) |
57887ab0df51
Finishing up Controls GUI. Update Manager's GUI will see refinement later on. Getting ready to add revision controls.
sirebral
parents:
75
diff
changeset
|
461 self.branchcp.Add(self.branch_txt, (0,1), flag=wx.ALIGN_CENTER_VERTICAL) |
57887ab0df51
Finishing up Controls GUI. Update Manager's GUI will see refinement later on. Getting ready to add revision controls.
sirebral
parents:
75
diff
changeset
|
462 branchcp.SetSizer(self.branchcp) |
57887ab0df51
Finishing up Controls GUI. Update Manager's GUI will see refinement later on. Getting ready to add revision controls.
sirebral
parents:
75
diff
changeset
|
463 branchcp.SetAutoLayout(True) |
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
|
464 |
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 revlistcp = wx.Panel(self) |
78
57887ab0df51
Finishing up Controls GUI. Update Manager's GUI will see refinement later on. Getting ready to add revision controls.
sirebral
parents:
75
diff
changeset
|
466 self.revlistcp = wx.GridBagSizer(hgap=2, vgap=2) |
57887ab0df51
Finishing up Controls GUI. Update Manager's GUI will see refinement later on. Getting ready to add revision controls.
sirebral
parents:
75
diff
changeset
|
467 self.revlist = wx.ListCtrl(revlistcp, -1, wx.DefaultPosition, size=wx.DefaultSize, |
74 | 468 style=wx.LC_REPORT|wx.SUNKEN_BORDER|wx.LC_HRULES) |
80
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
469 self.revlist.InsertColumn(0, 'Revs') |
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
470 self.revlist.InsertColumn(1, 'Changeset') |
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
471 self.revlist.SetColumnWidth(0, -1) |
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
472 self.revlist.SetColumnWidth(1, -1) |
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
473 self.revlist.Refresh() |
78
57887ab0df51
Finishing up Controls GUI. Update Manager's GUI will see refinement later on. Getting ready to add revision controls.
sirebral
parents:
75
diff
changeset
|
474 self.revlistcp.Add(self.revlist, (0,0), flag=wx.EXPAND) |
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
|
475 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
|
476 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
|
477 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
|
478 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
|
479 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
|
480 |
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 ## 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
|
482 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
|
483 self.cp = wx.GridBagSizer(hgap=1, vgap=1) |
81
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
484 self.buttons['update'] = wx.Button(cp, wx.ID_ANY, "Revision Update") |
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
|
485 self.buttons['delete'] = wx.Button(cp, wx.ID_ANY, "Delete Branch") |
135 | 486 self.cp.Add(self.buttons['update'], (0,0)) |
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
|
487 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
|
488 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
|
489 cp.SetAutoLayout(True) |
135 | 490 |
78
57887ab0df51
Finishing up Controls GUI. Update Manager's GUI will see refinement later on. Getting ready to add revision controls.
sirebral
parents:
75
diff
changeset
|
491 self.sizer.Add(changelogcp, (0,0), span=(3,1), flag=wx.EXPAND) |
57887ab0df51
Finishing up Controls GUI. Update Manager's GUI will see refinement later on. Getting ready to add revision controls.
sirebral
parents:
75
diff
changeset
|
492 self.sizer.Add(branchcp, (0,1), span=(1,1)) |
57887ab0df51
Finishing up Controls GUI. Update Manager's GUI will see refinement later on. Getting ready to add revision controls.
sirebral
parents:
75
diff
changeset
|
493 self.sizer.Add(revlistcp, (2,1), span=(1,1), flag=wx.EXPAND) |
135 | 494 self.sizer.Add(cp, (1,1), span=(1,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
|
495 |
135 | 496 self.buttons['delete'].Disable() |
78
57887ab0df51
Finishing up Controls GUI. Update Manager's GUI will see refinement later on. Getting ready to add revision controls.
sirebral
parents:
75
diff
changeset
|
497 self.sizer.AddGrowableCol(0) |
135 | 498 self.sizer.AddGrowableCol(1) |
499 self.sizer.AddGrowableRow(2) | |
500 self.SetSizer(self.sizer) | |
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
|
501 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
|
502 |
81
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
503 self.currev = self.repo.changelog.rev(self.repo.branchtags()[self.current]) |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
504 self.RevInfo(self.currev) |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
505 self.revlist.Select(self.revlist.FindItem(0, str(self.currev), 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
|
506 self.BranchInfo(self.current) |
80
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
507 self.Bind(wx.EVT_CHOICE, self.PackageSet) |
81
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
508 self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.RevSet) |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
509 self.Bind(wx.EVT_BUTTON, self.RevUpdate, self.buttons['update']) |
135 | 510 |
511 | |
80
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
512 def PackageSet(self, event): |
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
513 self.current = self.branches.GetStringSelection() |
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
514 branches = self.repo.branchtags() |
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
515 heads = dict.fromkeys(self.repo.heads(), 1) |
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
516 l = [((n in heads), self.repo.changelog.rev(n), n, t) for t, n in branches.items()] |
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
517 if self.current != type: |
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
518 heads = dict.fromkeys(self.repo.heads(), self.repo.branchtags()) |
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
519 branches = dict.copy(self.repo.branchtags()) |
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
520 self.BranchInfo(self.current) |
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
521 self.RevInfo(self.current) |
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
522 |
81
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
523 def RevSet(self, event): |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
524 self.currev = self.revlist.GetItemText( self.revlist.GetFirstSelected() ) |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
525 i = event.GetIndex() |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
526 self.revlist.Select(i, True) |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
527 self.revlist.Focus(i) |
83 | 528 self.BranchInfo(self.current) |
81
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
529 if self.currev != self.revlist.GetItemText( self.revlist.GetFirstSelected() ): |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
530 self.RevInfo(self.currev) |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
531 |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
532 def RevInfo(self, rev): |
80
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
533 self.revlist.DeleteAllItems() |
81
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
534 self.revlist_a = []; self.revlist_b = {} |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
535 for heads in self.repo.changelog.reachable(self.repo.branchtags()[self.current]): |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
536 self.revlist_a.append(str(self.repo.changelog.rev(heads))) |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
537 self.revlist_b[str(self.repo.changelog.rev(heads))] = str(self.repo.changectx(heads)) |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
538 self.revlist_a.sort() |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
539 for i in self.revlist_a: |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
540 self.revlist.InsertStringItem(0, str(i), 0 ) |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
541 self.revlist.SetStringItem(0, 1, self.revlist_b[i]) |
80
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
542 self.revlist.SetColumnWidth(0, -1) |
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
543 self.revlist.SetColumnWidth(1, -1) |
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
544 self.revlist.Refresh() |
81
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
545 self.BranchInfo(self.current) |
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
|
546 |
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
|
547 def BranchInfo(self, branch): |
81
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
548 rs = self.repo.changectx( self.currev ).changeset() |
78
57887ab0df51
Finishing up Controls GUI. Update Manager's GUI will see refinement later on. Getting ready to add revision controls.
sirebral
parents:
75
diff
changeset
|
549 self.changelog.SetValue('') |
80
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
550 changelog = rs[4] |
78
57887ab0df51
Finishing up Controls GUI. Update Manager's GUI will see refinement later on. Getting ready to add revision controls.
sirebral
parents:
75
diff
changeset
|
551 self.changelog.AppendText(changelog + '\n') |
57887ab0df51
Finishing up Controls GUI. Update Manager's GUI will see refinement later on. Getting ready to add revision controls.
sirebral
parents:
75
diff
changeset
|
552 self.filelist.SetValue('') |
80
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
553 self.filelist.AppendText("Currently selected branch: " + branch + "\n\nAuthor: "+rs[1]+"\n\n") |
78
57887ab0df51
Finishing up Controls GUI. Update Manager's GUI will see refinement later on. Getting ready to add revision controls.
sirebral
parents:
75
diff
changeset
|
554 self.filelist.AppendText("Files Modified (in update): \n") |
80
51bb772c3609
Update Manager nearly 100% complete. Buttons on Controls panel need to be implmented. Users can now look over the revisions for each branch / revision.
sirebral
parents:
78
diff
changeset
|
555 for f in rs[3]: self.filelist.AppendText(f+"\n") |
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
|
556 |
81
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
557 def DelBranch(self, event): |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
558 pass |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
559 |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
560 def RevUpdate(self, event): |
92 | 561 dlg = wx.MessageDialog(None, 'Revision Updates are recommended for Developers only.\n\nAre you sure to preform a Revision Update?\n\nNewer builds tend to have less bugs while older revisions may no longer function properly.', 'Expert Feature', wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION) |
562 if dlg.ShowModal() == wx.ID_YES: | |
563 dlg.Destroy() | |
564 filename = 'ignorelist.txt' | |
565 self.filename = dir_struct["home"] + 'upmana' + os.sep + filename | |
566 component.get('validate').config_file(filename, "default_ignorelist.txt") | |
567 self.mana = self.LoadDoc() | |
568 temp = dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep | |
569 for ignore in self.ignorelist: | |
570 shutil.copy(ignore, temp + ignore.split('/')[len(ignore.split('/')) - 1]) | |
571 hg.clean(self.repo, self.currev) | |
572 for ignore in self.ignorelist: | |
573 shutil.copyfile(temp + ignore.split('/')[len(ignore.split('/')) - 1], ignore) | |
574 os.remove(temp + ignore.split('/')[len(ignore.split('/')) - 1]) | |
575 else: | |
576 dlg.Destroy(); pass | |
81
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
577 |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
578 def LoadDoc(self): |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
579 ignore = open(self.filename) |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
580 self.ignorelist = [] |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
581 for i in ignore: self.ignorelist.append(str(i [:len(i)-1])) |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
582 manifest = ignore.readlines() |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
583 ignore.close() |
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
584 |
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
|
585 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
|
586 #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
|
587 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
|
588 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
|
589 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
|
590 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
|
591 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
|
592 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
|
593 for ishead, r, n, t in l: self.package_list.append(t) |
135 | 594 |
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
|
595 def get_package(self): |
135 | 596 self.get_packages() |
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
|
597 if self.package_list == None: return None |
135 | 598 return None |
599 | |
600 class updaterFrame(wx.Frame): | |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
601 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
|
602 |
135 | 603 wx.Frame.__init__(self, None, wx.ID_ANY, title, size=(600,500), style=wx.DEFAULT_FRAME_STYLE) |
604 if wx.Platform == '__WXMSW__': icon = wx.Icon(dir_struct["icon"]+'d20.ico', wx.BITMAP_TYPE_ICO) | |
66 | 605 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
|
606 |
60
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
607 self.SetIcon(icon) |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
608 self.main = main |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
609 ####### Panel Stuff ###### |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
610 p = wx.Panel(self) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
611 nb = wx.Notebook(p) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
612 |
135 | 613 global statbar |
614 statbar = self.CreateStatusBar() | |
615 self.Centre() | |
616 | |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
617 # create the page windows as children of the notebook |
135 | 618 page1 = Updater(nb, openrpg) |
619 page2 = Repos(nb, openrpg) | |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
620 page3 = Manifest(nb) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
621 page4 = Control(nb) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
622 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
623 # 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
|
624 nb.AddPage(page1, "Updater") |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
625 nb.AddPage(page2, "Repos") |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
626 nb.AddPage(page3, "Manifest") |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
627 nb.AddPage(page4, "Control") |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
628 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
629 # 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
|
630 # the layout |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
631 sizer = wx.BoxSizer() |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
632 sizer.Add(nb, 1, wx.EXPAND) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
633 p.SetSizer(sizer) |
135 | 634 p.Layout() |
635 self.Refresh() | |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
636 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
|
637 |
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
638 def OnClose(self, event): |
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
639 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
|
640 if self.main == True: self.Hide() |
135 | 641 |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
642 class updateApp(wx.App): |
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
643 def OnInit(self): |
135 | 644 self.main = False |
645 sys.stdout = Term2Win() | |
646 logger._set_log_to_console(False) | |
647 logger.note("Updater Start") | |
648 component.add('validate', validate) | |
142 | 649 self.updater = updaterFrame(self, "OpenRPG Update Manager 0.9 (final beta)", |
135 | 650 component, manifest, self.main) |
651 if 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
|
652 self.AutoUpdate(); self.OnExit() |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
653 else: pass |
135 | 654 if 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
|
655 self.OnExit() |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
656 else: pass |
135 | 657 try: |
658 self.updater.Show() | |
659 self.updater.Fit() | |
660 except: pass | |
47
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
661 return True |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
662 |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
663 def AutoUpdate(self): |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
664 self.ui = ui.ui() |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
665 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
|
666 self.c = self.repo.changectx('tip') |
51
14d4270d5e5d
Fixed Auto Update not finding current branch, no pull associated yet!
sirebral
parents:
49
diff
changeset
|
667 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
|
668 |
135 | 669 capture = manifest.GetString('updaterepo', 'default', '') |
54
5d89a6eaf492
WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents:
52
diff
changeset
|
670 if capture != '': |
5d89a6eaf492
WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents:
52
diff
changeset
|
671 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
|
672 filename = 'ignorelist.txt' |
66 | 673 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
|
674 component.get('validate').config_file(filename, "default_ignorelist.txt") |
54
5d89a6eaf492
WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents:
52
diff
changeset
|
675 self.mana = self.LoadDoc() |
74 | 676 temp = dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep |
57
9014d7861bb3
Removed some extra print messages from the server. Cleaned up the Manifest
sirebral
parents:
55
diff
changeset
|
677 for ignore in self.ignorelist: |
74 | 678 shutil.copy(ignore, temp + 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
|
679 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
|
680 for ignore in self.ignorelist: |
74 | 681 shutil.copyfile(temp + ignore.split('/')[len(ignore.split('/')) - 1], ignore) |
682 os.remove(temp + ignore.split('/')[len(ignore.split('/')) - 1]) | |
81
65c212e9a5b4
Controls panel is completed. Users cannot delete branches nicely without a Merc upgrade, so that feature will appear in Pious Paladin. Crash report is being tested on windows.
sirebral
parents:
80
diff
changeset
|
683 else: wx.MessageBox('No default Rpository set. Skipping Auto Update!', 'Info') |
47
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
684 |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
685 def LoadDoc(self): |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
686 ignore = open(self.filename) |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
687 self.ignorelist = [] |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
688 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
|
689 manifest = ignore.readlines() |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
690 ignore.close() |
135 | 691 |
46
599f727e3833
Getting ready to test!! Main functions seem to be working.
sirebral
parents:
45
diff
changeset
|
692 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
|
693 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
|
694 '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
|
695 'orpg.dirpath', 'upmana.validate', 'mercurial.ui', 'mercurial.hg', |
135 | 696 'mercurial.commands', 'mercurial.repo', 'mercurial.revlog', 'mercurial.cmdutil', 'shutil'] |
697 for name in imported: | |
47
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
698 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
|
699 |
47
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
700 try: self.updater.Destroy() |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
701 except: pass |