main: fix pep8 style
This commit is contained in:
parent
ffffbd4542
commit
8b69df61e7
2 changed files with 29 additions and 30 deletions
|
@ -174,17 +174,15 @@ class ShadowSocksServer(object):
|
|||
|
||||
def default_options(self):
|
||||
return {
|
||||
"server":"127.0.0.1",
|
||||
"server_port":8388,
|
||||
"local_port":1081,
|
||||
"password":"Keep Your Password",
|
||||
"timeout":60,
|
||||
"method":"aes-128-cfb",
|
||||
"IPv6": False
|
||||
"server": "127.0.0.1",
|
||||
"server_port": 8388,
|
||||
"local_port": 1081,
|
||||
"password": "Keep Your Password",
|
||||
"timeout": 60,
|
||||
"method": "aes-128-cfb",
|
||||
"IPv6": False
|
||||
}
|
||||
|
||||
|
||||
|
||||
def serve_forever(self):
|
||||
self.set_logging()
|
||||
self.run_info()
|
||||
|
@ -197,7 +195,7 @@ class ShadowSocksServer(object):
|
|||
KEY = self.options['password']
|
||||
METHOD = self.options.get('method', None)
|
||||
LOCAL = self.options.get('local', '')
|
||||
|
||||
|
||||
encrypt.init_table(KEY, METHOD)
|
||||
|
||||
try:
|
||||
|
@ -219,7 +217,8 @@ class ShadowSocksServer(object):
|
|||
|
||||
def set_logging(self):
|
||||
logfmt = '[%%(levelname)s] %s%%(message)s' % '%(name)s - '
|
||||
config = lambda x: logging.basicConfig(level=x, format='[%(asctime)s] ' + logfmt, datefmt='%Y%m%d %H:%M:%S')
|
||||
config = lambda x: logging.basicConfig(level=x,
|
||||
format='[%(asctime)s] ' + logfmt, datefmt='%Y%m%d %H:%M:%S')
|
||||
if self.options.get('debug'):
|
||||
config(logging.DEBUG)
|
||||
else:
|
||||
|
@ -292,6 +291,5 @@ class ShadowSocksServer(object):
|
|||
logging.info('shadowsocks %s' % version)
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
ShadowSocksServer().serve_forever()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue