实现配置文件插拔式设计

This commit is contained in:
Jing Ling
2020-08-07 18:16:01 +08:00
parent ecc91f99f7
commit d7f7c54b1a
6 changed files with 199 additions and 77 deletions
+2 -2
View File
@@ -29,8 +29,8 @@ def get_ports(port):
elif isinstance(port, int):
if 0 <= port <= 65535:
ports = {port}
elif port in {'default', 'small', 'large'}:
logger.log('DEBUG', '{port} port range')
elif port in {'small', 'medium', 'large'}:
logger.log('DEBUG', f'{port} port range')
ports = setting.ports.get(port)
if not ports: # 意外情况
logger.log('ERROR', 'The specified request port range is incorrect')