Merge lp://staging/keryx/unstable into lp://staging/~jacseen/keryx/unstable

Proposed by mac9416
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/keryx/unstable
Merge into: lp://staging/~jacseen/keryx/unstable
Diff against target: 259 lines (+76/-30)
3 files modified
doc/keryx.conf (+1/-1)
lib/wxkeryx/main.py (+61/-27)
plugins/Debian.py (+14/-2)
To merge this branch: bzr merge lp://staging/keryx/unstable
Reviewer Review Type Date Requested Status
Jack N Approve
mac9416 (community) Needs Fixing
Review via email: mp+15066@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
mac9416 (mac9416) wrote :

Hey, jacseen, I made a few improvements to the Update Status feature. It now uses your __runRoot function. Hopefully this doesn't conflict with any of your recent changes.

Revision history for this message
mac9416 (mac9416) wrote :

It appears I broke one or two lines. I can fix them and resubmit if you want, or you can merge and fix them yourself. Your call. :)

review: Needs Fixing
Revision history for this message
Jack N (jacseen) wrote :

Not sure which lines you broke, but looks good and runs good. :D

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'doc/keryx.conf'
--- doc/keryx.conf 2009-10-31 01:55:19 +0000
+++ doc/keryx.conf 2009-11-25 03:06:10 +0000
@@ -10,7 +10,7 @@
10#### Examples ####10#### Examples ####
1111
12#LogDir=../logs12#LogDir=../logs
13#LocaleDir=../locales13#LocaleDir=../locale
14#PackagesDir=../packages14#PackagesDir=../packages
15#PixmapsDir=../pixmaps15#PixmapsDir=../pixmaps
16#PluginsDir=../plugins16#PluginsDir=../plugins
1717
=== modified file 'lib/wxkeryx/main.py'
--- lib/wxkeryx/main.py 2009-11-18 03:56:58 +0000
+++ lib/wxkeryx/main.py 2009-11-25 03:06:10 +0000
@@ -42,7 +42,7 @@
42 self.downloadButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_download), _("Download"))#, size=(95, 25))42 self.downloadButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_download), _("Download"))#, size=(95, 25))
43 self.updatesButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_updates), _("Get Updates"))#, size=(95, 25))43 self.updatesButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_updates), _("Get Updates"))#, size=(95, 25))
44 self.refreshButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_refresh), _("Refresh"))#, size=(95, 25))44 self.refreshButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_refresh), _("Refresh"))#, size=(95, 25))
45 self.updateStatusButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_refresh), _("Update Status"))#, size=(95, 25))45 #self.updateStatusButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_refresh), _("Update Status"))#, size=(95, 25))
4646
47 self.notebook_il = wx.ImageList(16, 16)47 self.notebook_il = wx.ImageList(16, 16)
48 self.notebook_il.Add(wx.Bitmap(consts.icon_project_details))48 self.notebook_il.Add(wx.Bitmap(consts.icon_project_details))
@@ -171,7 +171,7 @@
171171
172 self.Bind(wx.EVT_BUTTON, self.OnDownload, self.downloadButton)172 self.Bind(wx.EVT_BUTTON, self.OnDownload, self.downloadButton)
173 self.Bind(wx.EVT_BUTTON, self.OnRefresh, self.refreshButton)173 self.Bind(wx.EVT_BUTTON, self.OnRefresh, self.refreshButton)
174 self.Bind(wx.EVT_BUTTON, self.OnUpdateStatus, self.updateStatusButton)174 #self.Bind(wx.EVT_BUTTON, self.OnUpdateStatus, self.updateStatusButton)
175 self.Bind(wx.EVT_BUTTON, self.OnUpdates, self.updatesButton)175 self.Bind(wx.EVT_BUTTON, self.OnUpdates, self.updatesButton)
176 self.Bind(wx.EVT_CLOSE, self.Closing)176 self.Bind(wx.EVT_CLOSE, self.Closing)
177177
@@ -194,7 +194,7 @@
194 sizer_buttons.Add(self.downloadButton, 0, wx.ALL, 3)194 sizer_buttons.Add(self.downloadButton, 0, wx.ALL, 3)
195 sizer_buttons.Add(self.updatesButton, 0, wx.ALL, 3)195 sizer_buttons.Add(self.updatesButton, 0, wx.ALL, 3)
196 sizer_buttons.Add(self.refreshButton, 0, wx.ALL, 3)196 sizer_buttons.Add(self.refreshButton, 0, wx.ALL, 3)
197 sizer_buttons.Add(self.updateStatusButton, 0, wx.ALL, 3)197 #sizer_buttons.Add(self.updateStatusButton, 0, wx.ALL, 3)
198 #sizer_bottom.Add(sizer_buttons, 0, wx.ALIGN_CENTER_VERTICAL, 0)198 #sizer_bottom.Add(sizer_buttons, 0, wx.ALIGN_CENTER_VERTICAL, 0)
199 self.buttonPanel.SetSizer(sizer_buttons)199 self.buttonPanel.SetSizer(sizer_buttons)
200200
@@ -303,24 +303,22 @@
303 try:303 try:
304 selected = self.list.GetSelectedItem()304 selected = self.list.GetSelectedItem()
305 if selected: files = project.projects[len(project.projects) - 1].getDependencies(selected[1])305 if selected: files = project.projects[len(project.projects) - 1].getDependencies(selected[1])
306 except: return306 except:
307 return
307308
308 # Generate filename list, max 6 entries309 # Generate filename list.
309 list = "\n\n"310 list = ""
310 for i in range(len(files)): 311 for i in range(len(files)):
311 if i <= 5: list += files[i][0] + "\n"312 list += files[i][0] + "\n"
312 else:
313 list += "..."
314 break
315313
316 # Confirm downloads314 # Confirm downloads
317 dlg = wx.MessageDialog(None, _("Do you wish to download the following") + " " + str(len(files)) + " " + _("files?") + list,315 dlg = ScrolledMessageDialog(None, _("Confirm Download"), _("Do you wish to download the following") + " " + str(len(files)) + " " + _("files?"), list)
318 _("Confirm Downloads"), wx.YES_NO | wx.ICON_QUESTION)316 #dlg = wx.MessageDialog(None, _("Do you wish to download the following") + " " + str(len(files)) + " " + _("files?") + list, _("Confirm Downloads"), wx.YES_NO | wx.ICON_QUESTION)
319 result = dlg.ShowModal()317 result = dlg.ShowModal() == wx.ID_OK
320 dlg.Destroy()318 dlg.Destroy()
321 319
322 # User doesn't want to download them320 # User doesn't want to download them
323 if result == wx.ID_NO: 321 if not result:
324 self.Refresh(project.projects[len(project.projects) -1].GetData())322 self.Refresh(project.projects[len(project.projects) -1].GetData())
325 #self.downloadedLists()323 #self.downloadedLists()
326 return 324 return
@@ -371,7 +369,7 @@
371 else:369 else:
372 move = False370 move = False
373 #wx.MessageBox(_("This feature is not implemented yet. Sorry."),_("Not Implemented"))371 #wx.MessageBox(_("This feature is not implemented yet. Sorry."),_("Not Implemented"))
374 install = project.projects[len(project.projects) - 1].installCache(project.projects[len(project.projects) -1].dir, 'installcache', move=move)372 install = project.projects[len(project.projects) - 1].plugin.installCache(project.projects[len(project.projects) -1].dir, 'installcache', move=move)
375 elif result == wx.ID_NO:373 elif result == wx.ID_NO:
376 wx.MessageBox(_("This feature is not implemented yet. Sorry."),_("Not Implemented"))374 wx.MessageBox(_("This feature is not implemented yet. Sorry."),_("Not Implemented"))
377 #install = project.projects[len(project.projects) - 1].installRepo()375 #install = project.projects[len(project.projects) - 1].installRepo()
@@ -433,18 +431,22 @@
433# dlg.Destroy()431# dlg.Destroy()
434432
435 def OnUpdateStatus(self, event):433 def OnUpdateStatus(self, event):
434 dlg = wx.MessageDialog(None, _("This will update the list of packages installed on your computer. Only run this on the computer you created this project on.\n\n" + \
435 "Would you like to continue?"),
436 _("Update Status"), wx.YES_NO | wx.ICON_QUESTION)
437 result = dlg.ShowModal()
438 dlg.Destroy()
439 if not result:
440 return
436 if not self.UpdateStatus():441 if not self.UpdateStatus():
437 print 'Could not update status file. Not on a Debian machine?'442 dlg = wx.MessageDialog(None, _("Status update failed. Try running Keryx as root (using 'sudo')."),
443 _("Status Update Failed"), wx.ICON_ERROR)
444 result = dlg.ShowModal()
445 dlg.Destroy()
438 def UpdateStatus(self):446 def UpdateStatus(self):
439 import shutil447 project_dir = project.projects[len(project.projects) -1].dir
440 project_dir = project.projects[len(project.projects) -1].GetData()[1]448 return project.projects[len(project.projects) - 1].plugin.updateStatus(project_dir)
441 lists_dir = os.path.join(project_dir, 'lists')449
442 try:
443 shutil.copyfile('/var/lib/dpkg/status', os.path.join(lists_dir, 'status'))
444 shutil.copyfile('/var/lib/dpkg/status', os.path.join(lists_dir, 'status.bak'))
445 return True # Everything went well.
446 except IOError:
447 return False
448450
449 def OnRefresh(self, event): 451 def OnRefresh(self, event):
450 self.Refresh(project.projects[len(project.projects) -1].GetData())452 self.Refresh(project.projects[len(project.projects) -1].GetData())
@@ -489,4 +491,36 @@
489491
490 self.SetStatusText(str(len(proj.packages.keys())) + " " + _("Packages"),0)492 self.SetStatusText(str(len(proj.packages.keys())) + " " + _("Packages"),0)
491493
492# end of class MainApp494# end of class MainApp
495
496# Begin mac9416's wonderful custom dialog!
497
498class ScrolledMessageDialog(wx.Dialog):
499 def __init__(self, parent, title, caption, msg,
500 pos=wx.DefaultPosition, size=(500,300),
501 style=wx.DEFAULT_DIALOG_STYLE):
502 wx.Dialog.__init__(self, parent, -1, title, pos, size, style)
503 x, y = pos
504 if x == -1 and y == -1:
505 self.CenterOnScreen(wx.BOTH)
506
507 text1 = wx.StaticText(self, -1, caption)
508 text2 = wx.TextCtrl(self, -1, msg, size=(500,300),
509 style=wx.TE_MULTILINE | wx.TE_READONLY)
510
511 sizer = wx.BoxSizer(wx.VERTICAL)
512
513 btnsizer = wx.BoxSizer()
514
515 btn = wx.Button(self, wx.ID_OK, "Yes")
516 btnsizer.Add(btn, 0, wx.ALL, 5)
517 btnsizer.Add((5,-1), 0, wx.ALL, 5)
518
519 btn = wx.Button(self, wx.ID_CANCEL, "No")
520 btn.SetDefault()
521 btnsizer.Add(btn, 0, wx.ALL, 5)
522
523 sizer.Add(text1, 0, wx.EXPAND|wx.ALL, 5)
524 sizer.Add(text2, 0, wx.EXPAND|wx.ALL, 5)
525 sizer.Add(btnsizer, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
526 self.SetSizerAndFit(sizer)
493527
=== added directory 'locale'
=== added directory 'locale/ar'
=== added directory 'locale/ar/LC_MESSAGES'
=== added file 'locale/ar/LC_MESSAGES/keryx.mo'
494Binary files locale/ar/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/ar/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ528Binary files locale/ar/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/ar/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ
=== added directory 'locale/cs'
=== added directory 'locale/cs/LC_MESSAGES'
=== added file 'locale/cs/LC_MESSAGES/keryx.mo'
495Binary files locale/cs/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/cs/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ529Binary files locale/cs/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/cs/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ
=== added directory 'locale/en_CA'
=== added directory 'locale/en_CA/LC_MESSAGES'
=== added file 'locale/en_CA/LC_MESSAGES/keryx.mo'
496Binary files locale/en_CA/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/en_CA/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ530Binary files locale/en_CA/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/en_CA/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ
=== added directory 'locale/es'
=== added directory 'locale/es/LC_MESSAGES'
=== added file 'locale/es/LC_MESSAGES/keryx.mo'
497Binary files locale/es/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/es/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ531Binary files locale/es/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/es/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ
=== added directory 'locale/fr'
=== added directory 'locale/fr/LC_MESSAGES'
=== added file 'locale/fr/LC_MESSAGES/keryx.mo'
498Binary files locale/fr/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/fr/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ532Binary files locale/fr/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/fr/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ
=== added directory 'locale/id'
=== added directory 'locale/id/LC_MESSAGES'
=== added file 'locale/id/LC_MESSAGES/keryx.mo'
499Binary files locale/id/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/id/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ533Binary files locale/id/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/id/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ
=== added directory 'locale/ml'
=== added directory 'locale/ml/LC_MESSAGES'
=== added file 'locale/ml/LC_MESSAGES/keryx.mo'
500Binary files locale/ml/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/ml/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ534Binary files locale/ml/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/ml/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ
=== added directory 'locale/nb'
=== added directory 'locale/nb/LC_MESSAGES'
=== added file 'locale/nb/LC_MESSAGES/keryx.mo'
501Binary files locale/nb/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/nb/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ535Binary files locale/nb/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/nb/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ
=== added directory 'locale/pt'
=== added directory 'locale/pt/LC_MESSAGES'
=== added file 'locale/pt/LC_MESSAGES/keryx.mo'
502Binary files locale/pt/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/pt/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ536Binary files locale/pt/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/pt/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ
=== added directory 'locale/pt_BR'
=== added directory 'locale/pt_BR/LC_MESSAGES'
=== added file 'locale/pt_BR/LC_MESSAGES/keryx.mo'
503Binary files locale/pt_BR/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/pt_BR/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ537Binary files locale/pt_BR/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/pt_BR/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ
=== added directory 'locale/ru'
=== added directory 'locale/ru/LC_MESSAGES'
=== added file 'locale/ru/LC_MESSAGES/keryx.mo'
504Binary files locale/ru/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/ru/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ538Binary files locale/ru/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/ru/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ
=== added directory 'locale/si'
=== added directory 'locale/si/LC_MESSAGES'
=== added file 'locale/si/LC_MESSAGES/keryx.mo'
505Binary files locale/si/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/si/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ539Binary files locale/si/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/si/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ
=== added directory 'locale/sv'
=== added directory 'locale/sv/LC_MESSAGES'
=== added file 'locale/sv/LC_MESSAGES/keryx.mo'
506Binary files locale/sv/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/sv/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ540Binary files locale/sv/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/sv/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ
=== added directory 'locale/th'
=== added directory 'locale/th/LC_MESSAGES'
=== added file 'locale/th/LC_MESSAGES/keryx.mo'
507Binary files locale/th/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/th/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ541Binary files locale/th/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/th/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ
=== modified file 'plugins/Debian.py'
--- plugins/Debian.py 2009-11-18 03:56:58 +0000
+++ plugins/Debian.py 2009-11-25 03:06:10 +0000
@@ -258,7 +258,7 @@
258 else:258 else:
259 transfer=''259 transfer=''
260 print 'Launching installCache script as root'260 print 'Launching installCache script as root'
261 run = __runRoot('sh', scriptpath+' '+projdir+' '+transfer)261 run = self.__runRoot('sh', scriptpath+' '+projdir+' '+transfer)
262 if run[0] != 0:262 if run[0] != 0:
263 print run[1]263 print run[1]
264 if run[0] == 64:264 if run[0] == 64:
@@ -281,6 +281,18 @@
281 """ Transfers all downloaded packages into a Repository and updates the OS about it, then tells it to install them. Uses script called as 'root'"""281 """ Transfers all downloaded packages into a Repository and updates the OS about it, then tells it to install them. Uses script called as 'root'"""
282 return True282 return True
283283
284 def updateStatus(self, outdir, infile="/var/lib/dpkg/status"):
285 """Update the project's status file (list of installed packages)"""
286 import shutil
287 lists_dir = os.path.join(outdir, 'lists')
288 outfile = os.path.join(lists_dir, "status")
289 outfilebak = os.path.join(lists_dir, "status.bak")
290 # Back up the current status file.
291 run = self.__runRoot('cp', '%s %s' % (outfile, outfilebak))
292 # Copy in the new status file.
293 run = self.__runRoot('cp', '%s %s' % (infile, outfile))
294 return True # Everything went well.
295
284 def __readPackages(self, infile, installed, packages, mainUrl=''):296 def __readPackages(self, infile, installed, packages, mainUrl=''):
285 # up-to-date, name, installed ver, latest ver, descrip, depends, filename, size(int)297 # up-to-date, name, installed ver, latest ver, descrip, depends, filename, size(int)
286 current = ['','','','','','','','','','']298 current = ['','','','','','','','','','']
@@ -450,7 +462,7 @@
450 root = a462 root = a
451 break463 break
452 if root == '': return 64, ''464 if root == '': return 64, ''
453 exit = commands.getstatusoutput(root+' '+program+' '+filename)465 exit = commands.getstatusoutput('%s %s %s' % (root, program, filename))
454 return exit466 return exit
455467
456class version_compare:468class version_compare:
457469
=== modified file 'projects/jaunty-32-bit-default/lists/status' (properties changed: +x to -x)
=== modified file 'projects/jaunty-32-bit-default/sources/sources.list' (properties changed: +x to -x)

Subscribers

People subscribed via source and target branches