当前位置: 首页>>代码示例>>Python>>正文


Python view.View方法代码示例

本文整理汇总了Python中view.View方法的典型用法代码示例。如果您正苦于以下问题:Python view.View方法的具体用法?Python view.View怎么用?Python view.View使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在view的用法示例。


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

示例1: __init__

# 需要导入模块: import view [as 别名]
# 或者: from view import View [as 别名]
def __init__(self, model = None, submodel = None, setup = None, controller = None, viewStack=None, *args, **kwargs):
        """
        @type model: L{interfaces.IModel}

        @param submodel: see L{Widget.setSubmodel}
        @type submodel: String

        @type setup: Callable
        """
        self.errorFactory = Error
        self.controller = controller
        self.become = None
        self._reset()
        view.View.__init__(self, model)
        self.node = None
        self.templateNode = None
        if submodel:
            self.submodel = submodel
        else:
            self.submodel = ""
        if setup:
            self.setupMethods = [setup]
        else:
            self.setupMethods = []
        self.viewStack = viewStack
        self.initialize(*args, **kwargs) 
开发者ID:adde88,项目名称:hostapd-mana,代码行数:28,代码来源:widgets.py

示例2: generate

# 需要导入模块: import view [as 别名]
# 或者: from view import View [as 别名]
def generate(self, request, node):
        if self.macroTemplate:
            templ = view.View(
                self.model,
                template = self.macroTemplate).lookupTemplate(request)
        else:
            templ = view.View(
                self.model,
                templateFile=self.macroFile,
                templateDirectory=self.macroFileDirectory).lookupTemplate(request)

        ## We are going to return the macro node from the metatemplate,
        ## after replacing any slot= nodes in it with fill-slot= nodes from `node'
        macrolist = domhelpers.locateNodes(templ.childNodes, "macro", self.macroName)
        assert len(macrolist) == 1, ("No macro or more than "
            "one macro named %s found." % self.macroName)

        macro = macrolist[0]
        del macro.attributes['macro']
        slots = domhelpers.findElementsWithAttributeShallow(macro, "slot")
        for slot in slots:
            slotName = slot.attributes.get("slot")
            fillerlist = domhelpers.locateNodes(node.childNodes, "fill-slot", slotName)
            assert len(fillerlist) <= 1, "More than one fill-slot found with name %s" % slotName
            if len(fillerlist):
                filler = fillerlist[0]
                filler.tagName = filler.endTagName = slot.tagName
                del filler.attributes['fill-slot']
                del slot.attributes['slot']
                filler.attributes.update(slot.attributes)
                slot.parentNode.replaceChild(filler, slot)

        return macro 
开发者ID:adde88,项目名称:hostapd-mana,代码行数:35,代码来源:widgets.py

示例3: __init__

# 需要导入模块: import view [as 别名]
# 或者: from view import View [as 别名]
def __init__(self, view: View, info: Dict[str, Any], api: TwitchAPI, quality: str, temp_dir: str = '.') -> None:
        if not TwitchVideo._schema:
            with open('video_info.schema') as json_data:
                TwitchVideo._schema = json.load(json_data)
        self._validate_info(info)

        self.info = info
        self.api = api
        self.quality = quality
        self.temp_dir = temp_dir
        self.view = view

        self.download_done: bool = False
        self.file: Optional[IO[bytes]] = None 
开发者ID:tausackhn,项目名称:twlived,代码行数:16,代码来源:storage.py

示例4: __init__

# 需要导入模块: import view [as 别名]
# 或者: from view import View [as 别名]
def __init__(self):
        self.instance = view.View() 
开发者ID:lucasmenendez,项目名称:pylemanager,代码行数:4,代码来源:main.py

示例5: __str__

# 需要导入模块: import view [as 别名]
# 或者: from view import View [as 别名]
def __str__(self):
        return str(View(self)) 
开发者ID:mackorone,项目名称:catan,代码行数:4,代码来源:board.py


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