當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。