コード例 #1
0
ファイル: switch_renamer.py プロジェクト: NMGRL/pychron
    def _load_descriptions(self):
        descriptions = []
        parser = SwitchParser()
        if not parser.load(self.valves_path):
            self.warning_dialog('"{}" not a valid file'.format(self.valves_path))
        else:

            for v in parser.get_all_switches():
                d = v.find('description')
                if d is not None:
                    descriptions.append(d.text)

        if descriptions:
            self.description = descriptions[0]
        self.descriptions = descriptions
コード例 #2
0
    def _load_descriptions(self):
        descriptions = []
        parser = SwitchParser()
        if not parser.load(self.valves_path):
            self.warning_dialog('"{}" not a valid file'.format(
                self.valves_path))
        else:

            for v in parser.get_all_switches():
                d = v.find('description')
                if d is not None:
                    descriptions.append(d.text)

        if descriptions:
            self.description = descriptions[0]
        self.descriptions = descriptions