Commits

Moises Henriquez  committed f9c694f

Started implementing error checking

  • Participants
  • Parent commits 20a6d8d

Comments (0)

Files changed (2)

     proc = sp.Popen(
             cmd.split(),
             stdout = sp.PIPE,
-            stderr = sp.STDOUT,
+            stderr = sp.PIPE,
             )
     return proc
 
         proc = _get_popen(
                 "%s -c %s -y -u"% (self.manager,
                     self.configfile))
-        out = proc.communicate()
+        out = proc.communicate(),proc.returncode
         return out
 
     def install_package(self, pkgname):
                 "%s -c %s -y -i %s"% (self.manager,
                     self.configfile, 
                     pkgname))
-        out = proc.communicate()
+        out = proc.communicate(),proc.returncode
         return out
 
     def remove_package(self, package = str, rdeps = False):
             raise NotImplemented
         else:
             proc = _get_popen("removepkg %s"% package)
-            out = proc.communicate()
+            out = proc.communicate(), proc.returncode
             return out
 
     def restore_package(self, pkgname):

File view/dialog.py

         banner = gtk.Label(
                 _('Please wait while the following tasks complete')
                 )
+        self.banner = banner
         blank = gtk.Label()
         self.progress = gtk.ProgressBar()
         self.status = gtk.Label()
                 )
         gtk.gdk.threads_leave()
         i = self.packagemanager.update_cache()
+
         # FIXME: ^^ Error checking ??? ^^
         #print i
-
+        # ====== Brief error checking ======
+        if i[1] > 0:
+            # Something went wrong during cache update
+            pass
+        
         self._icurrent = 0.0
         for pkg in self.pkglist:
             self.current = pkg
             # output.
 #            time.sleep(3)
             ret = self.packagemanager.install_package(pkg)
+            
+            # === Brief Error Checking ========
+            if ret[1] > 0 or ret[0][1] is not None:
+                print 'Error installing %s'%pkg
+                print ret[0][1]
+#            print ret[1]
+#            print ret[0][1]
             # FIXME: ^^ Error checking ?? ^^
 #            print ret
             self._icurrent += 1
             self.progress.pulse()
 #            self.progress.set_fraction(val)
             self.progress.set_text('%i'% (val * 100) + ' %')
+            self.banner.set_property('label',
+                    _('Installation complete'))
+            self.status.set_property('label',
+                    _('The software you selected has been installed'))
             gtk.gdk.threads_leave()
             time.sleep(0.1)
         gtk.gdk.threads_enter()