pep8 =)
This commit is contained in:
		
							
								
								
									
										8
									
								
								dodo.py
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								dodo.py
									
									
									
									
									
								
							| @@ -17,17 +17,18 @@ config_dodo = f"{home_dir}/.config/dodo/" | |||||||
| mods_id = "" | mods_id = "" | ||||||
| listen_server = True | listen_server = True | ||||||
|  |  | ||||||
|  |  | ||||||
| @click.group() | @click.group() | ||||||
| def dodo(): | def dodo(): | ||||||
|     pass |     pass | ||||||
|  |  | ||||||
|  |  | ||||||
| list_config = next(os.walk(config_dodo), (None, None, []))[2]  # [] if no file | list_config = next(os.walk(config_dodo), (None, None, []))[2]  # [] if no file | ||||||
| x = list_config.count('.directory') | x = list_config.count('.directory') | ||||||
| if x>0: | if x>0: | ||||||
|     list_config.remove('.directory') |     list_config.remove('.directory') | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| def logging(l): | def logging(l): | ||||||
|     "Записываем логи в файл" |     "Записываем логи в файл" | ||||||
|     with open(dir_server + "logs", "a") as filelog: |     with open(dir_server + "logs", "a") as filelog: | ||||||
| @@ -53,8 +54,6 @@ def create_dir(directory): | |||||||
|         logging(f"Не удалось создать директорию - {directory}") |         logging(f"Не удалось создать директорию - {directory}") | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| def check_int(number=""): | def check_int(number=""): | ||||||
|     "Проверка на ввод числа" |     "Проверка на ввод числа" | ||||||
|     x="" |     x="" | ||||||
| @@ -107,7 +106,6 @@ def config(map_server=list_config): | |||||||
|     else: |     else: | ||||||
|         cluster_server = False |         cluster_server = False | ||||||
|  |  | ||||||
|  |  | ||||||
|     if map_server != []: |     if map_server != []: | ||||||
|         print("Уже установленные карты: ") |         print("Уже установленные карты: ") | ||||||
|         for i in map_server: |         for i in map_server: | ||||||
| @@ -232,6 +230,8 @@ def yaml_create(cluster_server, map_server, name_server, port_server, query_port | |||||||
|     with open(config_dodo + f"{map_server[-1]}", 'w') as yamlfile: |     with open(config_dodo + f"{map_server[-1]}", 'w') as yamlfile: | ||||||
|         data = yaml.dump(settings_dodo, yamlfile) |         data = yaml.dump(settings_dodo, yamlfile) | ||||||
|         print(colorama.Fore.GREEN + "Конфиг создан" + colorama.Style.RESET_ALL) |         print(colorama.Fore.GREEN + "Конфиг создан" + colorama.Style.RESET_ALL) | ||||||
|  |  | ||||||
|  |  | ||||||
| @dodo.command() | @dodo.command() | ||||||
| def servers(map_servers=list_config): | def servers(map_servers=list_config): | ||||||
|     if map_servers==[]: |     if map_servers==[]: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user