本文整理汇总了Python中pyaid.ArgsUtils.ArgsUtils.getLogger方法的典型用法代码示例。如果您正苦于以下问题:Python ArgsUtils.getLogger方法的具体用法?Python ArgsUtils.getLogger怎么用?Python ArgsUtils.getLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyaid.ArgsUtils.ArgsUtils
的用法示例。
在下文中一共展示了ArgsUtils.getLogger方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import getLogger [as 别名]
def __init__(self, containerPath, isRemoteDeploy =False, sourceRootFolder ='src', **kwargs):
"""Creates a new instance of Site."""
super(Site, self).__init__()
self.errorCount = 0
self.warningCount = 0
self._staticPaths = []
self._logger = ArgsUtils.getLogger(self, kwargs)
self._sourceRootFolderName = sourceRootFolder
# NGinx root path in which all files reside
self._containerPath = FileUtils.cleanupPath(containerPath, isDir=True)
# Location of the source files used to create the website
self._sourceWebRootPath = FileUtils.createPath(containerPath, sourceRootFolder, isDir=True)
# Locations where files should be deployed. If the target root path is None, which is the
# default value, the local web root path is used in its place.
if isRemoteDeploy:
self._targetWebRootPath = FileUtils.cleanupPath(
tempfile.mkdtemp(prefix='staticFlow_'), isDir=True)
else:
self._targetWebRootPath = None
self._localWebRootPath = FileUtils.createPath(
containerPath, ArgsUtils.get('localRootFolder', 'root', kwargs), isDir=True)
path = FileUtils.createPath(self.sourceWebRootPath, '__site__.def', isFile=True)
try:
self._data.data = JSON.fromFile(path, throwError=True)
except Exception, err:
self.writeLogError(u'Unable to load site definition file: "%s"' % path, error=err)
pass
示例2: __init__
# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import getLogger [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(),
],
}
示例3: __init__
# 需要导入模块: from pyaid.ArgsUtils import ArgsUtils [as 别名]
# 或者: from pyaid.ArgsUtils.ArgsUtils import getLogger [as 别名]
def __init__(self, localRootPath, sourceWebRootPath, forceHtml =False, forceAll =False, **kwargs):
"""Creates a new instance of S3SiteDeployer."""
self._logger = ArgsUtils.getLogger(self, kwargs)
self._localRootPath = FileUtils.cleanupPath(localRootPath, isDir=True)
self._sourceWebRootPath = FileUtils.cleanupPath(sourceWebRootPath, isDir=True)
self._forceHtml = forceHtml
self._forceAll = forceAll
self._cdnRootPath = None
try:
siteData = JSON.fromFile(FileUtils.createPath(
sourceWebRootPath, '__site__.def', isFile=True), throwError=True)
except Exception, err:
self._logger.writeError(
u'Failed to read __site__.def file. Check to make sure JSON is valid.', err)
siteData = {}