def main(argv):
option = ''
try:
opts, args = getopt.getopt(argv, "h:o:", ["option="])
except getopt.GetoptError:
print 'test.py -o <option[translate or build]>'
sys.exit(2)
for opt, arg in opts:
if opt == '-h':
print 'test.py -o <option[translate or build]>'
sys.exit()
elif opt in ("-o", "--option"):
option = arg
if option == 'translate':
fname = str(raw_input("File name(Or absolute path to file if it is not in this directory):\n"))
execute(fname)
elif option == 'build':
name_fname = str(raw_input("File name for csv containing string names(Or absolute path to file):\n"))
values_fname = str(raw_input("File name for csv containing translation(Or absolute path to file):\n"))
build_xml(name_fname, values_fname)
else:
print "Invalid option: " + option
print "Option must be either translate or build"
translate.py 文件源码
python
阅读 31
收藏 0
点赞 0
评论 0
评论列表
文章目录