comparison upmana/updatemana.py @ 38:a35f41ebd04e traipse_dev

Moving into Update Manager 0.5 as I reveresed the button dictionaries and found a way to iterate buttons and know which button was pressed. Refresh button prints out a number, no other changes.
author sirebral
date Wed, 05 Aug 2009 07:47:44 -0500
parents cd8f740a8ffc
children 93a27aea09ce
comparison
equal deleted inserted replaced
37:cd8f740a8ffc 38:a35f41ebd04e
172 172
173 def BranchInfo(self, branch): 173 def BranchInfo(self, branch):
174 self.filelist.SetValue('') 174 self.filelist.SetValue('')
175 self.filelist.AppendText("Files that will change\n\n") 175 self.filelist.AppendText("Files that will change\n\n")
176 self.changelog.SetValue('') 176 self.changelog.SetValue('')
177 changelog = "Traipse 'OpenRPG' Update Manager.\n\nThis is Dev Build 0.4 of the Update Manager. It has limited functionality.\n\nThe full release will search your Revision log and show the contents here.\n\nMajor changes in this version are ... Manifest is now in a CheckListBox, very nice, Repos now allow for scrolling, New button works. Checks Box on the Updater tab work. Settings file is created and data is saved to it." 177 changelog = "Traipse 'OpenRPG' Update Manager.\n\nThis is Dev Build 0.5 of the Update Manager. It has limited functionality.\n\nThe full release will search your Revision log and show the contents here.\n\nMajor changes in this version are ... Manifest is now in a CheckListBox, very nice, Repos now allow for scrolling, New button works. Checks Box on the Updater tab work. Settings file is created and data is saved to it."
178 self.changelog.AppendText(changelog + '\n') 178 self.changelog.AppendText(changelog + '\n')
179 self.filelist.AppendText("Update to " + branch + "\n\n The full release will show the files to be changed here.") 179 self.filelist.AppendText("Update to " + branch + "\n\n The full release will show the files to be changed here.")
180 180
181 #### Files works but not fully without the change log information, pulled for Dev 0.1 181 #### Files works but not fully without the change log information, pulled for Dev 0.1
182 #for f in files: 182 #for f in files:
256 self.manifest = manifest 256 self.manifest = manifest
257 257
258 self.repolist = [] 258 self.repolist = []
259 for v in self.manifest.GetList('UpdateManifest', 'repolist', ''): self.repolist.append(v) 259 for v in self.manifest.GetList('UpdateManifest', 'repolist', ''): self.repolist.append(v)
260 260
261 self.id = 1; self.box = {}; self.main = {}; self.container = {}; self.layout = {} 261 self.id = 0; self.box = {}; self.main = {}; self.container = {}; self.layout = {}
262 self.name = {}; self.url = {}; self.pull = {}; self.uri = {}; self.delete = {} 262 self.name = {}; self.url = {}; self.pull = {}; self.uri = {}; self.delete = {}
263 self.defaultcheck = {}; self.default = {}; self.repotrac = {} 263 self.defaultcheck = {}; self.default = {}; self.repotrac = {}; self.pull_list = {}
264 264
265 #wx.Yeild() For future refrence. 265 #wx.Yeild() For future refrence.
266 266
267 #Repo Name; Static Text; URL; Button. 267 #Repo Name; Static Text; URL; Button.
268 for repo in self.repolist: 268 for repo in self.repolist:
269 #self.repotrac[self.id] = repo 269 self.id += 1
270 self.box[self.id] = wx.StaticBox(self.repopanel, -1, str(repo)) 270 self.box[self.id] = wx.StaticBox(self.repopanel, -1, str(repo))
271 self.main[self.id] = wx.GridBagSizer(hgap=2, vgap=2) 271 self.main[self.id] = wx.GridBagSizer(hgap=2, vgap=2)
272 self.container[self.id] = wx.StaticBoxSizer(self.box[self.id], wx.VERTICAL) 272 self.container[self.id] = wx.StaticBoxSizer(self.box[self.id], wx.VERTICAL)
273 273
274 self.layout[self.id] = wx.FlexGridSizer(rows=1, cols=4, hgap=2, vgap=5) 274 self.layout[self.id] = wx.FlexGridSizer(rows=1, cols=4, hgap=2, vgap=5)
275 self.name[self.id] = wx.StaticText(self.repopanel, -1, 'URL') 275 self.name[self.id] = wx.StaticText(self.repopanel, -1, 'URL')
276 self.uri[self.id] = self.manifest.GetString('updaterepo', repo, '') 276 self.uri[self.id] = self.manifest.GetString('updaterepo', repo, '')
277 self.url[self.id] = wx.TextCtrl(self.repopanel, -1, self.uri[self.id]) 277 self.url[self.id] = wx.TextCtrl(self.repopanel, -1, self.uri[self.id])
278 self.pull[self.id] = wx.Button(self.repopanel, wx.ID_REFRESH) 278 self.pull[self.id] = wx.Button(self.repopanel, wx.ID_REFRESH)
279 self.pull_list[self.pull[self.id]] = self.id
279 self.delete[self.id] = wx.Button(self.repopanel, wx.ID_DELETE) 280 self.delete[self.id] = wx.Button(self.repopanel, wx.ID_DELETE)
280 self.defaultcheck[self.id] = wx.CheckBox(self.repopanel, -1) 281 self.defaultcheck[self.id] = wx.CheckBox(self.repopanel, -1)
281 self.default[self.id] = wx.StaticText(self.repopanel, -1, 'Default') 282 self.default[self.id] = wx.StaticText(self.repopanel, -1, 'Default')
282 283
283 self.layout[self.id].Add(self.name[self.id], -1, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL) 284 self.layout[self.id].Add(self.name[self.id], -1, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL)
286 self.layout[self.id].Add(self.delete[self.id], -1, wx.EXPAND) 287 self.layout[self.id].Add(self.delete[self.id], -1, wx.EXPAND)
287 self.layout[self.id].Add(self.defaultcheck[self.id], -1, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.ALL) 288 self.layout[self.id].Add(self.defaultcheck[self.id], -1, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.ALL)
288 self.layout[self.id].Add(self.default[self.id], -1, wx.EXPAND) 289 self.layout[self.id].Add(self.default[self.id], -1, wx.EXPAND)
289 self.layout[self.id].AddGrowableCol(1) 290 self.layout[self.id].AddGrowableCol(1)
290 self.container[self.id].Add(self.layout[self.id], -1, wx.EXPAND) 291 self.container[self.id].Add(self.layout[self.id], -1, wx.EXPAND)
292 self.Bind(wx.EVT_BUTTON, self.RefreshRepo, self.pull[self.id])
291 self.sizers["repolist_layout"].Add(self.container[self.id], -1, wx.EXPAND) 293 self.sizers["repolist_layout"].Add(self.container[self.id], -1, wx.EXPAND)
292 294
293 self.sizers["repolist_layout"].AddGrowableCol(0) 295 self.sizers["repolist_layout"].AddGrowableCol(0)
294 self.sizers["repolist"].Add(self.sizers["repolist_layout"], -1, wx.EXPAND) 296 self.sizers["repolist"].Add(self.sizers["repolist_layout"], -1, wx.EXPAND)
295 297
309 311
310 self.SetAutoLayout(True) 312 self.SetAutoLayout(True)
311 self.Fit() 313 self.Fit()
312 314
313 self.Bind(wx.EVT_BUTTON, self.AddRepo, self.buttons['addrepo']) 315 self.Bind(wx.EVT_BUTTON, self.AddRepo, self.buttons['addrepo'])
314 self.Bind(wx.EVT_BUTTON, self.RefreshRepo, self.pull[self.id])
315 316
316 def AddRepo(self, event): 317 def AddRepo(self, event):
317 repo = self.texts['reponame'].GetValue(); repo = repo.replace(' ', '_'); repo = 'repo-' + repo 318 repo = self.texts['reponame'].GetValue(); repo = repo.replace(' ', '_'); repo = 'repo-' + repo
318 self.manifest.SetString('updaterepo', repo, ''); repo = repo.split(',') 319 self.manifest.SetString('updaterepo', repo, ''); repo = repo.split(',')
319 repolist = self.manifest.GetList('UpdateManifest', 'repolist', ''); repo = repolist + repo 320 repolist = self.manifest.GetList('UpdateManifest', 'repolist', ''); repo = repolist + repo
320 self.manifest.SetList('UpdateManifest', 'repolist', repo) 321 self.manifest.SetList('UpdateManifest', 'repolist', repo)
321 322
322 def RefreshRepo(self, event): 323 def RefreshRepo(self, event):
323 pass #print str(event) #repo = self.repolist[event]; print repo 324 print self.pull_list[event.GetEventObject()]
324
325 325
326 class Manifest(wx.Panel): 326 class Manifest(wx.Panel):
327 def __init__(self, parent): 327 def __init__(self, parent):
328 wx.Panel.__init__(self, parent) 328 wx.Panel.__init__(self, parent)
329 self.ui = ui.ui() 329 self.ui = ui.ui()
388 self.open_rpg.add_component("log", self.log) 388 self.open_rpg.add_component("log", self.log)
389 self.open_rpg.add_component("xml", orpg.orpg_xml) 389 self.open_rpg.add_component("xml", orpg.orpg_xml)
390 self.open_rpg.add_component("dir_struct", orpg.dirpath.dir_struct) 390 self.open_rpg.add_component("dir_struct", orpg.dirpath.dir_struct)
391 self.validate = orpg.tools.validate.Validate() 391 self.validate = orpg.tools.validate.Validate()
392 self.open_rpg.add_component("validate", self.validate) 392 self.open_rpg.add_component("validate", self.validate)
393 self.updater = updaterFrame(self, "OpenRPG Update Manager Beta 0.4", self.open_rpg, self.manifest) 393 self.updater = updaterFrame(self, "OpenRPG Update Manager Beta 0.5", self.open_rpg, self.manifest)
394 self.updated = False 394 self.updated = False
395 try: 395 try:
396 self.updater.Show() 396 self.updater.Show()
397 self.SetTopWindow(self.updater) 397 self.SetTopWindow(self.updater)
398 self.updater.Fit() 398 self.updater.Fit()