comparison upmana/updatemana.py @ 41:6d18ee109e02 traipse_dev

Duplicates removed, refresh button still prints. Moving to Pull command and Delete button.
author sirebral
date Wed, 05 Aug 2009 09:22:11 -0500
parents 95db4430caed
children 81254b3935fb
comparison
equal deleted inserted replaced
40:95db4430caed 41:6d18ee109e02
251 self.sizers["repolist"] = wx.StaticBoxSizer(self.box_sizers["repolist"], wx.VERTICAL) 251 self.sizers["repolist"] = wx.StaticBoxSizer(self.box_sizers["repolist"], wx.VERTICAL)
252 self.sizers["repo"] = wx.GridBagSizer(hgap=2, vgap=2) 252 self.sizers["repo"] = wx.GridBagSizer(hgap=2, vgap=2)
253 self.sizers["repolist_layout"] = wx.FlexGridSizer(rows=1, cols=1, hgap=2, vgap=5) 253 self.sizers["repolist_layout"] = wx.FlexGridSizer(rows=1, cols=1, hgap=2, vgap=5)
254 self.manifest = manifest 254 self.manifest = manifest
255 255
256 self.id = 0; self.box = {}; self.main = {}; self.container = {}; self.layout = {}
257 self.name = {}; self.url = {}; self.pull = {}; self.uri = {}; self.delete = {}
258 self.defaultcheck = {}; self.default = {}; self.repotrac = {}
259 self.pull_list = {}; self.delete_list = {}; self.defchecklist = {}
260
256 self.BuildRepoList(None) 261 self.BuildRepoList(None)
257 262
258 self.sizers["repolist_layout"].AddGrowableCol(0) 263 self.sizers["repolist_layout"].AddGrowableCol(0)
259 self.sizers["repolist"].Add(self.sizers["repolist_layout"], -1, wx.EXPAND) 264 self.sizers["repolist"].Add(self.sizers["repolist_layout"], -1, wx.EXPAND)
260 self.sizers["repo"].Add(self.sizers["repolist"], (0,0), flag=wx.EXPAND) 265 self.sizers["repo"].Add(self.sizers["repolist"], (0,0), flag=wx.EXPAND)
275 self.Fit() 280 self.Fit()
276 self.Bind(wx.EVT_BUTTON, self.AddRepo, self.buttons['addrepo']) 281 self.Bind(wx.EVT_BUTTON, self.AddRepo, self.buttons['addrepo'])
277 282
278 def BuildRepoList(self, event): 283 def BuildRepoList(self, event):
279 self.repolist = self.manifest.GetList('UpdateManifest', 'repolist', '') 284 self.repolist = self.manifest.GetList('UpdateManifest', 'repolist', '')
280 285 try: self.repolist = self.repo
281 self.id = 0; self.box = {}; self.main = {}; self.container = {}; self.layout = {} 286 except: pass
282 self.name = {}; self.url = {}; self.pull = {}; self.uri = {}; self.delete = {} 287
283 self.defaultcheck = {}; self.default = {}; self.repotrac = {}
284 self.pull_list = {}; self.delete_list = {}; self.defchecklist = {}
285 288
286 #wx.Yeild() For future refrence. 289 #wx.Yeild() For future refrence.
287 290
288 for repo in self.repolist: 291 for repo in self.repolist:
289 self.id += 1 292 self.id += 1
313 self.sizers["repolist_layout"].Insert(0, self.container[self.id], -1, wx.EXPAND) 316 self.sizers["repolist_layout"].Insert(0, self.container[self.id], -1, wx.EXPAND)
314 self.sizers['repolist_layout'].Layout() 317 self.sizers['repolist_layout'].Layout()
315 318
316 def AddRepo(self, event): 319 def AddRepo(self, event):
317 repo = self.texts['reponame'].GetValue(); repo = repo.replace(' ', '_'); repo = 'repo-' + repo 320 repo = self.texts['reponame'].GetValue(); repo = repo.replace(' ', '_'); repo = 'repo-' + repo
318 self.manifest.SetString('updaterepo', repo, ''); repo = repo.split(',') 321 self.manifest.SetString('updaterepo', repo, ''); self.repo = repo.split(',')
319 repolist = self.manifest.GetList('UpdateManifest', 'repolist', '') 322 repolist = self.manifest.GetList('UpdateManifest', 'repolist', '')
320 if repolist == '': 323 if repolist == '':
321 pass 324 pass
322 else: 325 else:
323 repo = repolist + repo 326 repolist = repolist + self.repo
324 self.manifest.SetList('UpdateManifest', 'repolist', repo); print repo 327 self.manifest.SetList('UpdateManifest', 'repolist', repolist)
325 self.BuildRepoList(None) 328 self.BuildRepoList(None)
326 329
327 def RefreshRepo(self, event): 330 def RefreshRepo(self, event):
328 print self.pull_list[event.GetEventObject()] 331 print self.pull_list[event.GetEventObject()]
329 332