Пример #1
0
 def cli_add(self, path):
     print("Loading %s..." %path)
     path = self.fs.selected_get()
     deb = path
     mimetype = mimetypes.guess_type (deb, strict=1)[0]
     print("Starting initial check...")
     if mimetype == "application/x-debian-package":
         try:
             self.deb = debianfile.DebPackage(path, None)
         except:
             return False
         chk_fail = self.deb.check()
         if chk_fail != True:
             print("Initial check failed.")
             self.fs.selected_set(HOME)
             self.fs.path_set(HOME)
             checks.not_installable_popup(self.win, chk_fail)
         else:
             print("Initial check passed.\n")
             self.chk = checks.Checks(path, self.win)
             self.chk.check_file(self.fs, self.win, self.deb)
     elif path == HOME or path == "%s/" %HOME:
         self.fs.selected_set(HOME)
         self.fs.path_set(HOME)
     else:
         print("Invalid file.")
         self.fs.selected_set(HOME)
         self.fs.path_set(HOME)
         checks.generic_error_popup(self.win, "<b>Invalid File Format</><br><br>That is <em>not</> a .deb file!")
     self.n.delete()
Пример #2
0
 def cli_add(self, path):
     logging.info("Loading %s..." % path)
     path = self.fs.selected_get()
     deb = path
     mimetype = mimetypes.guess_type(deb, strict=1)[0]
     logging.info("Starting initial check...")
     if mimetype == "application/x-debian-package":
         deb = debianfile.DebPackage(path, cache=None)
         if deb.check() == False:
             logging.info("Initial check failed.")
             self.fs.selected_set(HOME)
             self.fs.path_set(HOME)
             self.n.delete()
             checks.not_installable_popup(self.win)
             return
         else:
             logging.info("Initial check passed.")
             chk = checks.Checks(path, self.win, end_callback=None)
             chk.check_file(self.fs, self.win)
             self.n.delete()
             return
     elif path == HOME or path == "%s/" % HOME:
         self.fs.selected_set(HOME)
         self.fs.path_set(HOME)
         self.n.delete()
         return
     else:
         logging.info("Invalid file!")
         self.fs.selected_set(HOME)
         self.fs.path_set(HOME)
         checks.file_error_popup(self.win)
         self.n.delete()
         return
     self.et.delete()
Пример #3
0
 def init_check(self, path):
     deb = debianfile.DebPackage(path, cache=None)
     logging.info("Loading %s..." % path)
     logging.info("Starting initial check...")
     if deb.check() == False:
         logging.info("Initial check failed.")
         self.fs.selected_set(HOME)
         self.fs.path_set(HOME)
         checks.not_installable_popup(self.win)
     else:
         logging.info("Initial check passed.")
         chk = checks.Checks(path, self.win, end_callback=None)
         chk.check_file(self.fs, self.win)
     self.n.delete()
     self.et.delete()
Пример #4
0
 def init_check(self, path):
     print("Loading %s..." %path)
     print("Starting initial check...")
     self.deb = debianfile.DebPackage(path, None)
     chk_fail = self.deb.check()
     if chk_fail != True:
         print("Initial check failed.")
         self.fs.selected_set(HOME)
         self.fs.path_set(HOME)
         checks.not_installable_popup(self.win, chk_fail)
     else:
         print("Initial check passed.\n")
         self.chk = checks.Checks(path, self.win)
         self.chk.check_file(self.fs, self.win, self.deb)
     self.n.delete()
     self.et.delete()