Mercurial > traipse_dev
comparison upmana/updatemana.py @ 39:93a27aea09ce traipse_dev
Going to post some daily builds as advancements happen. Repo List now updates.
author | sirebral |
---|---|
date | Wed, 05 Aug 2009 08:16:32 -0500 |
parents | a35f41ebd04e |
children | 95db4430caed |
comparison
equal
deleted
inserted
replaced
38:a35f41ebd04e | 39:93a27aea09ce |
---|---|
253 | 253 |
254 self.sizers["repo"] = wx.GridBagSizer(hgap=2, vgap=2) | 254 self.sizers["repo"] = wx.GridBagSizer(hgap=2, vgap=2) |
255 self.sizers["repolist_layout"] = wx.FlexGridSizer(rows=1, cols=1, hgap=2, vgap=5) | 255 self.sizers["repolist_layout"] = wx.FlexGridSizer(rows=1, cols=1, hgap=2, vgap=5) |
256 self.manifest = manifest | 256 self.manifest = manifest |
257 | 257 |
258 self.BuildRepoList(None) | |
259 | |
260 | |
261 self.sizers["repolist_layout"].AddGrowableCol(0) | |
262 self.sizers["repolist"].Add(self.sizers["repolist_layout"], -1, wx.EXPAND) | |
263 | |
264 self.sizers["repo"].Add(self.sizers["repolist"], (0,0), flag=wx.EXPAND) | |
265 self.sizers["repo"].AddGrowableCol(0) | |
266 self.sizers['repo'].AddGrowableRow(0) | |
267 self.repopanel.SetSizer(self.sizers['repo']) | |
268 self.repopanel.SetAutoLayout(True) | |
269 | |
270 #Build Main Sizer | |
271 self.sizers["main"].Add(self.sizers["newbutton"], (0,0), flag=wx.EXPAND) | |
272 self.sizers["main"].Add(self.repopanel, (1,0), flag=wx.EXPAND) | |
273 self.sizers["main"].AddGrowableCol(0) | |
274 self.sizers["main"].AddGrowableCol(1) | |
275 self.sizers["main"].AddGrowableRow(1) | |
276 self.SetSizer(self.sizers["main"]) | |
277 | |
278 self.SetAutoLayout(True) | |
279 self.Fit() | |
280 | |
281 self.Bind(wx.EVT_BUTTON, self.AddRepo, self.buttons['addrepo']) | |
282 | |
283 def BuildRepoList(self, event): | |
258 self.repolist = [] | 284 self.repolist = [] |
259 for v in self.manifest.GetList('UpdateManifest', 'repolist', ''): self.repolist.append(v) | 285 for v in self.manifest.GetList('UpdateManifest', 'repolist', ''): self.repolist.append(v) |
260 | 286 |
261 self.id = 0; self.box = {}; self.main = {}; self.container = {}; self.layout = {} | 287 self.id = 0; self.box = {}; self.main = {}; self.container = {}; self.layout = {} |
262 self.name = {}; self.url = {}; self.pull = {}; self.uri = {}; self.delete = {} | 288 self.name = {}; self.url = {}; self.pull = {}; self.uri = {}; self.delete = {} |
263 self.defaultcheck = {}; self.default = {}; self.repotrac = {}; self.pull_list = {} | 289 self.defaultcheck = {}; self.default = {}; self.repotrac = {} |
290 self.pull_list = {}; self.delete_list = {}; self.defchecklist = {} | |
264 | 291 |
265 #wx.Yeild() For future refrence. | 292 #wx.Yeild() For future refrence. |
266 | 293 |
267 #Repo Name; Static Text; URL; Button. | 294 #Repo Name; Static Text; URL; Button. |
268 for repo in self.repolist: | 295 for repo in self.repolist: |
269 self.id += 1 | 296 self.id += 1 |
270 self.box[self.id] = wx.StaticBox(self.repopanel, -1, str(repo)) | 297 self.box[self.id] = wx.StaticBox(self.repopanel, -1, str(repo)) |
271 self.main[self.id] = wx.GridBagSizer(hgap=2, vgap=2) | 298 self.main[self.id] = wx.GridBagSizer(hgap=2, vgap=2) |
272 self.container[self.id] = wx.StaticBoxSizer(self.box[self.id], wx.VERTICAL) | 299 self.container[self.id] = wx.StaticBoxSizer(self.box[self.id], wx.VERTICAL) |
273 | |
274 self.layout[self.id] = wx.FlexGridSizer(rows=1, cols=4, hgap=2, vgap=5) | 300 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') | 301 self.name[self.id] = wx.StaticText(self.repopanel, -1, 'URL') |
276 self.uri[self.id] = self.manifest.GetString('updaterepo', repo, '') | 302 self.uri[self.id] = self.manifest.GetString('updaterepo', repo, '') |
277 self.url[self.id] = wx.TextCtrl(self.repopanel, -1, self.uri[self.id]) | 303 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) | 304 self.pull[self.id] = wx.Button(self.repopanel, wx.ID_REFRESH) |
279 self.pull_list[self.pull[self.id]] = self.id | 305 self.pull_list[self.pull[self.id]] = self.id |
280 self.delete[self.id] = wx.Button(self.repopanel, wx.ID_DELETE) | 306 self.delete[self.id] = wx.Button(self.repopanel, wx.ID_DELETE) |
307 self.delete_list[self.delete[self.id]] = self.id | |
281 self.defaultcheck[self.id] = wx.CheckBox(self.repopanel, -1) | 308 self.defaultcheck[self.id] = wx.CheckBox(self.repopanel, -1) |
309 self.defchecklist[self.defaultcheck[self.id]] = self.id | |
282 self.default[self.id] = wx.StaticText(self.repopanel, -1, 'Default') | 310 self.default[self.id] = wx.StaticText(self.repopanel, -1, 'Default') |
283 | |
284 self.layout[self.id].Add(self.name[self.id], -1, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL) | 311 self.layout[self.id].Add(self.name[self.id], -1, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL) |
285 self.layout[self.id].Add(self.url[self.id], -1, wx.EXPAND) | 312 self.layout[self.id].Add(self.url[self.id], -1, wx.EXPAND) |
286 self.layout[self.id].Add(self.pull[self.id], -1, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.ALL) | 313 self.layout[self.id].Add(self.pull[self.id], -1, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.ALL) |
287 self.layout[self.id].Add(self.delete[self.id], -1, wx.EXPAND) | 314 self.layout[self.id].Add(self.delete[self.id], -1, wx.EXPAND) |
288 self.layout[self.id].Add(self.defaultcheck[self.id], -1, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.ALL) | 315 self.layout[self.id].Add(self.defaultcheck[self.id], -1, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL|wx.ALL) |
289 self.layout[self.id].Add(self.default[self.id], -1, wx.EXPAND) | 316 self.layout[self.id].Add(self.default[self.id], -1, wx.EXPAND) |
290 self.layout[self.id].AddGrowableCol(1) | 317 self.layout[self.id].AddGrowableCol(1) |
291 self.container[self.id].Add(self.layout[self.id], -1, wx.EXPAND) | 318 self.container[self.id].Add(self.layout[self.id], -1, wx.EXPAND) |
292 self.Bind(wx.EVT_BUTTON, self.RefreshRepo, self.pull[self.id]) | 319 self.Bind(wx.EVT_BUTTON, self.RefreshRepo, self.pull[self.id]) |
293 self.sizers["repolist_layout"].Add(self.container[self.id], -1, wx.EXPAND) | 320 self.sizers["repolist_layout"].Insert(0, self.container[self.id], -1, wx.EXPAND) |
294 | 321 self.sizers['repolist_layout'].Layout() |
295 self.sizers["repolist_layout"].AddGrowableCol(0) | 322 |
296 self.sizers["repolist"].Add(self.sizers["repolist_layout"], -1, wx.EXPAND) | |
297 | |
298 self.sizers["repo"].Add(self.sizers["repolist"], (0,0), flag=wx.EXPAND) | |
299 self.sizers["repo"].AddGrowableCol(0) | |
300 self.sizers['repo'].AddGrowableRow(0) | |
301 self.repopanel.SetSizer(self.sizers['repo']) | |
302 self.repopanel.SetAutoLayout(True) | |
303 | |
304 #Build Main Sizer | |
305 self.sizers["main"].Add(self.sizers["newbutton"], (0,0), flag=wx.EXPAND) | |
306 self.sizers["main"].Add(self.repopanel, (1,0), flag=wx.EXPAND) | |
307 self.sizers["main"].AddGrowableCol(0) | |
308 self.sizers["main"].AddGrowableCol(1) | |
309 self.sizers["main"].AddGrowableRow(1) | |
310 self.SetSizer(self.sizers["main"]) | |
311 | |
312 self.SetAutoLayout(True) | |
313 self.Fit() | |
314 | |
315 self.Bind(wx.EVT_BUTTON, self.AddRepo, self.buttons['addrepo']) | |
316 | 323 |
317 def AddRepo(self, event): | 324 def AddRepo(self, event): |
318 repo = self.texts['reponame'].GetValue(); repo = repo.replace(' ', '_'); repo = 'repo-' + repo | 325 repo = self.texts['reponame'].GetValue(); repo = repo.replace(' ', '_'); repo = 'repo-' + repo |
319 self.manifest.SetString('updaterepo', repo, ''); repo = repo.split(',') | 326 self.manifest.SetString('updaterepo', repo, ''); repo = repo.split(',') |
320 repolist = self.manifest.GetList('UpdateManifest', 'repolist', ''); repo = repolist + repo | 327 repolist = self.manifest.GetList('UpdateManifest', 'repolist', ''); repo = repolist + repo |
321 self.manifest.SetList('UpdateManifest', 'repolist', repo) | 328 self.manifest.SetList('UpdateManifest', 'repolist', repo) |
329 self.BuildRepoList(None) | |
322 | 330 |
323 def RefreshRepo(self, event): | 331 def RefreshRepo(self, event): |
324 print self.pull_list[event.GetEventObject()] | 332 print self.pull_list[event.GetEventObject()] |
325 | 333 |
326 class Manifest(wx.Panel): | 334 class Manifest(wx.Panel): |