Example #1
0
    def onLoadFile(self):
        self.clear()
        self.mode = self.onLoadFile

        filename = askopenfilename()
        if filename:
            items_dict = {}
            query_list = []

            with open(filename) as f:
                distros = pkg_resources.Environment()
                for line in f:
                    line_list = line.split()
                    if line_list:
                        key = line_list[0].lower()
                        if re.match('^[a-z][a-z0-9]*$',
                                    key):  # lower_case_with_underscores
                            query_list.append(key)
                            dist = distros[key]
                            dist = dist[0] if dist else None
                            self.append_item(items_dict, key, dist)

            self.listbox.insert_items(items_dict)
            self.status.setText("Updating cache...")
            pipcache.query_info(query_list, self.afterUpdate)
Example #2
0
    def onLoadPipPackages(self):
        self.clear()
        self.mode = self.onLoadPipPackages

        distros = pip.get_installed_distributions()
        items_dict = {}
        query_list = []
        for dist in distros:
            query_list.append(dist.key)
            self.append_item(items_dict, dist.key, dist)

        self.listbox.insert_items(items_dict)
        self.status.setText("Updating cache...")
        pipcache.query_info(query_list, self.afterUpdate)
Example #3
0
    def onLoadPipPackages(self):
        self.clear()
        self.mode = self.onLoadPipPackages

        distros = pip.get_installed_distributions()
        items_dict = {}
        query_list = []
        for dist in distros:
            query_list.append(dist.key)
            self.append_item(items_dict, dist.key, dist)

        self.listbox.insert_items(items_dict)
        self.status.setText("Updating cache...")
        pipcache.query_info(query_list, self.afterUpdate)
Example #4
0
    def onLoadSitePackages(self):
        self.clear()
        self.mode = self.onLoadSitePackages

        distros = pkg_resources.Environment()
        items_dict = {}
        query_list = []
        for key in distros:
            query_list.append(key)
            for dist in distros[key]:
                self.append_item(items_dict, key, dist)

        self.listbox.insert_items(items_dict)
        self.status.setText("Updating cache...")
        pipcache.query_info(query_list, self.afterUpdate)
Example #5
0
    def onLoadSitePackages(self):
        self.clear()
        self.mode = self.onLoadSitePackages

        distros = pkg_resources.Environment()
        items_dict = {}
        query_list = []
        for key in distros:
            query_list.append(key)
            for dist in distros[key]:
                self.append_item(items_dict, key, dist)

        self.listbox.insert_items(items_dict)
        self.status.setText("Updating cache...")
        pipcache.query_info(query_list, self.afterUpdate)
Example #6
0
    def onLoadFile(self):
        self.clear()
        self.mode = self.onLoadFile

        filename = askopenfilename()
        if filename:
            items_dict = {}
            query_list = []

            with open(filename) as f:
                distros = pkg_resources.Environment()
                for line in f:
                    line_list = line.split()
                    if line_list:
                        key = line_list[0].lower()
                        if re.match('^[a-z][a-z0-9]*$', key):  # lower_case_with_underscores
                            query_list.append(key)
                            dist = distros[key]
                            dist = dist[0] if dist else None
                            self.append_item(items_dict, key, dist)

            self.listbox.insert_items(items_dict)
            self.status.setText("Updating cache...")
            pipcache.query_info(query_list, self.afterUpdate)