代码拉取完成,页面将自动刷新
#_*_ coding:UTF-8 _*_
__author__ = 'shaowei'
import sys
import os
import HandleXcodeBuild
def check_input_bool(default_path):
"""from command line check user input:yes or no"""
prompt_input = "是否开始编译默认项目- " + default_path + " ; yes or no :"
while True:
user_input = raw_input(prompt_input)
user_input = user_input.lower()
if user_input == "yes":
return True
elif user_input == "no":
return False
else:
print "only input 'yes' or 'no', please input again "
def get_project_path(default_work_path):
"""prompt user input project root path,if no or error input, use 'default_work_path' """
work_path = raw_input("please input project root folder path:\n")
if os.path.isdir(os.path.expanduser(work_path)):
print "start build:", work_path
else:
print "路径:", work_path, "不存在"
user_select = check_input_bool(default_work_path)
if user_select:
work_path = default_work_path
else:
print "程序结束,退出。"
sys.exit() # 退出程序
return work_path
def get_build_configuration():
"""prompt user input build configuration 1."""
configuration_list = HandleXcodeBuild.get_configuration_list()
if len(configuration_list) is 0:
print "build configuration no exist, please check current folder have xcode-project"
sys.exit()
print "project build configuration list:"
index = 0
for item in configuration_list:
print "%s.%s" % (index, item)
index += 1
list_length = len(configuration_list)
user_select = 0
while 1:
user_select = int(raw_input("please input build option index 0 ~ %s :" % (list_length-1)))
if user_select < 0 or user_select >= list_length:
print "your input index '%s' no exist." % user_select
else:
break
return configuration_list[user_select]
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。