From 703537f3e898a1f1c15b08b2e0e553f24a2ddf2a Mon Sep 17 00:00:00 2001 From: dnomd343 Date: Mon, 1 Aug 2022 15:19:32 +0800 Subject: [PATCH] refactor: rename Methods as Constant --- Basis/{Methods.py => Constant.py} | 2 ++ Builder/Shadowsocks.py | 2 +- Builder/ShadowsocksR.py | 2 +- Builder/VMess.py | 2 +- Builder/Xray.py | 2 +- Tester/Hysteria.py | 2 +- Tester/Plugin.py | 2 +- Tester/Shadowsocks.py | 2 +- Tester/ShadowsocksR.py | 2 +- Tester/Trojan.py | 2 +- Tester/TrojanGo.py | 2 +- Tester/V2ray.py | 2 +- Tester/VLESS.py | 2 +- Tester/VMess.py | 2 +- Tester/Xray.py | 2 +- 15 files changed, 16 insertions(+), 14 deletions(-) rename Basis/{Methods.py => Constant.py} (99%) diff --git a/Basis/Methods.py b/Basis/Constant.py similarity index 99% rename from Basis/Methods.py rename to Basis/Constant.py index 8c3057f..f974176 100644 --- a/Basis/Methods.py +++ b/Basis/Constant.py @@ -1,6 +1,8 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +version = 'dev' + # Shadowsocks Info ssMethods = { # methods support of different Shadowsocks project 'ss-rust': [ # table method removed refer to https://github.com/shadowsocks/shadowsocks-rust/issues/887 diff --git a/Builder/Shadowsocks.py b/Builder/Shadowsocks.py index 1464a33..aa71a50 100644 --- a/Builder/Shadowsocks.py +++ b/Builder/Shadowsocks.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- import json -from Basis.Methods import ssMethods, ssAllMethods +from Basis.Constant import ssMethods, ssAllMethods def loadConfig(proxyInfo: dict, socksInfo: dict) -> dict: # load basic config option diff --git a/Builder/ShadowsocksR.py b/Builder/ShadowsocksR.py index 9ec94da..170cf27 100644 --- a/Builder/ShadowsocksR.py +++ b/Builder/ShadowsocksR.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- import json -from Basis.Methods import ssrMethods, ssrProtocols, ssrObfuscations +from Basis.Constant import ssrMethods, ssrProtocols, ssrObfuscations def load(proxyInfo: dict, socksInfo: dict, configFile: str) -> tuple[list, str, dict]: diff --git a/Builder/VMess.py b/Builder/VMess.py index 693d9af..230fca7 100644 --- a/Builder/VMess.py +++ b/Builder/VMess.py @@ -3,7 +3,7 @@ import json from Builder import V2ray -from Basis.Methods import vmessMethods +from Basis.Constant import vmessMethods def load(proxyInfo: dict, socksInfo: dict, configFile: str) -> tuple[list, str, dict]: diff --git a/Builder/Xray.py b/Builder/Xray.py index 371c4c9..9f3a538 100644 --- a/Builder/Xray.py +++ b/Builder/Xray.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- from Builder import V2ray -from Basis.Methods import xtlsFlows +from Basis.Constant import xtlsFlows loadConfig = V2ray.loadConfig diff --git a/Tester/Hysteria.py b/Tester/Hysteria.py index 64e3124..a625e6d 100644 --- a/Tester/Hysteria.py +++ b/Tester/Hysteria.py @@ -8,7 +8,7 @@ from Builder import Hysteria from Basis.Logger import logging from Basis.Process import Process from Tester.Settings import Settings -from Basis.Methods import hysteriaProtocols +from Basis.Constant import hysteriaProtocols from Basis.Functions import hostFormat, genFlag, getAvailablePort diff --git a/Tester/Plugin.py b/Tester/Plugin.py index bc62e94..6eeddd1 100644 --- a/Tester/Plugin.py +++ b/Tester/Plugin.py @@ -6,7 +6,7 @@ import re import json from Basis.Logger import logging from Basis.Process import Process -from Basis.Methods import plugins +from Basis.Constant import plugins from Tester.Settings import Settings from Basis.Functions import genFlag, hostFormat, getAvailablePort diff --git a/Tester/Shadowsocks.py b/Tester/Shadowsocks.py index 6f86b69..26fc199 100644 --- a/Tester/Shadowsocks.py +++ b/Tester/Shadowsocks.py @@ -10,7 +10,7 @@ from Builder import Shadowsocks from Basis.Logger import logging from Basis.Process import Process from Tester.Settings import Settings -from Basis.Methods import ssMethods, ssAllMethods +from Basis.Constant import ssMethods, ssAllMethods from Basis.Functions import md5Sum, genFlag, getAvailablePort diff --git a/Tester/ShadowsocksR.py b/Tester/ShadowsocksR.py index 7e53393..484bcc4 100644 --- a/Tester/ShadowsocksR.py +++ b/Tester/ShadowsocksR.py @@ -8,7 +8,7 @@ from Basis.Logger import logging from Basis.Process import Process from Tester.Settings import Settings from Basis.Functions import genFlag, getAvailablePort -from Basis.Methods import ssrMethods, ssrProtocols, ssrObfuscations +from Basis.Constant import ssrMethods, ssrProtocols, ssrObfuscations def loadServer(configFile: str, proxyInfo: dict) -> Process: # load server process diff --git a/Tester/Trojan.py b/Tester/Trojan.py index 0a23103..60c853b 100644 --- a/Tester/Trojan.py +++ b/Tester/Trojan.py @@ -7,7 +7,7 @@ from Tester import Xray from Builder import Trojan from Basis.Logger import logging from Basis.Process import Process -from Basis.Methods import xtlsFlows +from Basis.Constant import xtlsFlows from Tester.Settings import Settings from Basis.Functions import md5Sum, genFlag, getAvailablePort diff --git a/Tester/TrojanGo.py b/Tester/TrojanGo.py index 79c818e..0e1684d 100644 --- a/Tester/TrojanGo.py +++ b/Tester/TrojanGo.py @@ -8,7 +8,7 @@ from Builder import TrojanGo from Basis.Logger import logging from Basis.Process import Process from Tester.Settings import Settings -from Basis.Methods import trojanGoMethods +from Basis.Constant import trojanGoMethods from Basis.Functions import md5Sum, genFlag, getAvailablePort diff --git a/Tester/V2ray.py b/Tester/V2ray.py index 275791f..b02624c 100644 --- a/Tester/V2ray.py +++ b/Tester/V2ray.py @@ -5,7 +5,7 @@ import copy import itertools from Basis.Functions import genFlag from Tester.Settings import Settings -from Basis.Methods import quicMethods, udpObfuscations +from Basis.Constant import quicMethods, udpObfuscations httpConfig = { 'version': '1.1', diff --git a/Tester/VLESS.py b/Tester/VLESS.py index f59a8bd..90f7d06 100644 --- a/Tester/VLESS.py +++ b/Tester/VLESS.py @@ -7,7 +7,7 @@ from Tester import Xray from Builder import VLESS from Basis.Logger import logging from Basis.Process import Process -from Basis.Methods import xtlsFlows +from Basis.Constant import xtlsFlows from Tester.Settings import Settings from Basis.Functions import md5Sum, genUUID, getAvailablePort diff --git a/Tester/VMess.py b/Tester/VMess.py index ea90b47..52d1b95 100644 --- a/Tester/VMess.py +++ b/Tester/VMess.py @@ -10,7 +10,7 @@ from Builder import pathEnv from Basis.Logger import logging from Basis.Process import Process from Tester.Settings import Settings -from Basis.Methods import vmessMethods +from Basis.Constant import vmessMethods from Basis.Functions import md5Sum, genUUID, getAvailablePort diff --git a/Tester/Xray.py b/Tester/Xray.py index 8aeb761..ccacd2d 100644 --- a/Tester/Xray.py +++ b/Tester/Xray.py @@ -6,7 +6,7 @@ import itertools from Tester import V2ray from Basis.Functions import genFlag from Tester.Settings import Settings -from Basis.Methods import xtlsFlows, quicMethods, udpObfuscations +from Basis.Constant import xtlsFlows, quicMethods, udpObfuscations loadConfig = V2ray.loadConfig tcpStream = V2ray.tcpStream