コード例 #1
0
ファイル: base.py プロジェクト: coredamage/iosfu
 def __slug__(self):
     """
     Returns slugified name for identification
     """
     return u"{0}.{1}".format(
         slugify(self.category),
         slugify(self.name)
     )
コード例 #2
0
ファイル: core.py プロジェクト: FarooqMulla/iosfu
    def register_panel(self, panel_component):
        """
        Decorator to register Panels.
        """
        ins = panel_component()
        assert isinstance(ins, Panel), "{}.{} is not a GUI Panel instance"\
            .format(ins.__module__, panel_component.__name__)
        slug = ins.__slug__

        # Append panel to instance manager
        self._panels[slug] = panel_component

        # Category handling
        category = slugify(ins.category)
        if category not in self._categories:
            self._categories[category] = []
        self._categories[category].append(ins)
コード例 #3
0
    def register_panel(self, panel_component):
        """
        Decorator to register Panels.
        """
        ins = panel_component()
        assert isinstance(ins, Panel), "{}.{} is not a GUI Panel instance"\
            .format(ins.__module__, panel_component.__name__)
        slug = ins.__slug__

        # Append panel to instance manager
        self._panels[slug] = panel_component

        # Category handling
        category = slugify(ins.category)
        if category not in self._categories:
            self._categories[category] = []
        self._categories[category].append(ins)
コード例 #4
0
    def __init__(self):
        if not self.id and self.name:
            self.id = slugify(self.name)

        self._map_sections()
コード例 #5
0
    def __init__(self, backup=None):
        if backup:
            self.backup = backup

        if not self.id and self.name:
            self.id = "{}".format(slugify(self.name))
コード例 #6
0
ファイル: base.py プロジェクト: FarooqMulla/iosfu
    def __init__(self):
        if not self.id and self.name:
            self.id = slugify(self.name)

        self._map_sections()
コード例 #7
0
ファイル: base.py プロジェクト: FarooqMulla/iosfu
    def __init__(self, backup=None):
        if backup:
            self.backup = backup

        if not self.id and self.name:
            self.id = "{}".format(slugify(self.name))