Exemplo n.º 1
0
    def get_installed_package_newest_version(cls, package_name, engine=None):
        localdb = LocalPackagesDatabase(cls.get_local_database_path())
        packages = localdb.get_packages()
        keys = packages.keys()
        keys.sort()
        keys.reverse()
        package_list = []
        for key in keys:
            package_data = packages[key]
            if package_data["name"] == package_name:
                package_list.append(package_data)

        n = len(package_list)
        if n < 1:
            return

        if not engine is None:
            package_list = get_packages_adapt_engine(package_list, engine)
            if package_list is None:
                return

        package_newest = package_list[0]
        for x in xrange(1, n - 1):
            package_newest = get_newer_package(package_list[x], package_newest)

        return package_newest
Exemplo n.º 2
0
    def get_installed_package_newest_version(cls, package_name, engine=None):
        localdb = LocalPackagesDatabase(cls.get_local_database_path())
        packages = localdb.get_packages()
        keys = packages.keys()
        keys.sort()
        keys.reverse()
        package_list = []
        for key in keys:
            package_data = packages[key]
            if package_data["name"] == package_name:
                package_list.append(package_data)

        n = len(package_list)
        if n < 1:
            return

        if not engine is None:
            package_list = get_packages_adapt_engine(package_list, engine)
            if package_list is None:
                return

        package_newest = package_list[0]
        for x in xrange(1, n - 1):
            package_newest = get_newer_package(package_list[x], package_newest)

        return package_newest
Exemplo n.º 3
0
 def get_installed_package_data(cls, package_name):
     localdb = LocalPackagesDatabase(cls.get_local_database_path())
     packages = localdb.get_packages()
     keys = packages.keys()
     keys.sort()
     keys.reverse()
     for key in keys:
         package_data = packages[key]
         if package_data["name"] == package_name:
             return package_data
Exemplo n.º 4
0
 def get_installed_package_data(cls, package_name):
     localdb = LocalPackagesDatabase(cls.get_local_database_path())
     packages = localdb.get_packages()
     keys = packages.keys()
     keys.sort()
     keys.reverse()
     for key in keys:
         package_data = packages[key]
         if package_data["name"] == package_name:
             return package_data
Exemplo n.º 5
0
 def get_installed_packages(cls):
     localdb = LocalPackagesDatabase(cls.get_local_database_path())
     return localdb.get_packages()
Exemplo n.º 6
0
 def add_package(cls, package_data):
     localdb = LocalPackagesDatabase(cls.get_local_database_path())
     localdb.add_package(package_data)
Exemplo n.º 7
0
 def get_installed_packages(cls):
     localdb = LocalPackagesDatabase(cls.get_local_database_path())
     return localdb.get_packages()
Exemplo n.º 8
0
 def add_package(cls, package_data):
     localdb = LocalPackagesDatabase(cls.get_local_database_path())
     localdb.add_package(package_data)