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


Python Viewer.matchPath方法代码示例

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


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

示例1: _refresh

# 需要导入模块: from viewer import Viewer [as 别名]
# 或者: from viewer.Viewer import matchPath [as 别名]
    def _refresh(self, pillow, path):
        if self._path is None:
            return
        try:
            # selection changed!
            if path == self._path + ".*":
                try:
                    idx = PathHelper.getValue(self._document.selection, path + '._selection') 
                    if self._delegate:
                        self._ignoreSelect = True
                        self._delegate.selectRow(idx)
                except: pass

            elif Viewer.matchPath(self._path, path, mode=Viewer.OUTER):
                value = None
                if self._document:
                    if self._isList:
                        value = self._document.get(self._path, asList=True, wrap=self._wrapInList)
                    else:
                        value = self._document.get(self._path, asDict=True)

                if value and self._credentials:
                    credential = self._credentials.getFlat(self._path)
                    if credential == None or 'view' in credential or self._path == '_id':
                        if self._delegate: self._delegate.dataCB(value)
                        if not self._resolved:  
                            if self._document.hasConflicts():
                                d = self._document.loadConflicts()
                                d.addCallback(self._conflictsArrived)
                            else:
                                self._noConflict()

                        if self._delegate and self._inserted != None:
                            self._delegate.editRow(self._inserted)
                else:
                    if self._delegate: self._delegate.dataCB(None)

                if self._document != None and self._document.selection != None:
                    # FIXME: Should we clear the selection here
                    # if "*" in self._path:
                    #     self._document.select(self._path, None)

                    sel = PathHelper.getValue(self._document.selection, self._path + '.*._selection')
                    if sel != None and self._delegate != None: self._delegate.selectRow(sel)

            elif Viewer.matchPath(self._path, path, mode=Viewer.INNER):
                if self._delegate: self._delegate.changedCB()

        except SelectionNotSpecified as e:
            self._delegate.dataCB(None)

        self._inserted = None
开发者ID:FreshXOpenSource,项目名称:wallaby-base,代码行数:54,代码来源:embeddedViewer.py

示例2: _refresh

# 需要导入模块: from viewer import Viewer [as 别名]
# 或者: from viewer.Viewer import matchPath [as 别名]
    def _refresh(self, pillow, path):
        if self.destroyed: return

        if path == None or self._readonly:
            self._setReadOnly(True)
            self._noConflict()
            return

        if self._document:
            try:
                if Viewer.matchPath(self._path, path, mode=Viewer.OUTER):
                    self._document.get(self._path)

                    if self._credentials:
                        credential = self._credentials.getFlat(self._path)
                        if self._path == '_id' or credential == None or 'edit' in credential: #Hide whole widget
                            self._setReadOnly(self._readonly)
                            if not self._resolved:
                                if self._document.hasConflicts():
                                    d = self._document.loadConflicts()
                                    d.addCallback(self._conflictsArrived)
                                else:
                                    self._noConflict()

            except SelectionNotSpecified as e:
                self._setReadOnly(True)
        else:
            self._setReadOnly(True)
开发者ID:FreshXOpenSource,项目名称:wallaby-base,代码行数:30,代码来源:editor.py

示例3: _refresh

# 需要导入模块: from viewer import Viewer [as 别名]
# 或者: from viewer.Viewer import matchPath [as 别名]
    def _refresh(self, pillow, path):
        from wallaby.common.pathHelper import SelectionNotSpecified
        from twisted.internet import defer

        if self._path and Viewer.matchPath(self._path, path, mode=Viewer.OUTER):
            d = None

            try:
                if self._document:
                    name = self._document.get(self._path)

                    if name == None: name = self._path

                    if name != None:
                        d = defer.maybeDeferred(self._document.deferredGetAttachment, name)

                if d and self._credentials:
                    credential = self._credentials.getFlat(self._path)
                    if credential == None or 'view' in credential:
                        self._cb(d, name)
                else:
                    d = defer.Deferred()
                    d.callback(None)
                    self._cb(d, None)

            except SelectionNotSpecified as e:
                d = defer.Deferred()
                d.callback(None)
                self._cb(d, None)
开发者ID:FreshXOpenSource,项目名称:wallaby-base,代码行数:31,代码来源:imageViewer.py

示例4: _refresh

# 需要导入模块: from viewer import Viewer [as 别名]
# 或者: from viewer.Viewer import matchPath [as 别名]
    def _refresh(self, pillow, path):
        from wallaby.common.pathHelper import SelectionNotSpecified

        try:
            if Viewer.matchPath(self._path, path, mode=Viewer.OUTER):
                value = False
                if self._document:
                    value = bool(self._document.get(self._path))
                if value and self._credentials:
                    credential = self._credentials.getFlat(self._path)
                    if credential == None or 'view' in credential or self._path == '_id':
                        self._cb(value)
                else:
                    self._cb(False)
        except SelectionNotSpecified as e:
            self._cb(False)
开发者ID:FreshXOpenSource,项目名称:wallaby-base,代码行数:18,代码来源:booleanViewer.py

示例5: _refresh

# 需要导入模块: from viewer import Viewer [as 别名]
# 或者: from viewer.Viewer import matchPath [as 别名]
    def _refresh(self, pillow, path):
        from wallaby.common.pathHelper import SelectionNotSpecified

        if self._path == None:
            return
        try:
            if Viewer.matchPath(self._path, path, mode=Viewer.OUTER):
                value = 0
                if self._document:
                    value = self._document.get(self._path)
                if value and self._credentials:
                    credential = self._credentials.getFlat(self._path)
                    if credential == None or "view" in credential or self._path == "_id":
                        self._cb(value)
                else:
                    self._cb(None)
        except SelectionNotSpecified as e:
            self._cb(None)
开发者ID:FreshXOpenSource,项目名称:wallaby-base,代码行数:20,代码来源:dateViewer.py

示例6: _rowInserted

# 需要导入模块: from viewer import Viewer [as 别名]
# 或者: from viewer.Viewer import matchPath [as 别名]
        if self._document:
            try:
                currentIdx = PathHelper.getValue(self._document.selection, self._path + '.*._selection') 
                # already selected
                if currentIdx == idx: return 

            except: pass

        from documentChanger import DocumentChanger
        self._throw(DocumentChanger.In.Select, (self._path, idx))

    def _rowInserted(self, pillow, (path, key)):
        if self._path is None or self._delegate is None:
            return

        if Viewer.matchPath(self._path, path, mode=Viewer.OUTER):
            self._inserted = key

    def _refresh(self, pillow, path):
        if self._path is None:
            return
        try:
            # selection changed!
            if path == self._path + ".*":
                try:
                    idx = PathHelper.getValue(self._document.selection, path + '._selection') 
                    if self._delegate:
                        self._ignoreSelect = True
                        self._delegate.selectRow(idx)
                except: pass
开发者ID:FreshXOpenSource,项目名称:wallaby-base,代码行数:32,代码来源:embeddedViewer.py


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