Esempio n. 1
0
File: cli.py Progetto: advaithm/aipm
 def uninstall(self, ainame):
     ail = appimagelibrary.AppImageLibrary(
         self.configuration["libraryLocation"])
     ai = ail.select(ainame)
     ai.uninstall(self.configuration["AppImageLocation"])
     ail.addItem(ai)
     return 0
Esempio n. 2
0
File: cli.py Progetto: advaithm/aipm
 def update(self, inputfile=None):
     gh_creds = (self.configuration["gh_login"],
                 self.configuration["gh_token"])
     ail = appimagelibrary.AppImageLibrary(
         self.configuration["libraryLocation"])
     ail.update(gh_creds, filename=inputfile)
     return 0
Esempio n. 3
0
File: cli.py Progetto: advaithm/aipm
    def scrape(self):
        answer = None

        answer = input(
            'This feature is deprecated, and is not maintained. You\'re going to have a better experience with the "update" command. Continue? [y/N]\n'
        )

        if answer.lower() == "y":
            ail = appimagelibrary.AppImageLibrary(
                self.configuration["libraryLocation"])

            gh_creds = (self.configuration["gh_login"],
                        self.configuration["gh_token"])
            ail.scrapeLibrary(gh_creds)
            return 0
        else:
            return 0
Esempio n. 4
0
File: cli.py Progetto: advaithm/aipm
    def install(self, appimageName):
        ail = appimagelibrary.AppImageLibrary(
            self.configuration["libraryLocation"])
        ai = ail.select(appimageName)
        if ai == None:
            return 1
        if self.configuration["AppImageLocation"]:
            downloadsDir = self.configuration["AppImageLocation"]
        else:
            downloadsDir = f"/home/{config.username}/bin"

        if os.path.isdir(downloadsDir) == False:
            logging.critical(
                f"Downloads directory {downloadsDir} does not exist")
            return 1
        elif os.path.isdir("/".join([downloadsDir, ".apps"])) == False:
            os.makedirs("/".join([downloadsDir, ".apps"]))

        ai.downloadAppImage(downloadsDir)

        ail.addItem(ai)

        return 0
Esempio n. 5
0
File: cli.py Progetto: advaithm/aipm
 def clean(self, ainame):
     ail = appimagelibrary.AppImageLibrary(
         self.configuration["libraryLocation"])
     ail.clean(self.configuration["AppImageLocation"], ainame)
     return 0
Esempio n. 6
0
File: cli.py Progetto: advaithm/aipm
 def importJson(self, inputFile):
     ail = appimagelibrary.AppImageLibrary(
         self.configuration["libraryLocation"])
     ail.importJSON(inputFile)
     return 0
Esempio n. 7
0
File: cli.py Progetto: advaithm/aipm
 def search(self, searchTerm):
     ail = appimagelibrary.AppImageLibrary(
         self.configuration["libraryLocation"])
     ail.search(searchTerm)
     return 0
Esempio n. 8
0
File: cli.py Progetto: advaithm/aipm
 def export(self):
     ail = appimagelibrary.AppImageLibrary(
         self.configuration["libraryLocation"])
     if ail.exportJSON() == 0:
         print(f"Library exported as {os.getcwd()}/library.json")
     return 0