Ai
3 Star 3 Fork 2

shede333/SWXcodeBuildPythonScript

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CommandInteraction.py 1.74 KB
一键复制 编辑 原始数据 按行查看 历史
shede333 提交于 2013-12-24 23:34 +08:00 . fix .app file path invalid
#_*_ 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]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/shede333/SWXcodeBuildPythonScript.git
git@gitee.com:shede333/SWXcodeBuildPythonScript.git
shede333
SWXcodeBuildPythonScript
SWXcodeBuildPythonScript
master

搜索帮助