mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-11-22 21:50:18 +00:00
style: Format the code a little bit
This will remove the unnecesary import of time, and a little bit of format Signed-off-by: nothingbutlucas <69118979+nothingbutlucas@users.noreply.github.com>
This commit is contained in:
parent
87ff1808a2
commit
541d3cde48
@ -24,13 +24,12 @@
|
|||||||
|
|
||||||
import RNS
|
import RNS
|
||||||
import argparse
|
import argparse
|
||||||
import time
|
|
||||||
|
|
||||||
from RNS._version import __version__
|
from RNS._version import __version__
|
||||||
|
|
||||||
|
|
||||||
def program_setup(configdir, verbosity = 0, quietness = 0, service = False):
|
def program_setup(configdir, verbosity=0, quietness=0, service=False):
|
||||||
targetverbosity = verbosity-quietness
|
targetverbosity = verbosity - quietness
|
||||||
|
|
||||||
if service:
|
if service:
|
||||||
targetlogdest = RNS.LOG_FILE
|
targetlogdest = RNS.LOG_FILE
|
||||||
@ -38,9 +37,10 @@ def program_setup(configdir, verbosity = 0, quietness = 0, service = False):
|
|||||||
else:
|
else:
|
||||||
targetlogdest = RNS.LOG_STDOUT
|
targetlogdest = RNS.LOG_STDOUT
|
||||||
|
|
||||||
reticulum = RNS.Reticulum(configdir=configdir, verbosity=targetverbosity, logdest=targetlogdest)
|
RNS.Reticulum(configdir=configdir, verbosity=targetverbosity, logdest=targetlogdest)
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
try:
|
try:
|
||||||
parser = argparse.ArgumentParser(description="Reticulum Distributed Identity Resolver")
|
parser = argparse.ArgumentParser(description="Reticulum Distributed Identity Resolver")
|
||||||
@ -49,24 +49,23 @@ def main():
|
|||||||
parser.add_argument('-q', '--quiet', action='count', default=0)
|
parser.add_argument('-q', '--quiet', action='count', default=0)
|
||||||
parser.add_argument("--exampleconfig", action='store_true', default=False, help="print verbose configuration example to stdout and exit")
|
parser.add_argument("--exampleconfig", action='store_true', default=False, help="print verbose configuration example to stdout and exit")
|
||||||
parser.add_argument("--version", action="version", version="ir {version}".format(version=__version__))
|
parser.add_argument("--version", action="version", version="ir {version}".format(version=__version__))
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if args.exampleconfig:
|
if args.exampleconfig:
|
||||||
print(__example_rns_config__)
|
print(__example_rns_config__)
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
|
configarg = None
|
||||||
if args.config:
|
if args.config:
|
||||||
configarg = args.config
|
configarg = args.config
|
||||||
else:
|
|
||||||
configarg = None
|
|
||||||
|
|
||||||
program_setup(configdir = configarg, verbosity=args.verbose, quietness=args.quiet)
|
program_setup(configdir=configarg, verbosity=args.verbose, quietness=args.quiet)
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("")
|
print("")
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
|
|
||||||
__example_rns_config__ = '''# This is an example Identity Resolver file.
|
__example_rns_config__ = '''# This is an example Identity Resolver file.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user