annotate upmana/updatemana.py @ 246:712df3d5b54c beta

Traipse Beta 'OpenRPG' {101130-01} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the productivity of the user. Update Summary (Closed) New Features: New to Map, can re-order Grid, Miniatures, and Whiteboard layer draw order New to Server GUI, can now clear log New Earthdawn Dieroller New IronClaw roller, sheet, and image New ShapeShifter PC Sheet Updates: Update to Warhammer PC Sheet. Rollers set as macros. Should work with little maintanence. Update to Browser Server window. Display rooms with ' " & cleaner Update to Server. Handles ' " & cleaner Update to Dieroller. Cleaner, more effecient expression system Update to Hidden Die plugin, allows for non standard dice rolls Update to location.py, allows for more portable references when starting Traipse Update to the Features node Fixes: Fix to InterParse that was causing an Infernal Loop with Namespace Internal Fix to XML data, removed old Minidom and switched to Element Tree Fix to Server that was causing eternal attempt to find a Server ID, in Register Rooms thread Fix to metaservers.xml file not being created Fix to Single and Double quotes in Whiteboard text Fix to Background images not showing when using the Image Server Fix to Duplicate chat names appearing Fix to Server GUI's logging output Fix to FNB.COLORFUL_TABS bug Fix to Gametree for XSLT Sheets Fix to Gametree for locating gametree files Fix to Send to Chat from Gametree Fix to Gametree, renaming and remapping operates correctly Fix to aliaslib, prevents error caused when SafeHTML is sent None
author sirebral
date Tue, 30 Nov 2010 03:49:02 -0600
parents 9230a33defd9
children 64728b1dfa57
rev   line source
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
1 import wx, sys, os #just .sep maybe
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
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
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
5 from orpg.orpgCore import component
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
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
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
8 from upmana.validate import validate
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
9 from orpg.dirpath import dir_struct
61
f3d8101211c4 Traipse Dev 'OpenRPG' {090813-00}
sirebral
parents: 60
diff changeset
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
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
12 class Term2Win(object):
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
13 # A stdout redirector. Allows the messages from Mercurial to be seen in the Install Window
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
14 def write(self, text):
212
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
15 self.closed = sys.__stdout__.closed
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
16 self.flush = sys.__stdout__.flush
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
17 statbar.SetStatusText(text.replace('\n', ''))
150
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
18 sys.__stdout__.write(text)
46
599f727e3833 Getting ready to test!! Main functions seem to be working.
sirebral
parents: 45
diff changeset
19
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
20 class Updater(wx.Panel):
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
21 def __init__(self, parent, component):
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
22 wx.Panel.__init__(self, parent)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
23 ### Status Bar ###
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
24 #statbar.SetStatusText('Select a Package and Update')
212
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
25 #statbar.SetStatusText('New Status Bar')
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
26
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
27 self.timer = wx.Timer(self, 1)
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
28 self.count = 0
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
29
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
30 ### Update Manager
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
31 self.ui = ui.ui()
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
32 self.repo = hg.repository(self.ui, ".")
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
33 self.c = self.repo.changectx('tip')
75
f518bc709fd1 Continuing refinement and clean-up. Nearly done.
sirebral
parents: 74
diff changeset
34 self.parent = parent
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
35 self.SetBackgroundColour(wx.WHITE)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
36 self.sizer = wx.GridBagSizer(hgap=1, vgap=1)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
37 self.changelog = wx.TextCtrl(self, wx.ID_ANY, size=(300, -1),
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
38 style=wx.TE_MULTILINE | wx.TE_READONLY)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
39 self.filelist = wx.TextCtrl(self, wx.ID_ANY, size=(275, 300),
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
40 style=wx.TE_MULTILINE | wx.TE_READONLY)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
41 self.buttons = {}
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
42 self.buttons['progress_bar'] = wx.Gauge(self, wx.ID_ANY, 100)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
43 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
44 self.buttons['auto_check'] = wx.CheckBox(self, wx.ID_ANY)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
45 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
46 self.buttons['no_check'] = wx.CheckBox(self, wx.ID_ANY)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
47 self.buttons['advanced'] = wx.Button(self, wx.ID_ANY, "Package Select")
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
48 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
49 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
50
212
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
51 self.sizer.Add(self.changelog, (0,0), span=(5,1), flag=wx.EXPAND)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
52 self.sizer.Add(self.filelist, (0,1), span=(1,3), flag=wx.EXPAND)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
53
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
54 self.sizer.Add(self.buttons['progress_bar'], (1,1), span=(1,3), flag=wx.EXPAND)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
55 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
56 self.sizer.Add(self.buttons['auto_check'], (2,2), flag=wx.EXPAND)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
57 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
58 self.sizer.Add(self.buttons['no_check'], (3,2), flag=wx.EXPAND)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
59 self.sizer.Add(self.buttons['advanced'], (2,3), flag=wx.EXPAND)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
60 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
61 self.sizer.Add(self.buttons['finish'], (4,3), flag=wx.EXPAND)
212
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
62 self.buttons['progress_bar'].SetValue(100)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
63 self.sizer.AddGrowableCol(0)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
64 self.sizer.AddGrowableRow(0)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
65 self.SetSizer(self.sizer)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
66 self.SetAutoLayout(True)
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
67 self.get_package
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
68
48
0aeee1992423 This updates fixes three things. Branch names are now current to your udpate
sirebral
parents: 47
diff changeset
69 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
70 self.BranchInfo(self.current)
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
71
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
72 if manifest.GetString("updatemana", "no_update", "") == 'on': self.buttons['no_check'].SetValue(True)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
73 else: self.buttons['no_check'].SetValue(False)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
74 if manifest.GetString("updatemana", "auto_update", "") == 'on': self.buttons['auto_check'].SetValue(True)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
75 else: self.buttons['auto_check'].SetValue(False)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
76
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
77 ## Event Handlers
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
78 self.Bind(wx.EVT_BUTTON, self.Update, self.buttons['update'])
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
79 self.Bind(wx.EVT_BUTTON, self.Finish, self.buttons['finish'])
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
80 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
81 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
82 self.Bind(wx.EVT_CHECKBOX, self.ToggleNoUpdate, self.buttons['no_check'])
212
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
83 self.Bind(wx.EVT_TIMER, self.OnTimer, self.timer)
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
84
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
85 def OnTimer(self, event):
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
86 statbar.SetStatusText('Checking For Updates')
212
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
87 self.count = self.count + 1
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
88 self.buttons['progress_bar'].SetValue(self.count)
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
89 if self.count == 100:
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
90 self.timer.Stop()
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
91 statbar.SetStatusText('No Updates Available')
212
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
92
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
93 def UpdateCheck(self):
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
94 self.timer.Start(100)
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
95 self.count = 3
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
96 self.buttons['progress_bar'].SetValue(3)
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
97 try:
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
98 doUpdate = commands.incoming(self.ui, self.repo,
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
99 manifest.GetString('default', 'repo', ''),
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
100 force=True, bundle=False)
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
101 if doUpdate:
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
102 statbar.SetStatusText('No Updates Available')
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
103 self.buttons['progress_bar'].SetValue(100)
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
104 self.timer.Stop()
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
105 else:
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
106 statbar.SetStatusText('Refresh Repo For Updated Source')
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
107 self.buttons['progress_bar'].SetValue(100)
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
108 self.timer.Stop()
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
109 except:
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
110 statbar.SetStatusText('No Connection Found')
212
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
111 self.buttons['progress_bar'].SetValue(100)
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
112 self.timer.Stop()
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
113
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
114
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
115 def ToggleAutoUpdate(self, event):
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
116 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
117 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
118 self.buttons['no_check'].SetValue(False)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
119 manifest.SetString("updatemana", "no_update", "off")
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
120 manifest.SetString("updatemana", "auto_update", "on")
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
121 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
122
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
123 def ToggleNoUpdate(self, event):
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
124 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
125 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
126 self.buttons['auto_check'].SetValue(False)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
127 manifest.SetString("updatemana", "auto_update", "off")
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
128 manifest.SetString("updatemana", "no_update", "on")
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
129 else: manifest.SetString("updatemana", "no_update", "off")
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
130
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
131 def Update(self, evt=None):
246
712df3d5b54c Traipse Beta 'OpenRPG' {101130-01}
sirebral
parents: 236
diff changeset
132 with open(sys.path[2]+os.sep+'location.py', 'rb') as f: old_location = f.read()
712df3d5b54c Traipse Beta 'OpenRPG' {101130-01}
sirebral
parents: 236
diff changeset
133 ## This new location file update allows for a more portable way to start Traipse. It's aimed at Linux users.
712df3d5b54c Traipse Beta 'OpenRPG' {101130-01}
sirebral
parents: 236
diff changeset
134 new_location = """import sys
712df3d5b54c Traipse Beta 'OpenRPG' {101130-01}
sirebral
parents: 236
diff changeset
135 import os
712df3d5b54c Traipse Beta 'OpenRPG' {101130-01}
sirebral
parents: 236
diff changeset
136
712df3d5b54c Traipse Beta 'OpenRPG' {101130-01}
sirebral
parents: 236
diff changeset
137 dyn_dir = 'System'
712df3d5b54c Traipse Beta 'OpenRPG' {101130-01}
sirebral
parents: 236
diff changeset
138 _home = sys.path[0]
712df3d5b54c Traipse Beta 'OpenRPG' {101130-01}
sirebral
parents: 236
diff changeset
139 _userbase_dir = _home + os.sep + dyn_dir
712df3d5b54c Traipse Beta 'OpenRPG' {101130-01}
sirebral
parents: 236
diff changeset
140 sys.path.append(_userbase_dir)
712df3d5b54c Traipse Beta 'OpenRPG' {101130-01}
sirebral
parents: 236
diff changeset
141 try: os.chdir(_userbase_dir)
712df3d5b54c Traipse Beta 'OpenRPG' {101130-01}
sirebral
parents: 236
diff changeset
142 except: print 'Failed to find ' + _userbase_dir + '\\nHopefuly you are running setup.py which would make this error normal.'"""
712df3d5b54c Traipse Beta 'OpenRPG' {101130-01}
sirebral
parents: 236
diff changeset
143
712df3d5b54c Traipse Beta 'OpenRPG' {101130-01}
sirebral
parents: 236
diff changeset
144 if new_location != old_location:
712df3d5b54c Traipse Beta 'OpenRPG' {101130-01}
sirebral
parents: 236
diff changeset
145 with open(sys.path[2]+os.sep+'location.py', 'w') as f: f.write(new_location)
712df3d5b54c Traipse Beta 'OpenRPG' {101130-01}
sirebral
parents: 236
diff changeset
146
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
147 self.ui = ui.ui()
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
148 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
149 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
150 filename = 'ignorelist.txt'
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 62
diff changeset
151 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
152 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
153 self.mana = self.LoadDoc()
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
154 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
155 for ignore in self.ignorelist:
150
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
156 if len(ignore.split('/')) > 1:
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
157 gets = 0; dir1 = ''
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
158 while gets != len(ignore.split('/'))-1:
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
159 dir1 += ignore.split('/')[gets] + os.sep
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
160 gets += 1
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
161 os.makedirs(temp+dir1)
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
162 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
163 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
164 for ignore in self.ignorelist:
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
165 shutil.copyfile(temp + ignore.split('/')[len(ignore.split('/')) - 1], ignore)
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
166 os.remove(temp + ignore.split('/')[len(ignore.split('/')) - 1])
150
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
167 if len(ignore.split('/')) > 1:
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
168 gets = 0; dir1 = ''
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
169 while gets != len(ignore.split('/'))-1:
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
170 dir1 += ignore.split('/')[gets] + os.sep
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
171 gets += 1
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
172 os.removedirs(temp+dir1)
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
173
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
174 def LoadDoc(self):
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
175 manifest = open(self.filename)
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
176 self.ignorelist = []
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
177 ignore = manifest.readlines()
236
9230a33defd9 Traipse Beta 'OpenRPG' {100616-00}
sirebral
parents: 222
diff changeset
178 for i in ignore: self.ignorelist.append(str(i[:len(i)-1]))
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
179 manifest.close()
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
180
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
181 def Finish(self, evt=None):
184
dcae32e219f1 Traipse Beta 'OpenRPG' {100117-00}
sirebral
parents: 183
diff changeset
182 component.get('upmana-win').OnClose(None)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
183
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
184 def ChooseBranch(self, evt=None):
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
185 dlg = wx.Dialog(self, wx.ID_ANY, "Package Selector", style=wx.DEFAULT_DIALOG_STYLE)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
186 if wx.Platform == '__WXMSW__': icon = wx.Icon(dir_struct["icon"]+'d20.ico', wx.BITMAP_TYPE_ICO)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
187 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
188 dlg.SetIcon(icon)
0aeee1992423 This updates fixes three things. Branch names are now current to your udpate
sirebral
parents: 47
diff changeset
189
0aeee1992423 This updates fixes three things. Branch names are now current to your udpate
sirebral
parents: 47
diff changeset
190 self.ui = ui.ui()
0aeee1992423 This updates fixes three things. Branch names are now current to your udpate
sirebral
parents: 47
diff changeset
191 self.repo = hg.repository(self.ui, ".")
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
192 self.c = self.repo.changectx('tip')
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
193
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
194 dlgsizer = wx.GridBagSizer(hgap=1, vgap=1)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
195 Yes = wx.Button( dlg, wx.ID_OK, "Ok" )
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
196 Yes.SetDefault()
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
197 rgroup = wx.RadioButton(dlg, wx.ID_ANY, "group_start", style=wx.RB_GROUP)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
198 rgroup.Hide()
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
199
37
cd8f740a8ffc Whoops! Broke the Package Selecter. Now fixed!! Does anyone evene read these?
sirebral
parents: 36
diff changeset
200 self.get_packages()
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
201 if self.package_list == None: return
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
202 types = self.package_list
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
203 row=0; col=0
48
0aeee1992423 This updates fixes three things. Branch names are now current to your udpate
sirebral
parents: 47
diff changeset
204 self.current = self.repo.dirstate.branch()
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
205 self.package_type = self.current
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
206 self.btnlist = {}; self.btn = {}
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
207 self.id = 1
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
208
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
209 for t in types:
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
210 self.btnName = str(t)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
211 self.btn[self.id] = wx.RadioButton(dlg, wx.ID_ANY, str(t), name=self.btnName)
236
9230a33defd9 Traipse Beta 'OpenRPG' {100616-00}
sirebral
parents: 222
diff changeset
212 if self.btnName == self.current: self.btn[self.id].SetValue(True); self.current_id = self.id
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
213 self.btnlist[self.id] = self.btnName
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
214 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
215 col += 1; self.id += 1
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
216 if col == 3: row += 1; col = 0
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
217
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
218 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
219 dlgsizer.AddGrowableCol(0)
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
220 dlgsizer.AddGrowableRow(0)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
221 dlg.SetAutoLayout( True )
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
222 dlg.SetSizer( dlgsizer )
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
223 dlgsizer.Fit( dlg )
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
224 dlg.Centre()
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
225 dlg.Bind(wx.EVT_RADIOBUTTON, self.PackageSet)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
226 if dlg.ShowModal(): dlg.Destroy()
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
227
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
228 def PackageSet(self, event):
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
229 for btn in self.btn:
236
9230a33defd9 Traipse Beta 'OpenRPG' {100616-00}
sirebral
parents: 222
diff changeset
230 if self.btn[btn].GetValue() == True:
9230a33defd9 Traipse Beta 'OpenRPG' {100616-00}
sirebral
parents: 222
diff changeset
231 if self.btnlist[btn] == 'pious-paladin':
9230a33defd9 Traipse Beta 'OpenRPG' {100616-00}
sirebral
parents: 222
diff changeset
232 try: from PyQt4 import QtCore
9230a33defd9 Traipse Beta 'OpenRPG' {100616-00}
sirebral
parents: 222
diff changeset
233 except:
9230a33defd9 Traipse Beta 'OpenRPG' {100616-00}
sirebral
parents: 222
diff changeset
234 error = "'Pious Paladin' requires PyQt 4.6. For stability you will not be able to update."
9230a33defd9 Traipse Beta 'OpenRPG' {100616-00}
sirebral
parents: 222
diff changeset
235 dlg = wx.MessageDialog(None, error, 'Failed PyQt Test', wx.OK | wx.ICON_ERROR)
9230a33defd9 Traipse Beta 'OpenRPG' {100616-00}
sirebral
parents: 222
diff changeset
236 dlg.ShowModal()
9230a33defd9 Traipse Beta 'OpenRPG' {100616-00}
sirebral
parents: 222
diff changeset
237 self.btn[self.current_id].SetValue(True)
9230a33defd9 Traipse Beta 'OpenRPG' {100616-00}
sirebral
parents: 222
diff changeset
238 self.current = self.btnlist[self.current_id]
9230a33defd9 Traipse Beta 'OpenRPG' {100616-00}
sirebral
parents: 222
diff changeset
239 else: self.current = self.btnlist[btn]
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
240
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
241 branches = self.repo.branchtags()
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
242 heads = dict.fromkeys(self.repo.heads(), 1)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
243 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
244
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
245 if self.current != type:
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
246 heads = dict.fromkeys(self.repo.heads(), self.repo.branchtags())
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
247 branches = dict.copy(self.repo.branchtags())
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
248 self.BranchInfo(self.current)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
249
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
250 def BranchInfo(self, branch):
61
f3d8101211c4 Traipse Dev 'OpenRPG' {090813-00}
sirebral
parents: 60
diff changeset
251 cs = self.repo.changectx( self.current ).changeset()
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
252 self.changelog.SetValue('')
61
f3d8101211c4 Traipse Dev 'OpenRPG' {090813-00}
sirebral
parents: 60
diff changeset
253 changelog = cs[4]
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
254 self.changelog.AppendText(changelog + '\n')
61
f3d8101211c4 Traipse Dev 'OpenRPG' {090813-00}
sirebral
parents: 60
diff changeset
255 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
256 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
257 self.filelist.AppendText("Files Modified (in update): \n")
62
e8029caed892 Traipse Dev 'OpenRPG' {090813-01}
sirebral
parents: 61
diff changeset
258 for f in cs[3]: self.filelist.AppendText(f+"\n")
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
259
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
260 def get_packages(self, type=None):
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
261 #Fixed and ready for Test. Can be cleaner
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
262 self.package_list = []
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
263 b = self.repo.branchtags()
62
e8029caed892 Traipse Dev 'OpenRPG' {090813-01}
sirebral
parents: 61
diff changeset
264 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
265 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
266 l.sort()
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
267 l.reverse()
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
268 for ishead, r, n, t in l: self.package_list.append(t)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
269
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
270 def get_package(self):
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
271 self.get_packages()
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
272 if self.package_list == None: return None
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
273 return None
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
274
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
275 class Repos(wx.Panel):
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
276 def __init__(self, parent, openrpg):
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
277 wx.Panel.__init__(self, parent)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
278 ### Status Bar ###
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
279 #statbar.SetStatusText('Add, Delete, or Refresh your source Tracs')
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
280 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
281 ### Update Manager
81254b3935fb Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents: 41
diff changeset
282 self.ui = ui.ui()
81254b3935fb Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents: 41
diff changeset
283 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
284 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
285
48
0aeee1992423 This updates fixes three things. Branch names are now current to your udpate
sirebral
parents: 47
diff changeset
286 #mainpanel = self
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
287 self.openrpg = openrpg
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
288 self.buttons = {}
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
289 self.texts = {}
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
290
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
291 ## Section Sizers (with frame edges and text captions)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
292 self.box_sizers = {}
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
293 self.box_sizers["newbutton"] = wx.StaticBox(self, -1)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
294
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
295 ## Layout Sizers
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
296 self.sizers = {}
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
297 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
298 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
299
36
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
300 #Button Layout
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
301 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
302 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
303 empty = wx.StaticText(self, -1, "")
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
304 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
305 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
306 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
307
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
308 ##Build Button
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
309 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
310 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
311 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
312 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
313 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
314 self.sizers["newbutton"].Add(self.sizers["newrepo_layout"], -1, wx.EXPAND)
62
e8029caed892 Traipse Dev 'OpenRPG' {090813-01}
sirebral
parents: 61
diff changeset
315
40
95db4430caed If you have nothing in the list, New button works now. Adds duplicates though
sirebral
parents: 39
diff changeset
316 #Repo List Panel
36
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
317 self.repopanel = wx.ScrolledWindow(self)
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
318 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
319 self.repopanel.Scroll(50,10)
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
320 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
321 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
322 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
323 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
324
44
15a76be834dc Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents: 43
diff changeset
325 self.NewRepoList(None)
39
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
326 self.BuildRepoList(None)
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
327
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
328 self.sizers["repolist_layout"].AddGrowableCol(0)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
329 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
330 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
331 self.sizers["repo"].AddGrowableCol(0)
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
332 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
333 self.sizers['repo'].AddGrowableRow(1)
36
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
334 self.repopanel.SetSizer(self.sizers['repo'])
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
335 self.repopanel.SetAutoLayout(True)
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
336
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
337 #Build Main Sizer
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
338 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
339 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
340 self.sizers["main"].AddGrowableCol(0)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
341 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
342 self.sizers["main"].AddGrowableRow(1)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
343 self.SetSizer(self.sizers["main"])
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
344 self.SetAutoLayout(True)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
345 #self.Fit()
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
346 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
347
44
15a76be834dc Delete button is working ok. Moving on to ignore feature then implementation.
sirebral
parents: 43
diff changeset
348 def NewRepoList(self, event):
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
349 self.id = -1
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
350 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
351 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
352 self.defaultcheck = {}; self.default = {}; self.repotrac = {}
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
353 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
354
39
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
355 def BuildRepoList(self, event):
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
356 repolist = manifest.PluginChildren('updaterepo')
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
357 appendlist = []
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
358 for repo in repolist:
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
359 if repo not in self.repolist: appendlist.append(repo)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
360 self.repolist = repolist
39
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
361
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
362 for repo in appendlist:
39
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
363 self.id += 1
42
81254b3935fb Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents: 41
diff changeset
364 #Build Constructs
39
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
365 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
366 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
367 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
368 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
369 self.name[self.id] = wx.StaticText(self.repopanel, -1, 'URL')
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
370 self.uri[self.id] = manifest.GetString('updaterepo', repo, '')
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
371 #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
372 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
373 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
374 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
375 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
376 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
377 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
378 #Build Retraceables
81254b3935fb Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents: 41
diff changeset
379 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
380 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
381 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
382 #Build Layout
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
383 self.layout[self.id].Add(self.name[self.id],
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
384 -1, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
385 self.layout[self.id].Add(self.url[self.id],
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
386 -1, wx.EXPAND)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
387 self.layout[self.id].Add(self.pull[self.id],
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
388 -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
389 self.layout[self.id].Add(self.delete[self.id], -1, wx.EXPAND)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
390 self.layout[self.id].Add(self.defaultcheck[self.id],
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
391 -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
392 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
393 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
394 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
395 #Button Events
39
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
396 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
397 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
398 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
399 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
400 self.sizers['repolist_layout'].Layout()
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
401 self.Layout()
39
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
402
52
c9694d854a61 Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents: 51
diff changeset
403 #Set Default Repo Button
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
404 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
405 if capture != '':
5d89a6eaf492 WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents: 52
diff changeset
406 for caught in self.uri:
5d89a6eaf492 WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents: 52
diff changeset
407 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
408 else: continue
5d89a6eaf492 WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents: 52
diff changeset
409 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
410
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
411 def AddRepo(self, event):
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
412 repo = self.texts['reponame'].GetValue(); repo = repo.replace(' ', '_'); repo = 'repo-' + repo
142
2345c12d93a7 Traipse Beta 'OpenRPG' {091123-01}
sirebral
parents: 135
diff changeset
413 manifest.SetString('updaterepo', repo, '')
39
93a27aea09ce Going to post some daily builds as advancements happen. Repo List now updates.
sirebral
parents: 38
diff changeset
414 self.BuildRepoList(None)
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
415
43
f00b02fbf511 Delete works, GUI updates wrong. Refresh now Force pulls.
sirebral
parents: 42
diff changeset
416 def DelRepo(self, event):
f00b02fbf511 Delete works, GUI updates wrong. Refresh now Force pulls.
sirebral
parents: 42
diff changeset
417 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
418 self.sizers["repolist_layout"].Hide(self.container[self.id])
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
419 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
420 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
421 except: pass
43
f00b02fbf511 Delete works, GUI updates wrong. Refresh now Force pulls.
sirebral
parents: 42
diff changeset
422 self.sizers['repolist_layout'].Layout()
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
423 self.repolist = manifest.PluginChildren('updaterepo')
43
f00b02fbf511 Delete works, GUI updates wrong. Refresh now Force pulls.
sirebral
parents: 42
diff changeset
424
36
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
425 def RefreshRepo(self, event):
42
81254b3935fb Refresh button will now work, repos are set after Refresh is pressed, object
sirebral
parents: 41
diff changeset
426 self.id = self.pull_list[event.GetEventObject()]
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
427 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
428 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
429 except: pass
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
430
52
c9694d854a61 Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents: 51
diff changeset
431 def SetDefault(self, event):
c9694d854a61 Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents: 51
diff changeset
432 self.id = self.defchecklist[event.GetEventObject()]
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
433 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
434 for all in self.defaultcheck:
c9694d854a61 Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents: 51
diff changeset
435 self.defaultcheck[all].SetValue(False)
c9694d854a61 Auto Update and Default repo now work, Ignore list is retained. Made attempts
sirebral
parents: 51
diff changeset
436 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
437
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
438 class Manifest(wx.Panel):
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
439 def __init__(self, parent):
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
440 wx.Panel.__init__(self, parent)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
441 ### Status Bar ###
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
442 #statbar.SetStatusText('Create an Ignore List')
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
443 statbar.SetStatusText('New Status Bar')
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
444 self.ui = ui.ui()
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
445 self.repo = hg.repository(self.ui, ".")
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
446 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
447 self.manifestlist = []
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
448 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
449 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
450 self.manifestlist.sort()
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
451 self.SetBackgroundColour(wx.WHITE)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
452 self.sizer = wx.GridBagSizer(hgap=1, vgap=1)
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
453 self.manifestlog = wx.CheckListBox( self, -1, wx.DefaultPosition, wx.DefaultSize,
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
454 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
455 filename = 'ignorelist.txt'
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 62
diff changeset
456 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
457 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
458 self.mana = self.LoadDoc()
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
459 self.manifestlog.Bind(wx.EVT_CHECKLISTBOX, self.GetChecked)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
460 self.sizer.Add(self.manifestlog, (0,0), flag=wx.EXPAND)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
461 self.sizer.AddGrowableCol(0)
36
683536732926 Update Manager 0.4. This is lookign really really nice now. OMG!!
sirebral
parents: 35
diff changeset
462 self.sizer.AddGrowableRow(0)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
463 self.SetSizer(self.sizer)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
464 self.SetAutoLayout(True)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
465
45
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
466 def GetChecked(self, event):
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
467 self.mana = []
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
468 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
469 self.SaveDoc()
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
470
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
471 def SaveDoc(self):
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
472 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
473 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
474 f.close()
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
475
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
476 def LoadDoc(self):
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
477 ignore = open(self.filename)
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
478 ignorelist = []
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
479 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
480 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
481 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
482 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
483 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
484 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
485 self.manifestlog.SetCheckedStrings(ignorelist)
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
486 manifest = ignore.readlines()
45
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
487 ignore.close()
50e82d8090cf A few more commits. This gets Manifest working, Refresh should be working on
sirebral
parents: 44
diff changeset
488
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
489 class Control(wx.Panel):
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
490 def __init__(self, parent):
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
491 wx.Panel.__init__(self, parent)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
492 ### Status Bar ###
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
493 #statbar.SetStatusText('Advanced Controls & Rollback')
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
494 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
495 ### 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
496 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
497 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
498 self.c = self.repo.changectx('tip')
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
499 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
500 #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
501
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
502 self.get_packages()
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
503 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
504 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
505 self.buttons = {}
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
506
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
507 ## 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
508 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
509 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
510 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
511 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
512 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
513 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
514 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
515 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
516 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
517 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
518 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
519
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
520 ## 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
521 branchcp = wx.Panel(self)
92
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 83
diff changeset
522 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
523 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
524 self.branches = wx.Choice(branchcp, wx.ID_ANY, choices=self.package_list)
92
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 83
diff changeset
525 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
526 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
527 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
528 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
529 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
530 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
531
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
532 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
533 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
534 self.revlist = wx.ListCtrl(revlistcp, -1, wx.DefaultPosition, size=wx.DefaultSize,
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
535 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
536 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
537 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
538 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
539 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
540 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
541 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
542 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
543 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
544 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
545 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
546 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
547
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
548 ## 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
549 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
550 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
551 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
552 self.buttons['delete'] = wx.Button(cp, wx.ID_ANY, "Delete Branch")
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
553 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
554 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
555 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
556 cp.SetAutoLayout(True)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
557
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
558 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
559 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
560 self.sizer.Add(revlistcp, (2,1), span=(1,1), flag=wx.EXPAND)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
561 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
562
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
563 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
564 self.sizer.AddGrowableCol(0)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
565 self.sizer.AddGrowableCol(1)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
566 self.sizer.AddGrowableRow(2)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
567 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
568 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
569
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
570 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
571 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
572 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
573 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
574 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
575 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
576 self.Bind(wx.EVT_BUTTON, self.RevUpdate, self.buttons['update'])
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
577
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
578
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
579 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
580 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
581 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
582 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
583 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
584 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
585 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
586 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
587 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
588 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
589
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
590 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
591 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
592 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
593 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
594 self.revlist.Focus(i)
83
f38df4bf9715 Traipse Alpha 'OpenRPG' {090909-00}
sirebral
parents: 81
diff changeset
595 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
596 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
597 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
598
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
599 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
600 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
601 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
602 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
603 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
604 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
605 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
606 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
607 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
608 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
609 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
610 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
611 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
612 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
613
52a5fa913008 Update Manager: Started working on the control panel. Right now the GUI is the hardest part. If you look through the code you will see that I can already obtain revision numbers.
sirebral
parents: 66
diff changeset
614 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
615 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
616 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
617 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
618 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
619 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
620 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
621 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
622 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
623
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
624 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
625 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
626
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
627 def RevUpdate(self, event):
92
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 83
diff changeset
628 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)
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 83
diff changeset
629 if dlg.ShowModal() == wx.ID_YES:
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 83
diff changeset
630 dlg.Destroy()
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 83
diff changeset
631 filename = 'ignorelist.txt'
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 83
diff changeset
632 self.filename = dir_struct["home"] + 'upmana' + os.sep + filename
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 83
diff changeset
633 component.get('validate').config_file(filename, "default_ignorelist.txt")
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 83
diff changeset
634 self.mana = self.LoadDoc()
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 83
diff changeset
635 temp = dir_struct["home"] + 'upmana' + os.sep + 'tmp' + os.sep
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 83
diff changeset
636 for ignore in self.ignorelist:
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 83
diff changeset
637 shutil.copy(ignore, temp + ignore.split('/')[len(ignore.split('/')) - 1])
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 83
diff changeset
638 hg.clean(self.repo, self.currev)
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 83
diff changeset
639 for ignore in self.ignorelist:
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 83
diff changeset
640 shutil.copyfile(temp + ignore.split('/')[len(ignore.split('/')) - 1], ignore)
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 83
diff changeset
641 os.remove(temp + ignore.split('/')[len(ignore.split('/')) - 1])
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 83
diff changeset
642 else:
68c7bd272f27 Traipse Beta 'OpenRPG' {090919-00}
sirebral
parents: 83
diff changeset
643 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
644
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
645 def LoadDoc(self):
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
646 manifest = open(self.filename)
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
647 self.ignorelist = []
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
648 ignore = manifest.readlines()
236
9230a33defd9 Traipse Beta 'OpenRPG' {100616-00}
sirebral
parents: 222
diff changeset
649 for i in ignore: self.ignorelist.append(str(i[:len(i)-1]))
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
650 manifest.close()
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
651
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
652 def get_packages(self, type=None):
184
dcae32e219f1 Traipse Beta 'OpenRPG' {100117-00}
sirebral
parents: 183
diff changeset
653 #Can be cleaner
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
654 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
655 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
656 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
657 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
658 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
659 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
660 for ishead, r, n, t in l: self.package_list.append(t)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
661
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
662 def get_package(self):
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
663 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
664 if self.package_list == None: return None
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
665 return None
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
666
150
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
667 class Help(wx.Panel):
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
668 def __init__(self, parent):
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
669 wx.Panel.__init__(self, parent)
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
670 sizer = wx.BoxSizer(wx.VERTICAL)
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
671 self.help = wx.TextCtrl(self, wx.ID_ANY, size=(-1, -1),
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
672 style=wx.TE_MULTILINE | wx.TE_READONLY)
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
673 sizer.Add(self.help, 1, wx.EXPAND)
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
674 self.build_help()
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
675 self.SetSizer(sizer)
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
676 self.Layout()
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
677
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
678 def build_help(self):
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
679 help = """'Traipse' OpenRPG Update Manager Help:
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
680 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"""
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
681 self.help.AppendText(help)
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
682 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.
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
683 ---
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
684
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
685 The Updater Tab:
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
686 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.
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
687
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
688 Package Select:
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
689 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.
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
690
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
691 Update Now:
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
692 Press this button when you want to update to the selected package
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
693
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
694 Auto Update:
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
695 Check this if want to update when you start the software. You need to have a default Repository checked in the Repo tab.
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
696
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
697 No Update:
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
698 Check this if you do not want to see the Update Manager when you start the software.
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
699 ---\n\n"""
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
700 self.help.AppendText(help)
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
701 help = """The Repos Tab:
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
702 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.
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
703
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
704 What is a repostiory?
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
705 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.
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
706
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
707 Creating new Repos:
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
708 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.
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
709
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
710 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.
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
711
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
712 Default:
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
713 You can set any repo as your default repository. This is the repo the software will update from if you Auto Update.
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
714 ---\n\n"""
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
715 self.help.AppendText(help)
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
716 help = """The Manifest Tab:
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
717 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.
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
718
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
719 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.
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
720 ---\n\n"""
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
721 self.help.AppendText(help)
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
722 help = """The Control Tab:
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
723 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.
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
724
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
725 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.
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
726
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
727 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.
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
728
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
729 What is the Control Tab for?
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
730 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.
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
731 ---"""
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
732 self.help.AppendText(help)
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
733
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
734 class updaterFrame(wx.Frame):
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
735 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
736
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
737 wx.Frame.__init__(self, None, wx.ID_ANY, title, size=(600,500), style=wx.DEFAULT_FRAME_STYLE)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
738 if wx.Platform == '__WXMSW__': icon = wx.Icon(dir_struct["icon"]+'d20.ico', wx.BITMAP_TYPE_ICO)
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 62
diff changeset
739 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
740
60
3b2cfa13b610 Fix to toolbar menus. More correct fix so docking is working on Ubuntu
sirebral
parents: 59
diff changeset
741 self.SetIcon(icon)
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
742 self.main = main
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
743 ####### Panel Stuff ######
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
744 p = wx.Panel(self)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
745 nb = wx.Notebook(p)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
746
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
747 global statbar
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
748 statbar = self.CreateStatusBar()
212
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
749 sys.stdout = Term2Win()
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
750 self.Centre()
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
751
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
752 # create the page windows as children of the notebook
212
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
753 self.page1 = Updater(nb, openrpg)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
754 page2 = Repos(nb, openrpg)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
755 page3 = Manifest(nb)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
756 page4 = Control(nb)
150
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
757 page5 = Help(nb)
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
758
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
759 # add the pages to the notebook with the label to show on the tab
212
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
760 nb.AddPage(self.page1, "Updater")
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
761 nb.AddPage(page2, "Repos")
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
762 nb.AddPage(page3, "Manifest")
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
763 nb.AddPage(page4, "Control")
150
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
764 nb.AddPage(page5, 'Help')
33
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
765
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
766 # 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
767 # the layout
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
768 sizer = wx.BoxSizer()
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
769 sizer.Add(nb, 1, wx.EXPAND)
3687514e0218 I actally forgot the Update Manager's new package. Sorry.
sirebral
parents:
diff changeset
770 p.SetSizer(sizer)
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
771 p.Layout()
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
772 self.Refresh()
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
773 self.Bind(wx.EVT_CLOSE, self.OnClose)
183
0d9b746b5751 Traipse Beta 'OpenRPG' {100115-00}
sirebral
parents: 150
diff changeset
774 component.add('upmana-win', self)
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
775
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
776 def OnClose(self, event):
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
777 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
778 if self.main == True: self.Hide()
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
779
34
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
780 class updateApp(wx.App):
8b630fc8a343 Updated the Update Manager to 0.3. Settings are being created with a clone
sirebral
parents: 33
diff changeset
781 def OnInit(self):
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
782 self.main = False; self.autoUpdate = False; self.noUpdate = False
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
783 logger._set_log_to_console(False)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
784 logger.note("Updater Start")
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
785 component.add('validate', validate)
212
13054be69834 Traipse Beta 'OpenRPG' {100428-00}
sirebral
parents: 184
diff changeset
786 self.updater = updaterFrame(self, "OpenRPG Update Manager 1.2",
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
787 component, manifest, self.main)
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
788 if manifest.GetString("updatemana", "auto_update", "") == 'on' and self.main == False:
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
789 self.AutoUpdate(); self.OnExit(); self.autoUpdate = True
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
790 else: pass
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
791 if manifest.GetString('updatemana', 'no_update', '') == 'on' and self.main == False:
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
792 self.OnExit(); self.noUpdate = True
49
b41ea7d28a9e Final testing! Moving to a WinXP platform for final testing before stable.
sirebral
parents: 48
diff changeset
793 else: pass
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
794 if not (self.autoUpdate or self.noUpdate):
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
795 try:
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
796 self.updater.Show()
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
797 self.updater.Fit()
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
798 if not self.main: self.updater.page1.UpdateCheck()
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
799 except: pass
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
800 return True
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
801
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
802 def AutoUpdate(self):
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
803 self.ui = ui.ui()
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
804 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
805 self.c = self.repo.changectx('tip')
51
14d4270d5e5d Fixed Auto Update not finding current branch, no pull associated yet!
sirebral
parents: 49
diff changeset
806 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
807
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
808 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
809 if capture != '':
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
810 try: commands.pull(self.ui, self.repo, capture, rev='', update=False, force=True)
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
811 except:
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
812 wx.MessageBox('No Connection Found. Skipping Auto Update!', 'Info')
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
813 return
54
5d89a6eaf492 WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents: 52
diff changeset
814 filename = 'ignorelist.txt'
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 62
diff changeset
815 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
816 component.get('validate').config_file(filename, "default_ignorelist.txt")
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
817 self.mana = self.LoadDoc(); ignored = []
74
fdcca00696ea Continuing the code refinement.
sirebral
parents: 72
diff changeset
818 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
819 for ignore in self.ignorelist:
150
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
820 if len(ignore.split('/')) > 1:
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
821 gets = 0; dir1 = ''
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
822 while gets != len(ignore.split('/'))-1:
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
823 dir1 += ignore.split('/')[gets] + os.sep
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
824 gets += 1
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
825 os.makedirs(temp+dir1)
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
826 ignoredfile = temp + dir1 + ignore.split('/')[len(ignore.split('/')) - 1]
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
827 ignored.append(ignoredfile)
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
828 shutil.copy(ignore, ignoredfile)
54
5d89a6eaf492 WinXP seems to have lost some boxes unless the screen is resized. Weird.
sirebral
parents: 52
diff changeset
829 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
830 for ignore in self.ignorelist:
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
831 shutil.copyfile(ignored.index(ignore), ignore)
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
832 os.remove(ignored.index(ignore))
150
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
833 if len(ignore.split('/')) > 1:
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
834 gets = 0; dir1 = ''
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
835 while gets != len(ignore.split('/'))-1:
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
836 dir1 += ignore.split('/')[gets] + os.sep
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
837 gets += 1
6c5f46a5924b Traipse Beta 'OpenRPG' {091124-00}
sirebral
parents: 142
diff changeset
838 os.removedirs(temp+dir1)
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
839 else: wx.MessageBox('Default Repo Not Found. Skipping Auto Update!', 'Info')
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
840
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
841 def LoadDoc(self):
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
842 manifest = open(self.filename)
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
843 self.ignorelist = []
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
844 ignore = manifest.readlines()
236
9230a33defd9 Traipse Beta 'OpenRPG' {100616-00}
sirebral
parents: 222
diff changeset
845 for i in ignore: self.ignorelist.append(str(i[:len(i)-1]))
222
bb7b9648792c Traipse Beta 'OpenRPG' {100502-00}
sirebral
parents: 212
diff changeset
846 manifest.close()
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
847
46
599f727e3833 Getting ready to test!! Main functions seem to be working.
sirebral
parents: 45
diff changeset
848 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
849 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
850 '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
851 'orpg.dirpath', 'upmana.validate', 'mercurial.ui', 'mercurial.hg',
135
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
852 'mercurial.commands', 'mercurial.repo', 'mercurial.revlog', 'mercurial.cmdutil', 'shutil']
dcf4fbe09b70 Traipse Beta 'OpenRPG' {091010-00}
sirebral
parents: 92
diff changeset
853 for name in imported:
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
854 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
855
47
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
856 try: self.updater.Destroy()
52f6a38f8885 Update Manager 0.6.7 (Initial Release). Getting ready to implement it now.
sirebral
parents: 46
diff changeset
857 except: pass