Example #1
0
 def start(self):
     if self.local:
         try:
             zf = pyos.ZipFile(self.name, "r")
             zf.extract("app.json", "temp/")
             self.path = self.name
             jd = readJSON("temp/app.json")
             self.name = jd["name"]
             if jd.get("pman", {}).get("min_os",
                                       0.0) > pman.sysInf.get("version"):
                 pyos.GUI.ErrorDialog(
                     "The package requires a newer version of Python OS."
                 ).display()
                 return
         except:
             pyos.GUI.ErrorDialog(
                 "The file " + self.name +
                 " is not a valid Python OS ZIP File.").display()
             return
     pyos.GUI.YNDialog(
         "Install",
         "Are you sure you want to install the package " + self.name +
         "? This will install the app and any unmet dependencies.",
         self.confirm).display()
     self.dialog = ProgressDialog()
Example #2
0
 def package(self, path):
     state.getGUI().displayStandbyText("Creating " + path)
     zf = pyos.ZipFile(path, "w")
     for itm in pyos.os.listdir(pyos.os.path.join("apps", self.app)):
         zf.write(pyos.os.path.join("apps", self.app, itm), itm)
     zf.close()
     pyos.GUI.OKDialog(
         "Package Created",
         "The app " + self.app + " has been packaged to " + path).display()