本文整理汇总了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
示例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
示例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