forked from M-Labs/artiq
tools: style
This commit is contained in:
parent
bb706c1fe2
commit
6a7377244b
|
@ -1,10 +1,8 @@
|
||||||
from operator import itemgetter
|
|
||||||
import importlib.machinery
|
import importlib.machinery
|
||||||
import linecache
|
import linecache
|
||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
import asyncio
|
import asyncio
|
||||||
import time
|
|
||||||
import collections
|
import collections
|
||||||
import os
|
import os
|
||||||
import atexit
|
import atexit
|
||||||
|
@ -20,10 +18,11 @@ artiq_version = get_versions()['version']
|
||||||
|
|
||||||
|
|
||||||
__all__ = ["parse_arguments", "elide", "short_format", "file_import",
|
__all__ = ["parse_arguments", "elide", "short_format", "file_import",
|
||||||
"get_experiment", "verbosity_args", "simple_network_args", "init_logger",
|
"get_experiment", "verbosity_args", "simple_network_args",
|
||||||
"bind_address_from_args", "atexit_register_coroutine",
|
"init_logger", "bind_address_from_args",
|
||||||
"exc_to_warning", "asyncio_wait_or_cancel",
|
"atexit_register_coroutine", "exc_to_warning",
|
||||||
"TaskObject", "Condition", "get_windows_drives"]
|
"asyncio_wait_or_cancel", "TaskObject", "Condition",
|
||||||
|
"get_windows_drives"]
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
@ -132,9 +131,10 @@ def simple_network_args(parser, default_port):
|
||||||
else:
|
else:
|
||||||
for name, purpose, default in default_port:
|
for name, purpose, default in default_port:
|
||||||
h = ("TCP port to listen to for {} (default: {})"
|
h = ("TCP port to listen to for {} (default: {})"
|
||||||
.format(purpose, default))
|
.format(purpose, default))
|
||||||
group.add_argument("--port-" + name, default=default, type=int,
|
group.add_argument("--port-" + name, default=default, type=int,
|
||||||
help=h)
|
help=h)
|
||||||
|
|
||||||
|
|
||||||
class MultilineFormatter(logging.Formatter):
|
class MultilineFormatter(logging.Formatter):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -159,7 +159,8 @@ def multiline_log_config(level):
|
||||||
|
|
||||||
|
|
||||||
def init_logger(args):
|
def init_logger(args):
|
||||||
multiline_log_config(level=logging.WARNING + args.quiet*10 - args.verbose*10)
|
multiline_log_config(
|
||||||
|
level=logging.WARNING + args.quiet*10 - args.verbose*10)
|
||||||
|
|
||||||
|
|
||||||
def bind_address_from_args(args):
|
def bind_address_from_args(args):
|
||||||
|
|
Loading…
Reference in New Issue