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


Python DictUtils.clone方法代码示例

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


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

示例1: clone

# 需要导入模块: from pyaid.dict.DictUtils import DictUtils [as 别名]
# 或者: from pyaid.dict.DictUtils.DictUtils import clone [as 别名]
    def clone(cls, item):
        out = []
        for value in item:
            if isinstance(value, dict):
                from pyaid.dict.DictUtils import DictUtils
                out.append(DictUtils.clone(value))
            elif isinstance(value, list) or isinstance(value, tuple):
                out.append(ListUtils.clone(value))
            else:
                out.append(value)

        if isinstance(item, tuple):
            return tuple(out)
        return out
开发者ID:sernst,项目名称:PyAid,代码行数:16,代码来源:ListUtils.py

示例2: _runImpl

# 需要导入模块: from pyaid.dict.DictUtils import DictUtils [as 别名]
# 或者: from pyaid.dict.DictUtils.DictUtils import clone [as 别名]
    def _runImpl(self):
        """Doc..."""
        data = self._flexData

        self._log.write(
            '<div style="font-size:24px">Beginning distribution file upload(s)</div><hr>')

        for platformID, platformIsActive in data.platformSelection.iteritems():
            if not platformIsActive or not data.hasPlatform(platformID):
                continue

            data.setPlatform(platformID)
            if data.isPlatformUploaded:
                url = data.platformUploads[platformID]
            else:
                uploader = BuildPackageUploader(data, self._bucket)
                self._log.write(
                    'Uploading %s distribution file to: %s' % (platformID, uploader.uploadFolder))
                url = uploader.upload(platformID)
                if url is None:
                    continue

                data.platformUploads[platformID] = url

            self._log.write(
                '<div style="font-size:18px">Deployed URL:</div><br />' +
                '<a style="font-size:8px" href="%s">%s</a>' % ((url, url)))

        if self._releaseNotes:
            self._log.write('Generating release notes...')
            notes = self._createReleaseNotes()
        else:
            notes = u''

        if self._doSendEmails:
            self._log.write('Sending notification emails...')
            self._sendEmailNotifications(data.platformUploads, notes)

        self._log.write('<br /><div style="font-size:24px">Deployment Complete!</div>')
        self._output['urls'] = DictUtils.clone(data.platformUploads)
        return 0
开发者ID:sernst,项目名称:CompilerDeck,代码行数:43,代码来源:S3DeployerThread.py

示例3: getMerged

# 需要导入模块: from pyaid.dict.DictUtils import DictUtils [as 别名]
# 或者: from pyaid.dict.DictUtils.DictUtils import clone [as 别名]
    def getMerged(self, key, defaultValue =None, localOnly =False):
        items = []
        sources = self.localDataSources if localOnly else self.dataSources
        for source in sources:
            if source is None:
                continue

            res = source.get(key, self.DATA_GET_NULL)
            if res != self.DATA_GET_NULL:
                items.append(res)

        if len(items) == 0:
            return defaultValue

        if len(items) == 1:
            return DictUtils.clone(items[0])

        out = items.pop()
        while len(items):
            out = DictUtils.merge(out, items.pop())
        return out
开发者ID:sernst,项目名称:StaticFlow,代码行数:23,代码来源:ConfigsDataComponent.py


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