← Back to team overview

keryx team mailing list archive

[Merge] lp:~jacseen/keryx/un-install into lp:keryx/unstable

 

Jack N has proposed merging lp:~jacseen/keryx/un-install into lp:keryx/unstable.

    Requested reviews:
    Keryx Admins (keryx-admins)


some new improvements
Branch format 2a (launchpad: Branch format 7)
hope it doesn't cause problem
-- 
https://code.launchpad.net/~jacseen/keryx/un-install/+merge/17712
Your team Keryx Development Team is subscribed to branch lp:keryx/unstable.
=== modified file 'lib/wxkeryx/main.py'
--- lib/wxkeryx/main.py	2010-01-17 00:52:51 +0000
+++ lib/wxkeryx/main.py	2010-01-20 02:42:13 +0000
@@ -356,7 +356,13 @@
         if result == wx.ID_CANCEL:
             return
 
-        # Start the installation
+        # Get the necessary information for package installation
+        projdir = project.projects[len(project.projects) -1].dir
+        spacksdir = os.path.join(projdir, 'packages')
+        spacks = [x for x in os.listdir(spacksdir) if os.path.isfile(os.path.join(spacksdir, x)) and (os.path.splitext(x)[1] == '.deb')]
+        packnames = sorted([x[:x.find('_')] for x in spacks])
+
+        # Transfer the packages first to the cache
         install = project.projects[len(project.projects) - 1].plugin.installCache(project.projects[len(project.projects) -1].dir, 'installcache', move=move)
 
         if install:  # If installCache was successful...
@@ -380,12 +386,6 @@
         if result == wx.ID_NO:  
             return
 
-        # Get the necessary information for package installation
-        projdir = project.projects[len(project.projects) -1].dir
-        spacksdir = os.path.join(projdir, 'packages')
-        spacks = [x for x in os.listdir(spacksdir) if os.path.isfile(os.path.join(spacksdir, x)) and (os.path.splitext(x)[1] == '.deb')]
-        packnames = sorted([x[:x.find('_')] for x in spacks])
-
         # Ask what packages need to be installed
         items = dict([(num+1, pkg) for (num, pkg) in zip(range(len(packnames)), packnames)])
         dlg = SelectPackagesDialog(None, -1, _("Install Project"), items)
@@ -397,6 +397,7 @@
         if result == wx.ID_CANCEL:
             return
 
+        # Start the installation
         result = project.projects[len(project.projects) - 1].plugin.installPacks(' '.join(packnames))
         if result:
             wx.MessageBox(_("Package installation finished."), 
@@ -462,7 +463,7 @@
 #        dlg.Destroy()
 
     def OnUpdateStatus(self, event):
-        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" + \
+        dlg = wx.MessageDialog(None, _("This will update Keryx about which packages are installed on your computer. Only run this on the computer you created this project on.\n\n" + \
                           "Would you like to continue?"),
                           _("Update Status"), wx.YES_NO | wx.ICON_QUESTION)
         result = dlg.ShowModal()
@@ -478,6 +479,9 @@
                           _("Status Update Failed"), wx.ICON_ERROR)
             result = dlg.ShowModal()
             dlg.Destroy()
+        else:
+            self.loadLocal()
+
     def UpdateStatus(self):
         project_dir = project.projects[len(project.projects) -1].dir
         return project.projects[len(project.projects) - 1].plugin.updateStatus(project_dir)


Follow ups