Mercurial > traipse_dev
comparison upmana/updatemana.py @ 42:81254b3935fb traipse_dev
Refresh button will now work, repos are set after Refresh is pressed, object
is found after software restarts. Working on Delete button.
Future editions will contain a Status Box for output.
author | sirebral |
---|---|
date | Wed, 05 Aug 2009 10:09:11 -0500 |
parents | 6d18ee109e02 |
children | f00b02fbf511 |
comparison
equal
deleted
inserted
replaced
41:6d18ee109e02 | 42:81254b3935fb |
---|---|
211 | 211 |
212 class Repos(wx.Panel): | 212 class Repos(wx.Panel): |
213 def __init__(self, parent, openrpg, manifest): | 213 def __init__(self, parent, openrpg, manifest): |
214 wx.Panel.__init__(self, parent) | 214 wx.Panel.__init__(self, parent) |
215 | 215 |
216 ### Update Manager | |
217 self.ui = ui.ui() | |
218 self.r = hg.repository(self.ui, ".") | |
219 self.c = self.r.changectx('tip') | |
220 | |
216 mainpanel = self | 221 mainpanel = self |
217 self.openrpg = openrpg | 222 self.openrpg = openrpg |
218 self.manifest = manifest | 223 self.manifest = manifest |
219 self.buttons = {} | 224 self.buttons = {} |
220 self.texts = {} | 225 self.texts = {} |
251 self.sizers["repolist"] = wx.StaticBoxSizer(self.box_sizers["repolist"], wx.VERTICAL) | 256 self.sizers["repolist"] = wx.StaticBoxSizer(self.box_sizers["repolist"], wx.VERTICAL) |
252 self.sizers["repo"] = wx.GridBagSizer(hgap=2, vgap=2) | 257 self.sizers["repo"] = wx.GridBagSizer(hgap=2, vgap=2) |
253 self.sizers["repolist_layout"] = wx.FlexGridSizer(rows=1, cols=1, hgap=2, vgap=5) | 258 self.sizers["repolist_layout"] = wx.FlexGridSizer(rows=1, cols=1, hgap=2, vgap=5) |
254 self.manifest = manifest | 259 self.manifest = manifest |
255 | 260 |
256 self.id = 0; self.box = {}; self.main = {}; self.container = {}; self.layout = {} | 261 self.id = 0; self.box = {}; self.box_name= {}; self.main = {}; self.container = {}; self.layout = {} |
257 self.name = {}; self.url = {}; self.pull = {}; self.uri = {}; self.delete = {} | 262 self.name = {}; self.url = {}; self.url_list = {}; self.pull = {}; self.uri = {}; self.delete = {} |
258 self.defaultcheck = {}; self.default = {}; self.repotrac = {} | 263 self.defaultcheck = {}; self.default = {}; self.repotrac = {} |
259 self.pull_list = {}; self.delete_list = {}; self.defchecklist = {} | 264 self.pull_list = {}; self.delete_list = {}; self.defchecklist = {} |
260 | 265 |
261 self.BuildRepoList(None) | 266 self.BuildRepoList(None) |
262 | 267 |
283 def BuildRepoList(self, event): | 288 def BuildRepoList(self, event): |
284 self.repolist = self.manifest.GetList('UpdateManifest', 'repolist', '') | 289 self.repolist = self.manifest.GetList('UpdateManifest', 'repolist', '') |
285 try: self.repolist = self.repo | 290 try: self.repolist = self.repo |
286 except: pass | 291 except: pass |
287 | 292 |
288 | |
289 #wx.Yeild() For future refrence. | 293 #wx.Yeild() For future refrence. |
290 | 294 |
291 for repo in self.repolist: | 295 for repo in self.repolist: |
292 self.id += 1 | 296 self.id += 1 |
297 #Build Constructs | |
293 self.box[self.id] = wx.StaticBox(self.repopanel, -1, str(repo)) | 298 self.box[self.id] = wx.StaticBox(self.repopanel, -1, str(repo)) |
294 self.main[self.id] = wx.GridBagSizer(hgap=2, vgap=2) | 299 self.main[self.id] = wx.GridBagSizer(hgap=2, vgap=2) |
295 self.container[self.id] = wx.StaticBoxSizer(self.box[self.id], wx.VERTICAL) | 300 self.container[self.id] = wx.StaticBoxSizer(self.box[self.id], wx.VERTICAL) |
296 self.layout[self.id] = wx.FlexGridSizer(rows=1, cols=4, hgap=2, vgap=5) | 301 self.layout[self.id] = wx.FlexGridSizer(rows=1, cols=4, hgap=2, vgap=5) |
297 self.name[self.id] = wx.StaticText(self.repopanel, -1, 'URL') | 302 self.name[self.id] = wx.StaticText(self.repopanel, -1, 'URL') |
298 self.uri[self.id] = self.manifest.GetString('updaterepo', repo, '') | 303 self.uri[self.id] = self.manifest.GetString('updaterepo', repo, '') |
299 self.url[self.id] = wx.TextCtrl(self.repopanel, -1, self.uri[self.id]) | 304 self.url[self.id] = wx.TextCtrl(self.repopanel, -1, self.uri[self.id]) |
300 self.pull[self.id] = wx.Button(self.repopanel, wx.ID_REFRESH) | 305 self.pull[self.id] = wx.Button(self.repopanel, wx.ID_REFRESH) |
301 self.pull_list[self.pull[self.id]] = self.id | |
302 self.delete[self.id] = wx.Button(self.repopanel, wx.ID_DELETE) | 306 self.delete[self.id] = wx.Button(self.repopanel, wx.ID_DELETE) |
303 self.delete_list[self.delete[self.id]] = self.id | 307 self.delete_list[self.delete[self.id]] = self.id |
304 self.defaultcheck[self.id] = wx.CheckBox(self.repopanel, -1) | 308 self.defaultcheck[self.id] = wx.CheckBox(self.repopanel, -1) |
309 self.default[self.id] = wx.StaticText(self.repopanel, -1, 'Default') | |
310 #Build Retraceables | |
311 self.box_name[self.id] = str(repo) | |
312 self.pull_list[self.pull[self.id]] = self.id | |
305 self.defchecklist[self.defaultcheck[self.id]] = self.id | 313 self.defchecklist[self.defaultcheck[self.id]] = self.id |
306 self.default[self.id] = wx.StaticText(self.repopanel, -1, 'Default') | 314 #Build Layout |
307 self.layout[self.id].Add(self.name[self.id], -1, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL) | 315 self.layout[self.id].Add(self.name[self.id], -1, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL) |
308 self.layout[self.id].Add(self.url[self.id], -1, wx.EXPAND) | 316 self.layout[self.id].Add(self.url[self.id], -1, wx.EXPAND) |
309 self.layout[self.id].Add(self.pull[self.id], -1, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.ALL) | 317 self.layout[self.id].Add(self.pull[self.id], -1, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.ALL) |
310 self.layout[self.id].Add(self.delete[self.id], -1, wx.EXPAND) | 318 self.layout[self.id].Add(self.delete[self.id], -1, wx.EXPAND) |
311 self.layout[self.id].Add(self.defaultcheck[self.id], -1, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.ALL) | 319 self.layout[self.id].Add(self.defaultcheck[self.id], -1, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.ALL) |
326 repolist = repolist + self.repo | 334 repolist = repolist + self.repo |
327 self.manifest.SetList('UpdateManifest', 'repolist', repolist) | 335 self.manifest.SetList('UpdateManifest', 'repolist', repolist) |
328 self.BuildRepoList(None) | 336 self.BuildRepoList(None) |
329 | 337 |
330 def RefreshRepo(self, event): | 338 def RefreshRepo(self, event): |
331 print self.pull_list[event.GetEventObject()] | 339 self.id = self.pull_list[event.GetEventObject()] |
340 self.manifest.SetString('updaterepo', str(self.box_name[self.id]), self.url[self.id].GetValue()) | |
341 try: | |
342 commands.pull(self.ui, self.r, self.url[self.id].GetValue()) | |
343 except: | |
344 pass | |
332 | 345 |
333 class Manifest(wx.Panel): | 346 class Manifest(wx.Panel): |
334 def __init__(self, parent): | 347 def __init__(self, parent): |
335 wx.Panel.__init__(self, parent) | 348 wx.Panel.__init__(self, parent) |
336 self.ui = ui.ui() | 349 self.ui = ui.ui() |