|
@ -54,13 +54,30 @@ def print_exception(e): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def print_shadowsocks(): |
|
|
def print_shadowsocks(): |
|
|
version = '' |
|
|
version_str = '' |
|
|
try: |
|
|
try: |
|
|
import pkg_resources |
|
|
import pkg_resources |
|
|
version = pkg_resources.get_distribution('shadowsocks').version |
|
|
version_str = pkg_resources.get_distribution('shadowsocks').version |
|
|
|
|
|
except Exception: |
|
|
|
|
|
try: |
|
|
|
|
|
from shadowsocks import version |
|
|
|
|
|
version_str = version.version() |
|
|
|
|
|
except Exception: |
|
|
|
|
|
pass |
|
|
|
|
|
print('ShadowsocksR %s' % version_str) |
|
|
|
|
|
|
|
|
|
|
|
def log_shadowsocks_version(): |
|
|
|
|
|
version_str = '' |
|
|
|
|
|
try: |
|
|
|
|
|
import pkg_resources |
|
|
|
|
|
version_str = pkg_resources.get_distribution('shadowsocks').version |
|
|
|
|
|
except Exception: |
|
|
|
|
|
try: |
|
|
|
|
|
from shadowsocks import version |
|
|
|
|
|
version_str = version.version() |
|
|
except Exception: |
|
|
except Exception: |
|
|
pass |
|
|
pass |
|
|
print('Shadowsocks %s' % version) |
|
|
logging.info('ShadowsocksR %s' % version_str) |
|
|
|
|
|
|
|
|
def find_config(): |
|
|
def find_config(): |
|
|
config_path = 'user-config.json' |
|
|
config_path = 'user-config.json' |
|
|