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