Mercurial > traipse_dev
annotate upmana/updatemana.py @ 183:0d9b746b5751 beta
Traipse Beta 'OpenRPG' {100115-00}
Traipse is a distribution of OpenRPG that is designed to be easy to
setup and go. Traipse also makes it easy for developers to work on code
without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy'
and adds fixes to the code. 'Ornery-Orc's main goal is to offer more
advanced features and enhance the productivity of the user.
Update Summary (Beta)
New Features:
Added Bookmarks
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
New TrueDebug Class in orpg_log (See documentation for usage)
Portable Mercurial
Tip of the Day added, from Core and community
New Reference Syntax added for custom PC sheets
New Child Reference for gametree
New Parent Reference for gametree
New Gametree Recursion method, mapping, context sensitivity, and
effeciency..
New Features node with bonus nodes and Node Referencing help added
Dieroller structure from Core
New DieRoller portability for odd Dice
Added 7th Sea die roller; ie [7k3] = [7d10.takeHighest(3).open(10)]
New 'Mythos' System die roller added
Added new vs. die roller method for WoD; ie [3v3] = [3d10.vs(3)].
Included for Mythos roller also
New Warhammer FRPG Die Roller (Special thanks to Puu-san for the
support)
New EZ_Tree Reference system. Push a button, Traipse the tree, get a
reference (Beta!)
Fixes:
Fix to Text based Server
Fix to Remote Admin Commands
Fix to Pretty Print, from Core
Fix to Splitter Nodes not being created
Fix to massive amounts of images loading, from Core
Fix to Map from gametree not showing to all clients
Fix to gametree about menus
Fix to Password Manager check on startup
Fix to PC Sheets from tool nodes. They now use the tabber_panel
Fix to Whiteboard ID to prevent random line or text deleting.
Fixes to Server, Remote Server, and Server GUI
Fix to Update Manager; cleaner clode for saved repositories
Fixes made to Settings Panel and now reactive settings when Ok is
pressed
Fixes to Alternity roller's attack roll. Uses a simple Tuple instead of
a Splice
Fix to Use panel of Forms and Tabbers. Now longer enters design mode
Fix made Image Fetching. New fetching image and new failed image
Modified ID's to prevent non updated clients from ruining the fix.
default_manifest.xml renamed to default_upmana.xml
author | sirebral |
---|---|
date | Fri, 15 Jan 2010 23:01:42 -0600 |
parents | 6c5f46a5924b |
children | dcae32e219f1 |
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 |
135 | 8 from upmana.validate import validate |
9 from orpg.dirpath import dir_struct | |
61 | 10 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
|
11 |
135 | 12 class Term2Win(object): |
13 # A stdout redirector. Allows the messages from Mercurial to be seen in the Install Window | |
14 def write(self, text): | |
15 statbar.SetStatusText(text) | |
16 wx.Yield() | |
150 | 17 sys.__stdout__.write(text) |
46
599f727e3833
Getting ready to test!! Main functions seem to be working.
sirebral
parents:
45
diff
changeset
|
18 |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
19 class Updater(wx.Panel): |
135 | 20 def __init__(self, parent, component): |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
21 wx.Panel.__init__(self, parent) |
135 | 22 ### Status Bar ### |
23 #statbar.SetStatusText('Select a Package and Update') | |
24 statbar.SetStatusText('New Status Bar') | |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
25 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
26 ### Update Manager |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
27 self.ui = ui.ui() |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
28 self.repo = hg.repository(self.ui, ".") |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
29 self.c = self.repo.changectx('tip') |
75 | 30 self.parent = parent |
135 | 31 self.SetBackgroundColour(wx.WHITE) |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
32 self.sizer = wx.GridBagSizer(hgap=1, vgap=1) |
135 | 33 self.changelog = wx.TextCtrl(self, wx.ID_ANY, size=(300, -1), |
34 style=wx.TE_MULTILINE | wx.TE_READONLY) | |
35 self.filelist = wx.TextCtrl(self, wx.ID_ANY, size=(275, 300), | |
36 style=wx.TE_MULTILINE | wx.TE_READONLY) | |
37 self.buttons = {} | |
38 self.buttons['progress_bar'] = wx.Gauge(self, wx.ID_ANY, 100) | |
39 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
|
40 self.buttons['auto_check'] = wx.CheckBox(self, wx.ID_ANY) |
135 | 41 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
|
42 self.buttons['no_check'] = wx.CheckBox(self, wx.ID_ANY) |
135 | 43 self.buttons['advanced'] = wx.Button(self, wx.ID_ANY, "Package Select") |
44 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
|
45 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
|
46 |
135 | 47 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
|
48 self.sizer.Add(self.filelist, (0,1), span=(1,3), flag=wx.EXPAND) |
135 | 49 |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
50 self.sizer.Add(self.buttons['progress_bar'], (1,1), span=(1,3), flag=wx.EXPAND) |
135 | 51 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
|
52 self.sizer.Add(self.buttons['auto_check'], (2,2), flag=wx.EXPAND) |
135 | 53 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
|
54 self.sizer.Add(self.buttons['no_check'], (3,2), flag=wx.EXPAND) |
135 | 55 self.sizer.Add(self.buttons['advanced'], (2,3), flag=wx.EXPAND) |
56 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
|
57 self.sizer.Add(self.buttons['finish'], (4,3), flag=wx.EXPAND) |
183 | 58 #self.buttons['finish'].Disable() |
135 | 59 self.sizer.AddGrowableCol(0) |
60 self.sizer.AddGrowableRow(0) | |
61 self.SetSizer(self.sizer) | |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
62 self.SetAutoLayout(True) |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
63 self.get_package |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
64 |
48
0aeee1992423
This updates fixes three things. Branch names are now current to your udpate
sirebral
parents:
47
diff
changeset
|
65 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
|
66 self.BranchInfo(self.current) |
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
67 |
135 | 68 if manifest.GetString("updatemana", "no_update", "") == 'on': self.buttons['no_check'].SetValue(True) |
69 else: self.buttons['no_check'].SetValue(False) | |
70 if manifest.GetString("updatemana", "auto_update", "") == 'on': self.buttons['auto_check'].SetValue(True) | |
71 else: self.buttons['auto_check'].SetValue(False) | |
72 | |
73 ## Event Handlers | |
74 self.Bind(wx.EVT_BUTTON, self.Update, self.buttons['update']) | |
75 self.Bind(wx.EVT_BUTTON, self.Finish, self.buttons['finish']) | |
76 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
|
77 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
|
78 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
|
79 |
135 | 80 def ToggleAutoUpdate(self, event): |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
81 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
|
82 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
|
83 self.buttons['no_check'].SetValue(False) |
135 | 84 manifest.SetString("updatemana", "no_update", "off") |
85 manifest.SetString("updatemana", "auto_update", "on") | |
86 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
|
87 |
135 | 88 def ToggleNoUpdate(self, event): |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
89 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
|
90 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
|
91 self.buttons['auto_check'].SetValue(False) |
135 | 92 manifest.SetString("updatemana", "auto_update", "off") |
93 manifest.SetString("updatemana", "no_update", "on") | |
94 else: manifest.SetString("updatemana", "no_update", "off") | |
95 | |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
96 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
|
97 self.ui = ui.ui() |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
98 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
|
99 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
|
100 filename = 'ignorelist.txt' |
66 | 101 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
|
102 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
|
103 self.mana = self.LoadDoc() |
74 | 104 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
|
105 for ignore in self.ignorelist: |
150 | 106 if len(ignore.split('/')) > 1: |
107 gets = 0; dir1 = '' | |
108 while gets != len(ignore.split('/'))-1: | |
109 dir1 += ignore.split('/')[gets] + os.sep | |
110 gets += 1 | |
111 os.makedirs(temp+dir1) | |
112 shutil.copy(ignore, temp + dir1 + 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
|
113 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
|
114 for ignore in self.ignorelist: |
74 | 115 shutil.copyfile(temp + ignore.split('/')[len(ignore.split('/')) - 1], ignore) |
116 os.remove(temp + ignore.split('/')[len(ignore.split('/')) - 1]) | |
150 | 117 if len(ignore.split('/')) > 1: |
118 gets = 0; dir1 = '' | |
119 while gets != len(ignore.split('/'))-1: | |
120 dir1 += ignore.split('/')[gets] + os.sep | |
121 gets += 1 | |
122 os.removedirs(temp+dir1) | |
47
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
123 |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
124 def LoadDoc(self): |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
125 ignore = open(self.filename) |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
126 self.ignorelist = [] |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
127 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
|
128 manifest = ignore.readlines() |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
129 ignore.close() |
135 | 130 |
131 def Finish(self, evt=None): | |
183 | 132 try: component.get('upmana-win').OnClose(None) |
133 except Exception, e: | |
134 print 'Fail', e; exit() | |
135 | 135 |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
136 def ChooseBranch(self, evt=None): |
135 | 137 dlg = wx.Dialog(self, wx.ID_ANY, "Package Selector", style=wx.DEFAULT_DIALOG_STYLE) |
138 if wx.Platform == '__WXMSW__': icon = wx.Icon(dir_struct["icon"]+'d20.ico', wx.BITMAP_TYPE_ICO) | |
139 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
|
140 dlg.SetIcon(icon) |
0aeee1992423
This updates fixes three things. Branch names are now current to your udpate
sirebral
parents:
47
diff
changeset
|
141 |
0aeee1992423
This updates fixes three things. Branch names are now current to your udpate
sirebral
parents:
47
diff
changeset
|
142 self.ui = ui.ui() |
0aeee1992423
This updates fixes three things. Branch names are now current to your udpate
sirebral
parents:
47
diff
changeset
|
143 self.repo = hg.repository(self.ui, ".") |
135 | 144 self.c = self.repo.changectx('tip') |
145 | |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
146 dlgsizer = wx.GridBagSizer(hgap=1, vgap=1) |
135 | 147 Yes = wx.Button( dlg, wx.ID_OK, "Ok" ) |
148 Yes.SetDefault() | |
149 rgroup = wx.RadioButton(dlg, wx.ID_ANY, "group_start", style=wx.RB_GROUP) | |
150 rgroup.Hide() | |
151 | |
37
cd8f740a8ffc
Whoops! Broke the Package Selecter. Now fixed!! Does anyone evene read these?
sirebral
parents:
36
diff
changeset
|
152 self.get_packages() |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
153 if self.package_list == None: return |
135 | 154 types = self.package_list |
155 row=0; col=0 | |
48
0aeee1992423
This updates fixes three things. Branch names are now current to your udpate
sirebral
parents:
47
diff
changeset
|
156 self.current = self.repo.dirstate.branch() |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
157 self.package_type = self.current |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
158 self.btnlist = {}; self.btn = {} |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
159 self.id = 1 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
160 |
135 | 161 for t in types: |
162 self.btnName = str(t) | |
163 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
|
164 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
|
165 self.btnlist[self.id] = self.btnName |
135 | 166 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
|
167 col += 1; self.id += 1 |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
168 if col == 3: row += 1; col = 0 |
135 | 169 |
47
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
170 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
|
171 dlgsizer.AddGrowableCol(0) |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
172 dlgsizer.AddGrowableRow(0) |
135 | 173 dlg.SetAutoLayout( True ) |
47
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
174 dlg.SetSizer( dlgsizer ) |
135 | 175 dlgsizer.Fit( dlg ) |
176 dlg.Centre() | |
177 dlg.Bind(wx.EVT_RADIOBUTTON, self.PackageSet) | |
178 if dlg.ShowModal(): dlg.Destroy() | |
179 | |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
180 def PackageSet(self, event): |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
181 for btn in self.btn: |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
182 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
|
183 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
184 branches = self.repo.branchtags() |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
185 heads = dict.fromkeys(self.repo.heads(), 1) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
186 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
|
187 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
188 if self.current != type: |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
189 heads = dict.fromkeys(self.repo.heads(), self.repo.branchtags()) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
190 branches = dict.copy(self.repo.branchtags()) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
191 self.BranchInfo(self.current) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
192 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
193 def BranchInfo(self, branch): |
61 | 194 cs = self.repo.changectx( self.current ).changeset() |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
195 self.changelog.SetValue('') |
61 | 196 changelog = cs[4] |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
197 self.changelog.AppendText(changelog + '\n') |
61 | 198 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
|
199 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
|
200 self.filelist.AppendText("Files Modified (in update): \n") |
62 | 201 for f in cs[3]: self.filelist.AppendText(f+"\n") |
135 | 202 |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
203 def get_packages(self, type=None): |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
204 #Fixed and ready for Test. Can be cleaner |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
205 self.package_list = [] |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
206 b = self.repo.branchtags() |
62 | 207 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
|
208 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
|
209 l.sort() |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
210 l.reverse() |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
211 for ishead, r, n, t in l: self.package_list.append(t) |
135 | 212 |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
213 def get_package(self): |
135 | 214 self.get_packages() |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
215 if self.package_list == None: return None |
135 | 216 return None |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
217 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
218 class Repos(wx.Panel): |
135 | 219 def __init__(self, parent, openrpg): |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
220 wx.Panel.__init__(self, parent) |
135 | 221 ### Status Bar ### |
222 #statbar.SetStatusText('Add, Delete, or Refresh your source Tracs') | |
223 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
|
224 ### Update Manager |
81254b3935fb
Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents:
41
diff
changeset
|
225 self.ui = ui.ui() |
81254b3935fb
Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents:
41
diff
changeset
|
226 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
|
227 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
|
228 |
48
0aeee1992423
This updates fixes three things. Branch names are now current to your udpate
sirebral
parents:
47
diff
changeset
|
229 #mainpanel = self |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
230 self.openrpg = openrpg |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
231 self.buttons = {} |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
232 self.texts = {} |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
233 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
234 ## Section Sizers (with frame edges and text captions) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
235 self.box_sizers = {} |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
236 self.box_sizers["newbutton"] = wx.StaticBox(self, -1) |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
237 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
238 ## Layout Sizers |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
239 self.sizers = {} |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
240 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
|
241 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
|
242 |
36
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
243 #Button Layout |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
244 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
|
245 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
|
246 empty = wx.StaticText(self, -1, "") |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
247 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
|
248 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
|
249 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
|
250 |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
251 ##Build Button |
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
252 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
|
253 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
|
254 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
|
255 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
|
256 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
|
257 self.sizers["newbutton"].Add(self.sizers["newrepo_layout"], -1, wx.EXPAND) |
62 | 258 |
40
95db4430caed
If you have nothing in the list, New button works now. Adds duplicates though
sirebral
parents:
39
diff
changeset
|
259 #Repo List Panel |
36
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
260 self.repopanel = wx.ScrolledWindow(self) |
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
261 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
|
262 self.repopanel.Scroll(50,10) |
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
263 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
|
264 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
|
265 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
|
266 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
|
267 |
44
15a76be834dc
Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents:
43
diff
changeset
|
268 self.NewRepoList(None) |
39
93a27aea09ce
Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents:
38
diff
changeset
|
269 self.BuildRepoList(None) |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
270 |
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
271 self.sizers["repolist_layout"].AddGrowableCol(0) |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
272 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
|
273 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
|
274 self.sizers["repo"].AddGrowableCol(0) |
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
275 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
|
276 self.sizers['repo'].AddGrowableRow(1) |
36
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
277 self.repopanel.SetSizer(self.sizers['repo']) |
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
278 self.repopanel.SetAutoLayout(True) |
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
279 |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
280 #Build Main Sizer |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
281 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
|
282 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
|
283 self.sizers["main"].AddGrowableCol(0) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
284 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
|
285 self.sizers["main"].AddGrowableRow(1) |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
286 self.SetSizer(self.sizers["main"]) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
287 self.SetAutoLayout(True) |
135 | 288 #self.Fit() |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
289 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
|
290 |
44
15a76be834dc
Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents:
43
diff
changeset
|
291 def NewRepoList(self, event): |
135 | 292 self.id = -1 |
293 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
|
294 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
|
295 self.defaultcheck = {}; self.default = {}; self.repotrac = {} |
135 | 296 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
|
297 |
39
93a27aea09ce
Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents:
38
diff
changeset
|
298 def BuildRepoList(self, event): |
135 | 299 repolist = manifest.PluginChildren('updaterepo') |
300 appendlist = [] | |
301 for repo in repolist: | |
302 if repo not in self.repolist: appendlist.append(repo) | |
303 self.repolist = repolist | |
39
93a27aea09ce
Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents:
38
diff
changeset
|
304 |
135 | 305 for repo in appendlist: |
39
93a27aea09ce
Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents:
38
diff
changeset
|
306 self.id += 1 |
42
81254b3935fb
Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents:
41
diff
changeset
|
307 #Build Constructs |
39
93a27aea09ce
Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents:
38
diff
changeset
|
308 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
|
309 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
|
310 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
|
311 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
|
312 self.name[self.id] = wx.StaticText(self.repopanel, -1, 'URL') |
135 | 313 self.uri[self.id] = manifest.GetString('updaterepo', repo, '') |
314 #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
|
315 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
|
316 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
|
317 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
|
318 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
|
319 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
|
320 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
|
321 #Build Retraceables |
81254b3935fb
Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents:
41
diff
changeset
|
322 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
|
323 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
|
324 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
|
325 #Build Layout |
135 | 326 self.layout[self.id].Add(self.name[self.id], |
327 -1, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL) | |
328 self.layout[self.id].Add(self.url[self.id], | |
329 -1, wx.EXPAND) | |
330 self.layout[self.id].Add(self.pull[self.id], | |
331 -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
|
332 self.layout[self.id].Add(self.delete[self.id], -1, wx.EXPAND) |
135 | 333 self.layout[self.id].Add(self.defaultcheck[self.id], |
334 -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
|
335 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
|
336 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
|
337 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
|
338 #Button Events |
39
93a27aea09ce
Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents:
38
diff
changeset
|
339 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
|
340 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
|
341 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
|
342 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
|
343 self.sizers['repolist_layout'].Layout() |
135 | 344 self.Layout() |
39
93a27aea09ce
Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents:
38
diff
changeset
|
345 |
52
c9694d854a61
Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents:
51
diff
changeset
|
346 #Set Default Repo Button |
135 | 347 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
|
348 if capture != '': |
5d89a6eaf492
WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents:
52
diff
changeset
|
349 for caught in self.uri: |
5d89a6eaf492
WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents:
52
diff
changeset
|
350 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
|
351 else: continue |
5d89a6eaf492
WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents:
52
diff
changeset
|
352 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
|
353 |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
354 def AddRepo(self, event): |
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
355 repo = self.texts['reponame'].GetValue(); repo = repo.replace(' ', '_'); repo = 'repo-' + repo |
142 | 356 manifest.SetString('updaterepo', repo, '') |
39
93a27aea09ce
Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents:
38
diff
changeset
|
357 self.BuildRepoList(None) |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
358 |
43
f00b02fbf511
Delete works, GUI updates wrong. Refresh now Force pulls.
sirebral
parents:
42
diff
changeset
|
359 def DelRepo(self, event): |
f00b02fbf511
Delete works, GUI updates wrong. Refresh now Force pulls.
sirebral
parents:
42
diff
changeset
|
360 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
|
361 self.sizers["repolist_layout"].Hide(self.container[self.id]) |
135 | 362 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
|
363 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
|
364 except: pass |
43
f00b02fbf511
Delete works, GUI updates wrong. Refresh now Force pulls.
sirebral
parents:
42
diff
changeset
|
365 self.sizers['repolist_layout'].Layout() |
135 | 366 self.repolist = manifest.PluginChildren('updaterepo') |
43
f00b02fbf511
Delete works, GUI updates wrong. Refresh now Force pulls.
sirebral
parents:
42
diff
changeset
|
367 |
36
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
368 def RefreshRepo(self, event): |
42
81254b3935fb
Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents:
41
diff
changeset
|
369 self.id = self.pull_list[event.GetEventObject()] |
135 | 370 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
|
371 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
|
372 except: pass |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
373 |
52
c9694d854a61
Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents:
51
diff
changeset
|
374 def SetDefault(self, event): |
c9694d854a61
Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents:
51
diff
changeset
|
375 self.id = self.defchecklist[event.GetEventObject()] |
135 | 376 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
|
377 for all in self.defaultcheck: |
c9694d854a61
Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents:
51
diff
changeset
|
378 self.defaultcheck[all].SetValue(False) |
c9694d854a61
Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents:
51
diff
changeset
|
379 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
|
380 |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
381 class Manifest(wx.Panel): |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
382 def __init__(self, parent): |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
383 wx.Panel.__init__(self, parent) |
135 | 384 ### Status Bar ### |
385 #statbar.SetStatusText('Create an Ignore List') | |
386 statbar.SetStatusText('New Status Bar') | |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
387 self.ui = ui.ui() |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
388 self.repo = hg.repository(self.ui, ".") |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
389 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
|
390 self.manifestlist = [] |
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
391 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
|
392 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
|
393 self.manifestlist.sort() |
135 | 394 self.SetBackgroundColour(wx.WHITE) |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
395 self.sizer = wx.GridBagSizer(hgap=1, vgap=1) |
74 | 396 self.manifestlog = wx.CheckListBox( self, -1, wx.DefaultPosition, wx.DefaultSize, |
397 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
|
398 filename = 'ignorelist.txt' |
66 | 399 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
|
400 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
|
401 self.mana = self.LoadDoc() |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
402 self.manifestlog.Bind(wx.EVT_CHECKLISTBOX, self.GetChecked) |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
403 self.sizer.Add(self.manifestlog, (0,0), flag=wx.EXPAND) |
135 | 404 self.sizer.AddGrowableCol(0) |
36
683536732926
Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents:
35
diff
changeset
|
405 self.sizer.AddGrowableRow(0) |
135 | 406 self.SetSizer(self.sizer) |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
407 self.SetAutoLayout(True) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
408 |
45
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
409 def GetChecked(self, event): |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
410 self.mana = [] |
47
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
411 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
|
412 self.SaveDoc() |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
413 |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
414 def SaveDoc(self): |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
415 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
|
416 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
|
417 f.close() |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
418 |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
419 def LoadDoc(self): |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
420 ignore = open(self.filename) |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
421 ignorelist = [] |
47
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
422 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
|
423 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
|
424 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
|
425 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
|
426 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
|
427 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
|
428 self.manifestlog.SetCheckedStrings(ignorelist) |
47
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
429 manifest = ignore.readlines() |
45
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
430 ignore.close() |
50e82d8090cf
A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents:
44
diff
changeset
|
431 |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
432 class Control(wx.Panel): |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
433 def __init__(self, parent): |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
434 wx.Panel.__init__(self, parent) |
135 | 435 ### Status Bar ### |
436 #statbar.SetStatusText('Advanced Controls & Rollback') | |
437 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
|
438 ### 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
|
439 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
|
440 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
|
441 self.c = self.repo.changectx('tip') |
135 | 442 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
|
443 #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
|
444 |
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.get_packages() |
135 | 446 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
|
447 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
|
448 self.buttons = {} |
135 | 449 |
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
|
450 ## 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
|
451 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
|
452 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
|
453 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
|
454 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
|
455 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
|
456 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
|
457 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
|
458 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
|
459 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
|
460 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
|
461 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
|
462 |
52a5fa913008
Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents:
66
diff
changeset
|
463 ## 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
|
464 branchcp = wx.Panel(self) |
92 | 465 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
|
466 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
|
467 self.branches = wx.Choice(branchcp, wx.ID_ANY, choices=self.package_list) |
92 | 468 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
|
469 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
|
470 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
|
471 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
|
472 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
|
473 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
|
474 |
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 = 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
|
476 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
|
477 self.revlist = wx.ListCtrl(revlistcp, -1, wx.DefaultPosition, size=wx.DefaultSize, |
74 | 478 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
|
479 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
|
480 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
|
481 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
|
482 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
|
483 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
|
484 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
|
485 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
|
486 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
|
487 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
|
488 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
|
489 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
|
490 |
52a5fa913008
Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents:
66
diff
changeset
|
491 ## 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
|
492 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
|
493 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
|
494 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
|
495 self.buttons['delete'] = wx.Button(cp, wx.ID_ANY, "Delete Branch") |
135 | 496 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
|
497 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
|
498 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
|
499 cp.SetAutoLayout(True) |
135 | 500 |
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
|
501 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
|
502 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
|
503 self.sizer.Add(revlistcp, (2,1), span=(1,1), flag=wx.EXPAND) |
135 | 504 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
|
505 |
135 | 506 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
|
507 self.sizer.AddGrowableCol(0) |
135 | 508 self.sizer.AddGrowableCol(1) |
509 self.sizer.AddGrowableRow(2) | |
510 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
|
511 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
|
512 |
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
|
513 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
|
514 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
|
515 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
|
516 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
|
517 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
|
518 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
|
519 self.Bind(wx.EVT_BUTTON, self.RevUpdate, self.buttons['update']) |
135 | 520 |
521 | |
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
|
522 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
|
523 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
|
524 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
|
525 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
|
526 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
|
527 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
|
528 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
|
529 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
|
530 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
|
531 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
|
532 |
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
|
533 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
|
534 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
|
535 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
|
536 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
|
537 self.revlist.Focus(i) |
83 | 538 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
|
539 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
|
540 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
|
541 |
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
|
542 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
|
543 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
|
544 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
|
545 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
|
546 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
|
547 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
|
548 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
|
549 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
|
550 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
|
551 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
|
552 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
|
553 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
|
554 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
|
555 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
|
556 |
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
|
557 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
|
558 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
|
559 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
|
560 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
|
561 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
|
562 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
|
563 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
|
564 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
|
565 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
|
566 |
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
|
567 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
|
568 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
|
569 |
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
|
570 def RevUpdate(self, event): |
92 | 571 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) |
572 if dlg.ShowModal() == wx.ID_YES: | |
573 dlg.Destroy() | |
574 filename = 'ignorelist.txt' | |
575 self.filename = dir_struct["home"] + 'upmana' + os.sep + filename | |
576 component.get('validate').config_file(filename, "default_ignorelist.txt") | |
577 self.mana = self.LoadDoc() | |
578 temp = dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep | |
579 for ignore in self.ignorelist: | |
580 shutil.copy(ignore, temp + ignore.split('/')[len(ignore.split('/')) - 1]) | |
581 hg.clean(self.repo, self.currev) | |
582 for ignore in self.ignorelist: | |
583 shutil.copyfile(temp + ignore.split('/')[len(ignore.split('/')) - 1], ignore) | |
584 os.remove(temp + ignore.split('/')[len(ignore.split('/')) - 1]) | |
585 else: | |
586 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
|
587 |
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
|
588 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
|
589 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
|
590 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
|
591 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
|
592 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
|
593 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
|
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_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
|
596 #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
|
597 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
|
598 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
|
599 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
|
600 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
|
601 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
|
602 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
|
603 for ishead, r, n, t in l: self.package_list.append(t) |
135 | 604 |
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
|
605 def get_package(self): |
135 | 606 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
|
607 if self.package_list == None: return None |
135 | 608 return None |
609 | |
150 | 610 class Help(wx.Panel): |
611 def __init__(self, parent): | |
612 wx.Panel.__init__(self, parent) | |
613 sizer = wx.BoxSizer(wx.VERTICAL) | |
614 self.help = wx.TextCtrl(self, wx.ID_ANY, size=(-1, -1), | |
615 style=wx.TE_MULTILINE | wx.TE_READONLY) | |
616 sizer.Add(self.help, 1, wx.EXPAND) | |
617 self.build_help() | |
618 self.SetSizer(sizer) | |
619 self.Layout() | |
620 | |
621 def build_help(self): | |
622 help = """'Traipse' OpenRPG Update Manager Help: | |
623 The Traipse Update Manager can be confusing at first glance. There is alot involved in the new addition so it is easy to by pass the finer details. This small page will help a new user understand how to use the new Update Manager to it's full capability.\n\n""" | |
624 self.help.AppendText(help) | |
625 help = """The Different Tabs: There are 5 different tabs available to users, and each tab has a different purpose. These five tabs are: Updater, Repos, Manifest, Control and Help. | |
626 --- | |
627 | |
628 The Updater Tab: | |
629 The Updater tab is divided into three sections. The left section shows a description of the your current or selected version. The right top section shows the files that have been updated in your current or selected version. Underneath is a selection of buttons and check boxes. | |
630 | |
631 Package Select: | |
632 When you press this button a small window pops up showing you the available packages to update too. You can select a package and the Updater's detail sections will reflect the change. | |
633 | |
634 Update Now: | |
635 Press this button when you want to update to the selected package | |
636 | |
637 Auto Update: | |
638 Check this if want to update when you start the software. You need to have a default Repository checked in the Repo tab. | |
639 | |
640 No Update: | |
641 Check this if you do not want to see the Update Manager when you start the software. | |
642 ---\n\n""" | |
643 self.help.AppendText(help) | |
644 help = """The Repos Tab: | |
645 The Repos tab has two parts to it. The top most part is a section is where you name and create repositories. The second part shows you a list of all your available repositories. | |
646 | |
647 What is a repostiory? | |
648 1: a place, room, or container where something is deposited or stored (Merriam-Webster). A repository, or repo for short, is a place to hold source code so others can download it. | |
649 | |
650 Creating new Repos: | |
651 Creating a new repos is really easy. First you need to give your repo a name, any name will work, then press the New button. You will see that your named repo shows up in your list immediately. | |
652 | |
653 You will then need to connect the named repo to a URL so you can download source code. Enter a URL (http://hg.assembla.com/traipse) into the new entry and press the Refresh button. This downloads the new source code to your computer only. Refreshing a repo does not update your software. | |
654 | |
655 Default: | |
656 You can set any repo as your default repository. This is the repo the software will update from if you Auto Update. | |
657 ---\n\n""" | |
658 self.help.AppendText(help) | |
659 help = """The Manifest Tab: | |
660 The Manifest Tab is really easy to understand, it's just named differently. The manifest shows a list of all the files that are being tracked by your current package. Checking files in the list will place them into a list that prevents these files from being changed when you update to a new package. | |
661 | |
662 The manifest can cause problems with compatibility if the newer source does not understand the unchanged files, so it would be smart to test out a new package in a different folder. | |
663 ---\n\n""" | |
664 self.help.AppendText(help) | |
665 help = """The Control Tab: | |
666 The control tab is recommended for developers only. The control tab contains the two details elements from the Updater tab and a new section that contains all of the revisions for your selected package. | |
667 | |
668 You can select any of the available packages from the drop down and the list of revisions will change. You can also select any of the revisions in the list and the details on the left side will change to reflect the details of that revision. | |
669 | |
670 You are also allowed to update to any of the selected revisions. Older revisions often times contain bugs and newer methods of coding, so revision updates commonly cause problems with software. | |
671 | |
672 What is the Control Tab for? | |
673 The control tab is for developers who want to see how the source code has changed from revision to revision. When a user downloads the software they also download all past revisions made to that software. This tab allows users to roll back if a problem has been created with new source, or for developers they can watch the software evolve. | |
674 ---""" | |
675 self.help.AppendText(help) | |
676 | |
135 | 677 class updaterFrame(wx.Frame): |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
678 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
|
679 |
135 | 680 wx.Frame.__init__(self, None, wx.ID_ANY, title, size=(600,500), style=wx.DEFAULT_FRAME_STYLE) |
681 if wx.Platform == '__WXMSW__': icon = wx.Icon(dir_struct["icon"]+'d20.ico', wx.BITMAP_TYPE_ICO) | |
66 | 682 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
|
683 |
60
3b2cfa13b610
Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents:
59
diff
changeset
|
684 self.SetIcon(icon) |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
685 self.main = main |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
686 ####### Panel Stuff ###### |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
687 p = wx.Panel(self) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
688 nb = wx.Notebook(p) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
689 |
135 | 690 global statbar |
691 statbar = self.CreateStatusBar() | |
692 self.Centre() | |
693 | |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
694 # create the page windows as children of the notebook |
135 | 695 page1 = Updater(nb, openrpg) |
696 page2 = Repos(nb, openrpg) | |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
697 page3 = Manifest(nb) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
698 page4 = Control(nb) |
150 | 699 page5 = Help(nb) |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
700 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
701 # 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
|
702 nb.AddPage(page1, "Updater") |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
703 nb.AddPage(page2, "Repos") |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
704 nb.AddPage(page3, "Manifest") |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
705 nb.AddPage(page4, "Control") |
150 | 706 nb.AddPage(page5, 'Help') |
33
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
707 |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
708 # 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
|
709 # the layout |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
710 sizer = wx.BoxSizer() |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
711 sizer.Add(nb, 1, wx.EXPAND) |
3687514e0218
I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff
changeset
|
712 p.SetSizer(sizer) |
135 | 713 p.Layout() |
714 self.Refresh() | |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
715 self.Bind(wx.EVT_CLOSE, self.OnClose) |
183 | 716 component.add('upmana-win', self) |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
717 |
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
718 def OnClose(self, event): |
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
719 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
|
720 if self.main == True: self.Hide() |
135 | 721 |
34
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
722 class updateApp(wx.App): |
8b630fc8a343
Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents:
33
diff
changeset
|
723 def OnInit(self): |
135 | 724 self.main = False |
725 sys.stdout = Term2Win() | |
726 logger._set_log_to_console(False) | |
727 logger.note("Updater Start") | |
728 component.add('validate', validate) | |
150 | 729 self.updater = updaterFrame(self, "OpenRPG Update Manager 1.0", |
135 | 730 component, manifest, self.main) |
731 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
|
732 self.AutoUpdate(); self.OnExit() |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
733 else: pass |
135 | 734 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
|
735 self.OnExit() |
49
b41ea7d28a9e
Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents:
48
diff
changeset
|
736 else: pass |
135 | 737 try: |
738 self.updater.Show() | |
739 self.updater.Fit() | |
740 except: pass | |
47
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
741 return True |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
742 |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
743 def AutoUpdate(self): |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
744 self.ui = ui.ui() |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
745 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
|
746 self.c = self.repo.changectx('tip') |
51
14d4270d5e5d
Fixed Auto Update not finding current branch, no pull associated yet!
sirebral
parents:
49
diff
changeset
|
747 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
|
748 |
135 | 749 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
|
750 if capture != '': |
5d89a6eaf492
WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents:
52
diff
changeset
|
751 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
|
752 filename = 'ignorelist.txt' |
66 | 753 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
|
754 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
|
755 self.mana = self.LoadDoc() |
74 | 756 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
|
757 for ignore in self.ignorelist: |
150 | 758 if len(ignore.split('/')) > 1: |
759 gets = 0; dir1 = '' | |
760 while gets != len(ignore.split('/'))-1: | |
761 dir1 += ignore.split('/')[gets] + os.sep | |
762 gets += 1 | |
763 os.makedirs(temp+dir1) | |
764 shutil.copy(ignore, temp + dir1 + 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
|
765 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
|
766 for ignore in self.ignorelist: |
74 | 767 shutil.copyfile(temp + ignore.split('/')[len(ignore.split('/')) - 1], ignore) |
768 os.remove(temp + ignore.split('/')[len(ignore.split('/')) - 1]) | |
150 | 769 if len(ignore.split('/')) > 1: |
770 gets = 0; dir1 = '' | |
771 while gets != len(ignore.split('/'))-1: | |
772 dir1 += ignore.split('/')[gets] + os.sep | |
773 gets += 1 | |
774 os.removedirs(temp+dir1) | |
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
|
775 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
|
776 |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
777 def LoadDoc(self): |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
778 ignore = open(self.filename) |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
779 self.ignorelist = [] |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
780 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
|
781 manifest = ignore.readlines() |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
782 ignore.close() |
135 | 783 |
46
599f727e3833
Getting ready to test!! Main functions seem to be working.
sirebral
parents:
45
diff
changeset
|
784 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
|
785 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
|
786 '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
|
787 'orpg.dirpath', 'upmana.validate', 'mercurial.ui', 'mercurial.hg', |
135 | 788 'mercurial.commands', 'mercurial.repo', 'mercurial.revlog', 'mercurial.cmdutil', 'shutil'] |
789 for name in imported: | |
47
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
790 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
|
791 |
47
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
792 try: self.updater.Destroy() |
52f6a38f8885
Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents:
46
diff
changeset
|
793 except: pass |