Fix etiquette_repl vlogging.
This commit is contained in:
parent
93da1f32c7
commit
042fe4dd2f
1 changed files with 2 additions and 12 deletions
|
@ -1,9 +1,3 @@
|
||||||
import logging
|
|
||||||
handler = logging.StreamHandler()
|
|
||||||
log_format = '{levelname}:etiquette.{module}.{funcName}: {message}'
|
|
||||||
handler.setFormatter(logging.Formatter(log_format, style='{'))
|
|
||||||
logging.getLogger().addHandler(handler)
|
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import code
|
import code
|
||||||
import sys
|
import sys
|
||||||
|
@ -16,8 +10,6 @@ from voussoirkit import vlogging
|
||||||
|
|
||||||
import etiquette
|
import etiquette
|
||||||
|
|
||||||
LOG_LEVEL = vlogging.NOTSET
|
|
||||||
|
|
||||||
def easytagger():
|
def easytagger():
|
||||||
while True:
|
while True:
|
||||||
i = input('> ')
|
i = input('> ')
|
||||||
|
@ -42,7 +34,7 @@ def erepl_argparse(args):
|
||||||
global P
|
global P
|
||||||
|
|
||||||
try:
|
try:
|
||||||
P = etiquette.photodb.PhotoDB.closest_photodb(pathclass.cwd(), log_level=LOG_LEVEL)
|
P = etiquette.photodb.PhotoDB.closest_photodb(pathclass.cwd())
|
||||||
except etiquette.exceptions.NoClosestPhotoDB as exc:
|
except etiquette.exceptions.NoClosestPhotoDB as exc:
|
||||||
pipeable.stderr(exc.error_message)
|
pipeable.stderr(exc.error_message)
|
||||||
pipeable.stderr('Try `etiquette_cli.py init` to create the database.')
|
pipeable.stderr('Try `etiquette_cli.py init` to create the database.')
|
||||||
|
@ -63,10 +55,8 @@ def erepl_argparse(args):
|
||||||
if interactive.getpermission():
|
if interactive.getpermission():
|
||||||
break
|
break
|
||||||
|
|
||||||
|
@vlogging.main_decorator
|
||||||
def main(argv):
|
def main(argv):
|
||||||
global LOG_LEVEL
|
|
||||||
(LOG_LEVEL, argv) = vlogging.get_level_by_argv(argv)
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
|
||||||
parser.add_argument('--exec', dest='exec_statement', default=None)
|
parser.add_argument('--exec', dest='exec_statement', default=None)
|
||||||
|
|
Loading…
Reference in a new issue