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


Python ArgsUtils.get方法代码示例

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


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

示例1: __init__

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import get [as 别名]
    def __init__(self, **kwargs):
        """Creates a new instance of ConfigReader."""
        self._configs     = ArgsUtils.get('configs', dict(), kwargs)
        self._filenames   = ArgsUtils.get('filenames', None, kwargs)
        self._configPath  = ArgsUtils.get(
            'rootConfigPath',
            CadenceEnvironment.getConfigPath(),
            kwargs
        )

        if self._filenames:
            for n,v in self._filenames.iteritems():
                if not v:
                    continue

                path = os.path.join(self._configPath, v)
                if not path.endswith('.cfg'):
                    path += '.cfg'

                parser = ConfigParser.ConfigParser()
                if os.path.exists(path):
                    parser.read(path)
                else:
                    raise Exception, path + ' config file does not exist!'

                self._configs[n] = self._configParserToDict(parser)

        self._overrides = dict()
        self.setOverrides(ArgsUtils.get('overrides', None, kwargs))
开发者ID:JenLM,项目名称:Cadence,代码行数:31,代码来源:ConfigReader.py

示例2: __init__

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import get [as 别名]
    def __init__(self, src ='', debug =False, blockDefs =None, debugData =None, **kwargs):
        """Creates a new instance of ClassTemplate."""
        self._log = ArgsUtils.getLogger(self, kwargs)

        self._debugData = debugData
        self._debug     = debug

        src = StringUtils.toUnicode(src)

        self._raw = src.replace('\r','')
        if ArgsUtils.get('stripSource', True, kwargs):
            self._raw = self._raw.strip('\n')

        self._analyzed  = False
        self._errors    = []
        self._blocks    = []
        self._bookmarks = []
        self._initialBlock = ArgsUtils.get('initialBlock', None, kwargs)

        if isinstance(blockDefs, BlockDefinition):
            self._blockDefs = {'root':blockDefs}
        elif isinstance(blockDefs, dict):
            self._blockDefs = blockDefs
        elif isinstance(blockDefs, list):
            self._blockDefs = {'root':blockDefs}
        else:
            self._blockDefs = {
                'root':[
                    BlockDefinition.createQuoteDef(BlockDefinition.BLOCKED),
                    BlockDefinition.createLiteralDef(BlockDefinition.BLOCKED),
                    BlockDefinition.createParensDef(),
                    BlockDefinition.createBracketsDef(),
                    BlockDefinition.createBracesDef(),
                    ],
                }
开发者ID:sernst,项目名称:PyAid,代码行数:37,代码来源:TextAnalyzer.py

示例3: add

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import get [as 别名]
    def add(self, *args, **kwargs):
        """Adds value to the existing item, replacing existing entries.

        @@@param value:string
            The value argument can be a single value.

        @@@param group:string
            The name of the group in which to add the value. Default of None adds the value to the
            root group.
        """

        value = ArgsUtils.get('value', None, kwargs, args, 0)
        if value is None:
            value = u''
        elif isinstance(value, dict) or isinstance(value, list):
            value = JSON.asString(value)
        else:
            value = unicode(value)

        group = ArgsUtils.get('group', None, kwargs, args, 1)
        once  = ArgsUtils.get('once', False, kwargs)

        if group:
            target        = self._tempSubs if once else self._subs
            target[group] = value
        else:
            if once:
                self._tempRoot = value
            else:
                self._root = value
开发者ID:sernst,项目名称:StaticFlow,代码行数:32,代码来源:SingleValuedDataOrganizer.py

示例4: createPath

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import get [as 别名]
    def createPath(cls, *args, **kwargs):
        """Doc..."""
        if not args or args[0] is None:
            return None

        src = []
        for item in args:
            if isinstance(item, list):
                src.extend(item)
            else:
                src.append(item)
        out = os.path.join(*src)

        if out.endswith(os.sep) or ArgsUtils.get('isFile', False, kwargs):
            return cls._getAbsolutePath(out)

        noTail = ArgsUtils.get('noTail', False, kwargs)
        if ArgsUtils.get('isDir', False, kwargs):
            return cls._getAbsolutePath(out) if noTail else (cls._getAbsolutePath(out) + os.sep)

        if os.path.exists(out):
            if os.path.isfile(out):
                return cls._getAbsolutePath(out)

            if os.path.isdir(out) and not noTail and not out.endswith(os.sep):
                out += os.sep
        elif out.endswith('..'):
            out += os.sep
        elif src[-1].find('.') == -1:
            out += os.sep

        return cls._getAbsolutePath(out)
开发者ID:hannahp,项目名称:PyAid,代码行数:34,代码来源:FileUtils.py

示例5: _listPath

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import get [as 别名]
    def _listPath(cls, rootPath, recursive, **kwargs):
        listDirs        = ArgsUtils.get('listDirs', False, kwargs)
        skipSVN         = ArgsUtils.get('skipSVN', True, kwargs)
        skips           = ArgsUtils.get('skips', None, kwargs)
        allowExtensions = ArgsUtils.getAsList('allowExtensions', kwargs)
        skipExtensions  = ArgsUtils.getAsList('skipExtensions', kwargs)

        out = []
        for item in os.listdir(rootPath):
            if (skipSVN and item == '.svn') or (skips and item in skips):
                continue
            absItem = os.path.join(rootPath, item)
            if os.path.isdir(absItem):
                path = (absItem + os.sep)
                if listDirs:
                    out.append(path)
                absItem = None

                if recursive:
                    out += cls._listPath(path, recursive, **kwargs)

            elif os.path.isfile(absItem):
                if skipExtensions and StringUtils.ends(item, skipExtensions):
                    continue

                if allowExtensions and not StringUtils.ends(item, allowExtensions):
                    continue

            if absItem:
                out.append(absItem)

        return out
开发者ID:hannahp,项目名称:PyAid,代码行数:34,代码来源:FileUtils.py

示例6: addKeysFromLists

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

        x = ArgsUtils.get('times', None, kwargs)
        if not x:
            return

        y = ArgsUtils.get('values', None, kwargs)
        if not y:
            return

        tans    = ArgsUtils.get('tangents', None, kwargs)
        inTans  = ArgsUtils.get('inTangents', tans, kwargs)
        outTans = ArgsUtils.get('outTangents', tans, kwargs)

        if not inTans:
            inTans = 'lin'

        if not outTans:
            outTans = 'lin'

        for i in range(0,len(x)):
            self._keys.append(DataChannelKey(
                time=x[i],
                value=y[i],
                inTangent=inTans if StringUtils.isStringType(inTans) else inTans[i],
                outTangent=outTans if StringUtils.isStringType(outTans) else outTans[i] ))
开发者ID:sernst,项目名称:Cadence,代码行数:29,代码来源:DataChannel.py

示例7: add

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import get [as 别名]
    def add(self, *args, **kwargs):
        """Adds item(s) to the existing list of items, ignoring duplicates.

        @@@param items:mixed,list
            The items argument can be a single item or a list of items.

        @@@param group:string
            The name of the group in which to add the items. Default of None adds the items to the
            root group.
        """

        items = ArgsUtils.get('items', None, kwargs, args, 0)
        if items is None or not items:
            return

        group = ArgsUtils.get('group', None, kwargs, args, 1)
        once  = ArgsUtils.get('once', False, kwargs)

        if group:
            target = self._tempSubs if once else self._subs
            if not group in target:
                target[group] = []
            for n in items:
                if not n in target[group]:
                    target[group].append(n)
        else:
            target = self._tempRoot if once else self._root
            for n in items:
                if not n in target:
                    target.append(n)
开发者ID:sernst,项目名称:StaticFlow,代码行数:32,代码来源:ListDataOrganizer.py

示例8: write

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import get [as 别名]
    def write(self, *args, **kwargs):
        group  = ArgsUtils.get('group', None, kwargs, args, 0)
        skipID = ArgsUtils.get('skipID', False, kwargs)
        items  = None if len(args) < 2 else args[1:]

        s   = []
        out = None
        if items and len(items):
            for a in items:
                out = a.write(group=group, **kwargs)
                if out and len(out) > 0:
                    s.append(out)
        else:
            writes = self._writes + DomRenderData._WRITES
            for w in writes:
                if skipID and w == 'id':
                    continue

                try:
                    out = getattr(self, w).write(group=group, **kwargs)
                    if out and len(out) > 0:
                        s.append(out)
                except Exception, err:
                    DomRenderData._LOGGER.writeError(['Organizer write failure',
                                                      'organizer: ' + str(out),
                                                      'renderData: ' + str(self)], err)
                    pass
开发者ID:sernst,项目名称:StaticFlow,代码行数:29,代码来源:DomRenderData.py

示例9: __init__

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

        SVADO          = SingleValuedAttributeDataOrganizer
        self._id       = self._createOrganizer('id', kwargs, SVADO, name='id')
        self._renderID = self._createOrganizer(['renderID', 'rid'], kwargs, SVADO, name='data-v-rid')
        self._dataID   = self._createOrganizer(['dataID', 'did'], kwargs, SVADO, name='data-v-did')
        self._styleID  = self._createOrganizer(['themeID', 'sid'], kwargs, SVADO, name='data-v-sid')

        ADO            = AttributeDataOrganizer
        self._vdata    = self._createOrganizer('vdata', kwargs, ADO, prefix='data-v-')
        self._data     = self._createOrganizer('data', kwargs, ADO, prefix='data-')
        self._attrs    = self._createOrganizer('attrs', kwargs, ADO, prefix='')

        SADO            = SingleAttributeDataOrganizer
        self._dataState = self._createOrganizer('dataState', kwargs, SADO, name='data-v-data')
        self._inits     = self._createOrganizer('inits', kwargs, SADO, name='data-v-ini')
        self._events    = self._createOrganizer('events', kwargs, SADO, name='data-v-evt')
        self._settings  = self._createOrganizer('settings', kwargs, SADO, name='data-v-sets')
        self._icon      = self._createOrganizer('icons', kwargs, SADO, name='data-v-icon')

        self._styles   = self._createOrganizer('styles', kwargs, Stylesheet)
        self._classes  = self._createOrganizer('classes', kwargs, Classes)

        self._render   = ArgsUtils.get('render', {}, kwargs)
        self._doms     = ArgsUtils.get('doms', {}, kwargs)
        self._writes   = ArgsUtils.get('writes', [], kwargs)
开发者ID:sernst,项目名称:StaticFlow,代码行数:30,代码来源:DomRenderData.py

示例10: _activateWidgetDisplayImpl

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import get [as 别名]
 def _activateWidgetDisplayImpl(self, **kwargs):
     super(LoadingWidget, self)._activateWidgetDisplayImpl(**kwargs)
     self.target     = ArgsUtils.get('target', None, kwargs)
     self.header     = ArgsUtils.get('header', None, kwargs)
     self.info       = ArgsUtils.get('info', None, kwargs)
     self.isShowing  = True
     self._animatedIcon.start()
开发者ID:sernst,项目名称:Cadence,代码行数:9,代码来源:LoadingWidget.py

示例11: getPrefix

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import get [as 别名]
    def getPrefix(self, *args, **kwargs):
        if self._locationPrefix:
            item = self.getStackData()[-1]
            loc  = ' -> %s #%s]' % (item['file'], StringUtils.toUnicode(item['line']))
        else:
            loc = ']'

        if self._app and self._app.pyramidApp:
            wsgi     = self._app.environ
            initials = self._INITIALS_RX.sub('', ArgsUtils.get('REMOTE_USER', '', wsgi))
            if initials:
                initials += ' | '

            domainName  = ArgsUtils.get('SERVER_NAME', '', wsgi)
            uriPath = ArgsUtils.get(
                'REQUEST_URI',
                ArgsUtils.get('HTTP_REQUEST_URI', '', wsgi), wsgi)

            info = ' <' + initials + domainName + uriPath + '>'
        else:
            info = ''

        threadID = ThreadUtils.getCurrentID()
        return StringUtils.toUnicode(
            TimeUtils.toFormat('[%a %H:%M <%S.%f>') + '<' + threadID + '>' + info + loc)
开发者ID:sernst,项目名称:Ziggurat,代码行数:27,代码来源:ServerLogger.py

示例12: _renderImpl

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import get [as 别名]
    def _renderImpl(self, **kwargs):
        a = self.attrs

        LayoutAttributeParser.parseScale(a, True, kwargs)
        LayoutAttributeParser.parseAlignment(a, True, kwargs)
        LayoutAttributeParser.parsePadding(a, True, kwargs, group=a.styleGroup, defaultValue=GeneralSizeEnum.xsmall[0])

        color = a.getAsColorValue(TagAttributesEnum.COLOR, ArgsUtils.get("colorDef", None, kwargs), kwargs)

        if not ArgsUtils.get("skipBorder", False, kwargs):
            LayoutAttributeParser.parseBorder(
                a,
                True,
                kwargs,
                group=a.styleGroup,
                defaultColor=ArgsUtils.get("borderColorDef", color.shiftColors[1] if color else None, kwargs),
            )

        # -------------------------------------------------------------------------------------------
        # BACKGROUND COLOR
        if not ArgsUtils.get("skipBackground", False, kwargs):
            if isinstance(color, ColorValue):
                a.styles.add("background-color", color.web, a.styleGroup)
            elif a.explicitAccent or a.themeChanged:
                self.useBackground()

        a.classes.add("sfml-push", a.styleGroup)
开发者ID:sernst,项目名称:StaticFlow,代码行数:29,代码来源:FooterTag.py

示例13: __init__

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import get [as 别名]
    def __init__(self, target, **kwargs):
        """Creates a new instance of TargetData."""
        self._target        = target
        self._channels      = ArgsUtils.get('channels', dict(), kwargs)
        self._dutyFactor    = ArgsUtils.get('dutyFactor', 0.5, kwargs)
        self._phaseOffset   = float(ArgsUtils.get('phaseOffset', 0.0, kwargs))

        print(self.target, self._phaseOffset)
开发者ID:sernst,项目名称:Cadence,代码行数:10,代码来源:TargetData.py

示例14: __init__

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import get [as 别名]
 def __init__(self, parent=None, **kwargs):
     """Creates a new instance of PySideGuiWidget."""
     QtGui.QWidget.__init__(self, parent)
     self._mainWindow = None
     self._id = ArgsUtils.get("id", self.__class__.__name__, kwargs)
     self._widgetID = ArgsUtils.get("widgetID", self._id, kwargs)
     self._userData = ArgsUtils.get("userData", None, kwargs)
     self._resourceFolderParts = PyGlassGuiUtils.getResourceFolderParts(self)
开发者ID:hannahp,项目名称:PyGlass,代码行数:10,代码来源:PyGlassElement.py

示例15: __init__

# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import get [as 别名]
 def __init__(self, ident, label =None, message =None, **kwargs):
     """Creates a new instance of ViewResponse."""
     self._id      = ident
     self._label   = label
     self._message = message
     self._kind    = ArgsUtils.get('kind', self.DEFAULT_KIND, kwargs)
     self._allowCaching = ArgsUtils.get('allowCaching', False, kwargs)
     self._data = ArgsUtils.getAsDict('data', kwargs)
开发者ID:sernst,项目名称:Ziggurat,代码行数:10,代码来源:ViewResponse.py


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