• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python tuiobject.TUIObject类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyanaconda.ui.tui.tuiobject.TUIObject的典型用法代码示例。如果您正苦于以下问题:Python TUIObject类的具体用法?Python TUIObject怎么用?Python TUIObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了TUIObject类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, app, data, storage, payload, instclass):
        TUIObject.__init__(self, app, data)
        common.Hub.__init__(self, storage, payload, instclass)

        self._spokes = {}     # holds spokes referenced by their class name
        self._keys = {}       # holds spokes referenced by their user input key
        self._spoke_count = 0
开发者ID:KosiehBarter,项目名称:anaconda,代码行数:7,代码来源:__init__.py


示例2: __init__

    def __init__(self, app, data, storage, payload, instclass):
        if self.__class__ is TUISpoke:
            raise TypeError("TUISpoke is an abstract class")

        TUIObject.__init__(self, app, data)
        tui.Widget.__init__(self)
        Spoke.__init__(self, storage, payload, instclass)
开发者ID:cyclefusion,项目名称:anaconda,代码行数:7,代码来源:__init__.py


示例3: __init__

    def __init__(self, data, storage, payload, instclass):
        if self.__class__ is TUISpoke:
            raise TypeError("TUISpoke is an abstract class")

        TUIObject.__init__(self, data)
        Widget.__init__(self)
        Spoke.__init__(self, storage, payload, instclass)

        self.input_required = True
        self.title = N_("Default spoke title")
开发者ID:jaymzh,项目名称:anaconda,代码行数:10,代码来源:__init__.py


示例4: refresh

    def refresh(self, args=None):
        """This methods fills the self.window list by all the objects
        we want shown on this screen. Title and Spokes mostly."""
        TUIObject.refresh(self, args)

        self._container = ListRowContainer(2, columns_width=39, spacing=2)

        for w in self._spokes_map:
            self._container.add(w, callback=self._item_called, data=w)

        self.window.add_with_separator(self._container)
开发者ID:jaymzh,项目名称:anaconda,代码行数:11,代码来源:__init__.py


示例5: refresh

    def refresh(self, args=None):
        """This methods fills the self._window list by all the objects
        we want shown on this screen. Title and Spokes mostly."""
        TUIObject.refresh(self, args)

        def _prep(i, w):
            number = tui.TextWidget("%2d)" % i)
            return tui.ColumnWidget([(3, [number]), (None, [w])], 1)

        # split spokes to two columns
        left = [_prep(i, w) for i, w in self._keys.items() if i % 2 == 1]
        right = [_prep(i, w) for i, w in self._keys.items() if i % 2 == 0]

        c = tui.ColumnWidget([(39, left), (39, right)], 2)
        self._window.append(c)

        return True
开发者ID:KosiehBarter,项目名称:anaconda,代码行数:17,代码来源:__init__.py


示例6: setup

    def setup(self, args="anaconda"):
        TUIObject.setup(self, args)
        environment = args
        cats_and_spokes = self._collectCategoriesAndSpokes()
        categories = cats_and_spokes.keys()

        for c in sorted(categories, key=lambda i: i.title):

            hub_spokes = []
            for spoke_class in cats_and_spokes[c]:
                # Do the checks for the spoke and create the spoke
                if spoke_class.should_run(environment, self.data):
                    spoke = spoke_class(self.data, self.storage, self.payload, self.instclass)

                    if spoke.showable:
                        spoke.initialize()
                    else:
                        log.warning("Spoke %s initialization failure!", spoke.__class__.__name__)
                        del spoke
                        continue

                    if spoke.indirect:
                        continue

                    hub_spokes.append(spoke)

            # sort created spokes and add them to result structures
            for spoke in sorted(hub_spokes, key=lambda s: s.title):

                self._spoke_count += 1
                self._spokes_map.append(spoke)
                self._spokes[spoke.__class__.__name__] = spoke

        if self._spoke_count:
            # initialization of all expected spokes has been started, so notify the controller
            hub_controller = lifecycle.get_controller_by_name(self.__class__.__name__)
            if hub_controller:
                hub_controller.all_modules_added()
            else:
                log.error("Initialization controller for hub %s expected but missing.", self.__class__.__name__)

        # only schedule the hub if it has some spokes
        return self._spoke_count != 0
开发者ID:jaymzh,项目名称:anaconda,代码行数:43,代码来源:__init__.py


示例7: refresh

 def refresh(self, args=None):
     TUIObject.refresh(self, args)
     return True
开发者ID:cyclefusion,项目名称:anaconda,代码行数:3,代码来源:__init__.py


示例8: __init__

 def __init__(self, app, data, storage, payload, instclass):
     TUIObject.__init__(self, app, data)
     tui.Widget.__init__(self)
     Spoke.__init__(self, data, storage, payload, instclass)
开发者ID:cs2c-zhangchao,项目名称:nkwin1.0-anaconda,代码行数:4,代码来源:__init__.py



注:本文中的pyanaconda.ui.tui.tuiobject.TUIObject类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python error.err_add函数代码示例发布时间:2022-05-25
下一篇:
Python spokes.NormalTUISpoke类代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap