本文整理匯總了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()