Ai
3 Star 3 Fork 2

shede333/SWXcodeBuildPythonScript

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
TestShell.py 1.80 KB
一键复制 编辑 原始数据 按行查看 历史
shede333 提交于 2013-12-20 19:30 +08:00 . 增加编译模式选择
#_*_ coding:UTF-8 _*_
__author__ = 'shaowei'
import os
import HandleXcodeBuild
import string
import sys
default_work_path = "~/Git/PushPrompt" # 默认的project根目录
# def check_input_bool(default_path):
# 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 " + user_input
#
# default_work_path = "~/Git/PushPrompt"
#
# work_path = raw_input("please 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:
# sys.exit() # 退出程序
#
# work_path = os.path.expanduser(work_path)
#
# #切换到工作目录
# os.chdir(work_path)
#
# params = HandleXcodeSetting.handle_string()
#
# path_params = {}
# for key in params:
# value = params[key]
# if string.find(value, "fygoijpftcufifdfzfndmdhcxmir") != -1:
# path_params[key] = value
#
#
# # output
# for key, value in path_params.items():
# print value, " : ", key
import commands
work_path = os.path.expanduser(default_work_path)
os.chdir(work_path)
shell_build_list = "xcodebuild -list"
status, output = commands.getstatusoutput(shell_build_list)
arr_param = output.split("\n")
start_get = False
for item in arr_param:
item_strip = item.strip()
# print len(item_strip), ":", item
if start_get:
if len(item_strip) == 0:
break
else:
print "p:", item_strip
else:
if item_strip.startswith("Build Configurations"):
start_get = True
sys.exit()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/shede333/SWXcodeBuildPythonScript.git
git@gitee.com:shede333/SWXcodeBuildPythonScript.git
shede333
SWXcodeBuildPythonScript
SWXcodeBuildPythonScript
master

搜索帮助