本文整理汇总了Python中generator.runtime.Log.Log.error方法的典型用法代码示例。如果您正苦于以下问题:Python Log.error方法的具体用法?Python Log.error怎么用?Python Log.error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类generator.runtime.Log.Log
的用法示例。
在下文中一共展示了Log.error方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from generator.runtime.Log import Log [as 别名]
# 或者: from generator.runtime.Log.Log import error [as 别名]
def main():
global console
# Init console object
console = Log()
if len(sys.argv[1:]) == 0:
basename = os.path.basename(sys.argv[0])
console.info("Usage: %s [options]" % basename)
console.info("Try '%s -h' or '%s --help' to show the help message." % (basename, basename))
sys.exit(1)
parser = optparse.OptionParser()
parser.add_option("--source", dest="source", metavar="DIRECTORY", help="Source directory of theme")
parser.add_option("--target", dest="target", metavar="DIRECTORY", help="Target directory for theme")
parser.add_option("--sync", dest="sync", action="store_true", default=False)
(options, args) = parser.parse_args(sys.argv[1:])
if options.source == None or options.target == None:
console.error("Please define both, the target and the source folder!")
sys.exit(1)
data = getData()
source = os.path.abspath(options.source)
target = os.path.abspath(options.target)
sync = options.sync
console.info("Processing theme...")
console.info("Source folder: %s" % source)
console.info("Target folder: %s" % target)
console.indent()
# Process entries
for entry in data:
name = entry[0]
console.info("Processing entry %s" % name)
console.indent()
# Preparing name list
name = entry[0]
pre = name.split("/")[0]
short = name.split("/")[1]
names = []
names.extend(entry)
# Copy images in different sizes
for size in SIZES:
copyFile(source, target, entry, size, sync)
console.outdent()
console.outdent()