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


Python ArgsUtils.extract方法代码示例

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


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

示例1: __init__

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import extract [as 别名]
    def __init__(self, parent =None, **kwargs):
        """Creates a new instance of PySideGui."""
        flags = ArgsUtils.extract('flags', None, kwargs)
        if flags is None:
            # By default the close button is hidden (only title shows)
            flags = QtCore.Qt.CustomizeWindowHint | QtCore.Qt.WindowTitleHint

        title          = ArgsUtils.extract('title', 'Dialog', kwargs)
        modal          = ArgsUtils.extract('modal', True, kwargs)
        widgetClass    = ArgsUtils.extract('widget', None, kwargs)
        self._callback = ArgsUtils.extract('callback', None, kwargs)
        self._canceled = True

        QtGui.QDialog.__init__(self, parent, flags)

        self.setStyleSheet(self.owner.styleSheetPath)
        if widgetClass is None:
            self._widget = None
        else:
            layout       = self._getLayout(self)
            self._widget = widgetClass(parent=self, **kwargs)
            layout.addWidget(self._widget)

        self.setModal(modal)
        self.setWindowTitle(title)
开发者ID:hannahp,项目名称:PyGlass,代码行数:27,代码来源:PyGlassDialog.py

示例2: __init__

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import extract [as 别名]
    def __init__(self, parent, path, session=None, **kwargs):
        """Creates a new instance of TrackImporterRemoteThread."""
        self._pretty = ArgsUtils.extract("pretty", False, kwargs)
        self._gzipped = ArgsUtils.extract("compressed", True, kwargs)
        self._difference = ArgsUtils.extract("difference", True, kwargs)

        RemoteExecutionThread.__init__(self, parent, **kwargs)

        self._path = path
        self._session = session
开发者ID:sernst,项目名称:Cadence,代码行数:12,代码来源:TrackExporterRemoteThread.py

示例3: __init__

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import extract [as 别名]
    def __init__(self, source, **kwargs):

        self.footerDom  = u''
        self.page       = ArgsUtils.get('page', None, kwargs)
        self.site       = ArgsUtils.get('site', None, kwargs)

        self.filePath = ArgsUtils.get('path', None, kwargs)
        self.filename = ArgsUtils.get(
            'filename',
            os.path.basename(self.filePath) if self.filePath else None,
            kwargs)

        debugData = ArgsUtils.extract('debugData', None, kwargs)
        blocks    = {
            'root':[
                MarkupTextBlockUtils.createMarkupCommentDef(BlockDefinition.BLOCKED),
                MarkupTextBlockUtils.createMarkupOpenDef('quote'),
                MarkupTextBlockUtils.createMarkupCloseDef(BlockDefinition.BLOCKED) ],
            'quote':[
                BlockDefinition.createQuoteDef(BlockDefinition.BLOCKED),
                BlockDefinition.createLiteralDef(BlockDefinition.BLOCKED) ]}

        self._renderErrors = []
        self._tagIndex     = -1

        super(MarkupProcessor, self).__init__(
            source,
            ArgsUtils.extract('debug', False, kwargs),
            blocks,
            debugData,
            stripSource=False,
            **kwargs)

        self.logger.trace       = True
        self._result            = None
        self._anchors           = []
        self._tags              = []
        self._id                = StringUtils.getRandomString(8)
        self._css               = []
        self._js                = []
        self._radioArrays       = dict()
        self._patterns          = dict()
        self._groups            = dict()
        self._metadata          = ArgsUtils.getAsDict('metadata', kwargs)
        self._libraryIDs        = []
        self._autoTitle         = u''
        self._autoDescription   = u''
        self._allowModelCaching = False

        self.privateView = False
开发者ID:sernst,项目名称:StaticFlow,代码行数:52,代码来源:MarkupProcessor.py

示例4: __init__

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import extract [as 别名]
    def __init__(self, parent, **kwargs):
        RemoteExecutionThread.__init__(self, parent, explicitComplete=True, **kwargs)
        self._pausePackageSteps     = ArgsUtils.extract('pausePackageSteps', False, kwargs)
        self._uploadAfterPackage    = ArgsUtils.extract('uploadAfterPackage', False, kwargs)
        self._flexData              = FlexProjectData(**kwargs)
        self._queue                 = []
        self._isProcessingQueue     = False
        self._isAbortingQueue       = False
        self._bucket                = None
        self._output                = dict()

        if self._uploadAfterPackage:
            self._output['urls'] = dict()
            self._bucket = self._flexData.createBucket()
开发者ID:sernst,项目名称:CompilerDeck,代码行数:16,代码来源:ANECompileThread.py

示例5: __init__

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import extract [as 别名]
 def __init__(self, parent, url, args =None, **kwargs):
     """Creates a new instance of Request."""
     self._localData = ArgsUtils.extract('localData', None, kwargs)
     self._dead      = ArgsUtils.extract('dead', False, kwargs)
     QObject.__init__(self, parent, **kwargs)
     self._url       = url
     self._owner     = parent
     self._log       = parent.log if parent else Logger(self)
     self._callback  = None
     self._args      = args
     self._request   = None
     self._result    = None
     self._sent      = False
     self._async     = False
开发者ID:hannahp,项目名称:PyGlass,代码行数:16,代码来源:Request.py

示例6: __init__

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import extract [as 别名]
    def __init__(self, **kwargs):
        """Creates a new instance of MarkupTagError."""

        self._errorAtEnd = ArgsUtils.extract("errorAtEnd", False, kwargs)

        ArgsUtils.addIfMissing("errorDef", self.READ_FAILURE, kwargs, True)
        MarkupError.__init__(self, **kwargs)
开发者ID:sernst,项目名称:StaticFlow,代码行数:9,代码来源:MarkupTagError.py

示例7: __init__

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import extract [as 别名]
    def __init__(self, *args, **kwargs):
        """Creates a new instance of ListDataOrganizer."""
        root = ArgsUtils.extract('root', None, kwargs, args, 0)
        if isinstance(root, basestring):
            root = [root]

        super(ListDataOrganizer, self).__init__(list, root, **kwargs)
开发者ID:sernst,项目名称:StaticFlow,代码行数:9,代码来源:ListDataOrganizer.py

示例8: runPythonExec

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import extract [as 别名]
def runPythonExec(script, kwargs =None):
    from nimble.NimbleEnvironment import NimbleEnvironment
    from nimble.data.NimbleResponseData import NimbleResponseData
    from nimble.data.enum.DataKindEnum import DataKindEnum

    try:
        nimble.cmds.undoInfo(openChunk=True)
    except Exception as err:
        return False

    try:
        # Create a new, temporary module in which to run the script
        module = imp.new_module('runExecTempModule')

        # Initialize the script with script inputs
        setattr(module, NimbleEnvironment.REMOTE_KWARGS_KEY, kwargs if kwargs is not None else dict())
        setattr(module, NimbleEnvironment.REMOTE_RESULT_KEY, dict())

        # Executes the script in the new module
        exec_(script, module.__dict__)

        # Find a NimbleScriptBase derived class definition and if it exists, run it to populate the
        # results
        for name,value in Reflection.getReflectionDict(module).iteritems():
            if not inspect.isclass(value):
                continue

            if NimbleScriptBase in value.__bases__:
                getattr(module, name)().run()
                break

        # Retrieve the results object that contains all results set by the execution of the script
        result = getattr(module, NimbleEnvironment.REMOTE_RESULT_KEY)
    except Exception as err:
        logger = Logger('runPythonExec', printOut=True)
        logger.writeError('ERROR: Failed Remote Script Execution', err)
        result = NimbleResponseData(
            kind=DataKindEnum.PYTHON_SCRIPT,
            response=NimbleResponseData.FAILED_RESPONSE,
            error=str(err) )

    # If a result dictionary contains an error key format the response as a failure
    try:
        errorMessage = ArgsUtils.extract(
            NimbleEnvironment.REMOTE_RESULT_ERROR_KEY, None, result)
        if errorMessage:
            return NimbleResponseData(
                kind=DataKindEnum.PYTHON_SCRIPT,
                response=NimbleResponseData.FAILED_RESPONSE,
                error=errorMessage,
                payload=result)
    except Exception as err:
        pass

    try:
        nimble.cmds.undoInfo(closeChunk=True)
    except Exception as err:
        return False

    return result
开发者ID:sernst,项目名称:Nimble,代码行数:62,代码来源:__init__.py

示例9: send

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import extract [as 别名]
    def send(self, cls, *args, **kwargs):
        """ Sends an API request to the cloud servers and handles the response. This can be sent
            either synchronously or asynchronously depending on whether or not a callback argument
            is included in the request. Asynchronous requests must be handled within the context
            of a running PySide application loop, as the threading is managed by PySide. """

        callback = ArgsUtils.extract('callback', None, kwargs, args, 0)
        if self:
            return self._sendRequest(callback=callback, **kwargs)
        return cls._createAndSend(callback=callback, **kwargs)
开发者ID:sernst,项目名称:PyGlass,代码行数:12,代码来源:Request.py

示例10: __init__

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import extract [as 别名]
    def __init__(self, parent, path, importType, session =None, analysisSession =None, **kwargs):
        """Creates a new instance of TrackImporterRemoteThread."""
        self._compressed = ArgsUtils.extract('compressed', False, kwargs)

        RemoteExecutionThread.__init__(self, parent, **kwargs)
        self._path       = path
        self._session    = session
        self._analysisSession = analysisSession
        self._importType = importType
        self._verbose    = ArgsUtils.get('verbose', True, kwargs)
开发者ID:sernst,项目名称:Cadence,代码行数:12,代码来源:TrackImporterRemoteThread.py

示例11: __init__

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import extract [as 别名]
    def __init__(self, parent=None, **kwargs):
        """Creates a new instance of PyGlassWebKitWidget."""
        self._communicator = ArgsUtils.extract("communicator", None, kwargs)
        self._debug = ArgsUtils.extract("debug", False, kwargs)
        url = ArgsUtils.extract("url", None, kwargs)
        localUrl = ArgsUtils.extract("localUrl", None, kwargs)
        PyGlassWidget.__init__(self, parent, widgetFile=False, **kwargs)

        layout = self._getLayout(self, QtGui.QVBoxLayout)
        layout.setContentsMargins(0, 0, 0, 0)

        self._webView = PyGlassWebView(self, communicator=self._communicator, debug=self._debug)
        layout.addWidget(self._webView)
        self.setLayout(layout)

        if url:
            self._webView.openUrl(url)
        elif localUrl:
            self._webView.openLocalWebUrl(url)
开发者ID:hannahp,项目名称:PyGlass,代码行数:21,代码来源:PyGlassWebKitWidget.py

示例12: __init__

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import extract [as 别名]
 def __init__(self, parent =None, *args, **kwargs):
     """Creates a new instance of StyledLabel."""
     self._fontFamily    = ArgsUtils.extract('fontFamily', None, kwargs)
     self._fontSize      = ArgsUtils.extract('fontSize', None, kwargs)
     self._color         = ArgsUtils.extract('color', None, kwargs)
     self._fontWeight    = ArgsUtils.extract('fontWeight', None, kwargs)
     self._isItalic      = ArgsUtils.extract('isItalic', None, kwargs)
     self._isBold        = ArgsUtils.extract('isBold', None, kwargs)
     self._isBorderless  = ArgsUtils.extract('isBorderless', True, kwargs)
     super(StyledLabel, self).__init__(parent, *args, **kwargs)
开发者ID:sernst,项目名称:PyGlass,代码行数:12,代码来源:StyledLabel.py

示例13: __init__

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import extract [as 别名]
    def __init__(self, parent, toggles =False, clickOn =False, **kwargs):
        """Creates a new instance of InteractiveElement."""
        self._clickCallback = ArgsUtils.extract('callback', None, kwargs)
        super(InteractiveElement, self).__init__(parent, **kwargs)

        self._toggles      = toggles
        self._clickOn      = clickOn
        self._checked      = False
        self._mode         = InteractionStatesEnum.NORMAL_MODE
        self._mouseEnabled = True

        c = QtGui.QCursor()
        c.setShape(QtCore.Qt.PointingHandCursor)
        self.setCursor(c)
开发者ID:hannahp,项目名称:PyGlass,代码行数:16,代码来源:InteractiveElement.py

示例14: createReply

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import extract [as 别名]
    def createReply(cls, kind, result, errorMessage=None):
        payload = result if isinstance(result, dict) else {"result": result}
        warnings = ArgsUtils.extract(NimbleEnvironment.REMOTE_RESULT_WARNING_KEY, None, payload)

        if errorMessage:
            return NimbleResponseData(
                kind=kind,
                response=NimbleResponseData.FAILED_RESPONSE,
                warnings=warnings,
                error=errorMessage,
                payload=payload,
            )

        return NimbleResponseData(
            kind=kind, warnings=warnings, response=NimbleResponseData.SUCCESS_RESPONSE, payload=payload
        )
开发者ID:leonsooi,项目名称:Nimble,代码行数:18,代码来源:MayaRouter.py

示例15: _deployWalker

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import extract [as 别名]
    def _deployWalker(self, args, path, names):
        """Doc..."""

        # Skip CDN file uploads when not walking the CDN root path explicitly
        if not args['cdn'] and path.find(StaticFlowEnvironment.CDN_ROOT_PREFIX) != -1:
            return

        for name in names:
            namePath = FileUtils.createPath(path, name)
            if os.path.isdir(namePath) or StringUtils.ends(name, self._SKIP_EXTENSIONS):
                continue

            headersPath = namePath + '.headers'
            if os.path.exists(headersPath):
                headers = JSON.fromFile(headersPath)
            else:
                headers = dict()

            if self._forceAll:
                lastModified = None
            elif self._forceHtml and StringUtils.ends(name, self._FORCE_HTML_EXTENSIONS):
                lastModified = None
            else:
                lastModified = ArgsUtils.extract('_LAST_MODIFIED', None, headers)
                if lastModified:
                    lastModified = TimeUtils.webTimestampToDateTime(lastModified)

            kwargs = dict(
                key=u'/' + namePath[len(self._localRootPath):].replace(u'\\', u'/').strip(u'/'),
                maxAge=headers.get('max-age', -1),
                eTag=headers.get('eTag', None),
                expires=headers.get('Expires'),
                newerThanDate=lastModified,
                policy=S3Bucket.PUBLIC_READ)

            if StringUtils.ends(name, self._STRING_EXTENSIONS):
                result = self._bucket.put(
                    contents=FileUtils.getContents(namePath),
                    zipContents=True,
                    **kwargs)
            else:
                result = self._bucket.putFile(filename=namePath, **kwargs)

            if result:
                self._logger.write(u'DEPLOYED: ' + unicode(namePath) + u'->' + unicode(kwargs['key']))
开发者ID:sernst,项目名称:StaticFlow,代码行数:47,代码来源:S3SiteDeployer.py


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