73 lines
2.1 KiB
Python
73 lines
2.1 KiB
Python
import os
|
||
import sys
|
||
|
||
|
||
|
||
DEF_CUS_APP="17"
|
||
DEF_PLC_APP="0"
|
||
DEF_CORE_TYPE="plc"
|
||
DEF_REL="debug"
|
||
DEF_PROTO_TYPE="p12087"
|
||
DEF_BOARDS_TYPE="evb03"
|
||
DEF_RF_OPT="no_rf"
|
||
DEF_DUAL_OPT="no_dual"
|
||
DEF_INCREMENT_OPT=""
|
||
DEF_BUILD_RECORD="./KL3_SG_BUILD_RECORE"
|
||
DEF_INDEX=0
|
||
|
||
CHIP_ID=("HZ", "HZ", "HZ", "HZ", "HZ", "HZ", "HZ", "HZ", "HZ")
|
||
IMAGE_TYPE=("cco", "cco", "sta", "sta", "new_type_cco", "new_type_cco", "cco", "sta", "new_type_cco")
|
||
GROUP_FLASH=("4m", "4m", "4m", "4m", "4m", "4m", "4m", "4m", "4m")
|
||
GROUP_PSRAM=("8m", "8m", "0m", "0m", "8m", "8m", "8m", "0m", "8m")
|
||
GROUP_RF_OPT=("rf", "no_rf", "rf", "no_rf", "rf", "no_rf", "rf", "rf", "rf")
|
||
GROUP_DUAL_OPT=("dual", "no_dual", "dual", "no_dual", "dual", "no_dual", "no_dual", "no_dual", "no_dual")
|
||
|
||
GROUP_PROTO_TYPE=("p12087", "p1901")
|
||
GROUP_BOARDS_TYPE=("fpga03", "evb03", "htzd03", "qj03", "flx03", "spe03", "gx03", "dt03", "yp03", "wtz03", "htzd03norf", "qc03")
|
||
|
||
|
||
|
||
|
||
# 错误退出
|
||
def _error_handle(e:Exception):
|
||
file=e.__traceback__.tb_frame.f_globals['__file__']
|
||
line=e.__traceback__.tb_lineno
|
||
print(e)
|
||
print(f"文件: {file}:{line}" )
|
||
exit(-1)
|
||
|
||
|
||
|
||
# 获取proto,这个参数没有位置限制
|
||
def _get_proto_type(params:list):
|
||
global DEF_PROTO_TYPE
|
||
for item in params:
|
||
if(item in GROUP_PROTO_TYPE):
|
||
DEF_PROTO_TYPE=item
|
||
return
|
||
|
||
# 获取index,这个参数只能在第一位
|
||
def _get_index(params:list):
|
||
global DEF_INDEX
|
||
try:
|
||
DEF_INDEX=int(params[1])
|
||
except Exception as e:
|
||
_error_handle(e)
|
||
|
||
|
||
|
||
# 参数 image_type
|
||
if __name__ == "__main__":
|
||
# a=dict(os.environ)
|
||
# print(a)
|
||
# for item in sys.argv:
|
||
# print(item)
|
||
# _get_proto_type(sys.argv)
|
||
# _get_index(sys.argv)
|
||
a={"ssss":"ssss","dddd":"dddd","cccc":"cccc"}
|
||
b={"ssss":"ssss"}
|
||
c=a.items()-b.items()
|
||
print(type(c),dict(c))
|
||
print(a)
|
||
|