平台platform去掉all属性;修复配置生成报错
parent
c9c91d5b0a
commit
8a74e1e67b
|
|
@ -35,13 +35,14 @@ class platform(enum.Enum):
|
||||||
No = 'None'
|
No = 'None'
|
||||||
Android = 'Android'
|
Android = 'Android'
|
||||||
iOS = 'iOS'
|
iOS = 'iOS'
|
||||||
All = 'All'
|
|
||||||
|
|
||||||
def get_platform_list(platform_param):
|
def get_platform_list(platform_param):
|
||||||
if platform_param == platform.All.value:
|
if platform_param == platform.All.value:
|
||||||
return [platform.Android.value, platform.iOS.value]
|
return [platform.Android.value, platform.iOS.value]
|
||||||
elif platform_param == platform.Android.value or platform_param == platform.iOS.value:
|
elif platform_param == platform.Android.value or platform_param == platform.iOS.value:
|
||||||
return [platform_param]
|
return [platform_param]
|
||||||
|
elif platform_param == platform.No.value:
|
||||||
|
return [platform_param]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# region 项目定义
|
# region 项目定义
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,8 @@ class ConfigGenerator:
|
||||||
self.parse_cdn_config(row_values)
|
self.parse_cdn_config(row_values)
|
||||||
elif i == 1:
|
elif i == 1:
|
||||||
self.parse_remote_config(row_values)
|
self.parse_remote_config(row_values)
|
||||||
|
elif i == 2:
|
||||||
|
continue
|
||||||
elif i == 3:
|
elif i == 3:
|
||||||
self.parse_field(row_values, self.field_dict)
|
self.parse_field(row_values, self.field_dict)
|
||||||
elif i == 4:
|
elif i == 4:
|
||||||
|
|
@ -193,8 +195,8 @@ class ConfigGenerator:
|
||||||
local_file_path = self.get_local_config_file_path()
|
local_file_path = self.get_local_config_file_path()
|
||||||
utils.write_json_file(local_file_path, _json)
|
utils.write_json_file(local_file_path, _json)
|
||||||
config.notification.append_msg(f"{filename} 关卡配置生成成功!当前总关卡数:{len(config_json['datas'])}")
|
config.notification.append_msg(f"{filename} 关卡配置生成成功!当前总关卡数:{len(config_json['datas'])}")
|
||||||
config.wechat_alert_message(f'{filename} json:{_json}')
|
# config.wechat_alert_message(f'{filename}:{_json}')
|
||||||
print(f"{filename} json: {_json}")
|
print(f"{filename}:{_json}")
|
||||||
return _json
|
return _json
|
||||||
|
|
||||||
# region 行数据解析
|
# region 行数据解析
|
||||||
|
|
@ -227,7 +229,7 @@ class ConfigGenerator:
|
||||||
if value is None:
|
if value is None:
|
||||||
return False, f'值为空'
|
return False, f'值为空'
|
||||||
|
|
||||||
if field_type == '': # 默认值
|
if value == '': # 默认值
|
||||||
return True, ''
|
return True, ''
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
@ -345,7 +347,7 @@ class ConfigGenerator:
|
||||||
def get_config_filename(self):
|
def get_config_filename(self):
|
||||||
cdn_filename = self.cdn_config.filename
|
cdn_filename = self.cdn_config.filename
|
||||||
if '#platform#' in cdn_filename:
|
if '#platform#' in cdn_filename:
|
||||||
if self.platform == config.platform.All.value or self.platform == config.platform.No.value:
|
if self.platform == config.platform.No.value:
|
||||||
cdn_filename = cdn_filename.replace('#platform#', '')
|
cdn_filename = cdn_filename.replace('#platform#', '')
|
||||||
else:
|
else:
|
||||||
cdn_filename = cdn_filename.replace('#platform#', self.platform)
|
cdn_filename = cdn_filename.replace('#platform#', self.platform)
|
||||||
|
|
@ -395,8 +397,8 @@ if __name__ == "__main__":
|
||||||
config_generator = ConfigGenerator(google_sheet_file_name, sheet_table_name, project_id, platform, env)
|
config_generator = ConfigGenerator(google_sheet_file_name, sheet_table_name, project_id, platform, env)
|
||||||
config_json = config_generator.gen_config_json()
|
config_json = config_generator.gen_config_json()
|
||||||
generation = None
|
generation = None
|
||||||
if str(param_enable_upload_cdn).lower() is 'true':
|
if str(param_enable_upload_cdn).lower() == 'true':
|
||||||
generation = config_generator.upload_cdn()
|
generation = config_generator.upload_cdn()
|
||||||
if str(param_enable_upload_remote_config).lower() is 'true':
|
if str(param_enable_upload_remote_config).lower() == 'true':
|
||||||
config_generator.update_remote_config(generation)
|
config_generator.update_remote_config(generation)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue