From f4075b7bb57e23d5d779c93cd299ec1721cc51b6 Mon Sep 17 00:00:00 2001 From: Daniel Tsvetkov Date: Tue, 17 Mar 2020 19:00:09 +0100 Subject: [PATCH] change relative --- src/main.py | 6 ++++++ src/tww/localization.py | 2 +- src/tww/tokenizer.py | 15 +++++---------- src/tww/tww.py | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) create mode 100644 src/main.py diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000..faf41c4 --- /dev/null +++ b/src/main.py @@ -0,0 +1,6 @@ +from tww.tokenizer import parse_args, setup_logging_level, main + +if __name__ == "__main__": + args = parse_args() + setup_logging_level(args.debug) + main(args) \ No newline at end of file diff --git a/src/tww/localization.py b/src/tww/localization.py index 155d7c8..12c0563 100644 --- a/src/tww/localization.py +++ b/src/tww/localization.py @@ -5,7 +5,7 @@ import os from fuzzywuzzy import fuzz -from tww import basepath +from tww.tww import basepath @contextlib.contextmanager diff --git a/src/tww/tokenizer.py b/src/tww/tokenizer.py index 12768a6..f690c4e 100644 --- a/src/tww/tokenizer.py +++ b/src/tww/tokenizer.py @@ -2,16 +2,17 @@ import argparse import json import locale import re +import logging from datetime import datetime from pygments import highlight, lexers, formatters from scalpl import Cut -from localization import setlocale, resolve_locale -from tww import ISO_FORMAT, time_to_emoji, time_ago, workday_diff, workhours_diff, td_remainders, td_totals, td_iso8601 -from tww import resolve_timezone, dateparser_parse_dt, get_utcnow, get_s_since_epoch, get_ms_since_epoch, \ +from tww.localization import setlocale, resolve_locale +from tww.tww import ISO_FORMAT, time_to_emoji, time_ago, workday_diff, workhours_diff, td_remainders, td_totals, td_iso8601 +from tww.tww import resolve_timezone, dateparser_parse_dt, get_utcnow, get_s_since_epoch, get_ms_since_epoch, \ dt_tz_translation, get_local_now, query_to_format_result -from common import logger +from tww.common import logger custom_locale = resolve_locale() @@ -329,9 +330,3 @@ def main(args): if args.full: pretty_print_dict(result) show_magic_results(result, args) - - -if __name__ == "__main__": - args = parse_args() - setup_logging_level(args.debug) - main(args) diff --git a/src/tww/tww.py b/src/tww/tww.py index d9707c1..1bd690b 100644 --- a/src/tww/tww.py +++ b/src/tww/tww.py @@ -29,7 +29,7 @@ from pytz.exceptions import UnknownTimeZoneError from timezonefinder import TimezoneFinder from word2number import w2n -from common import logger +from tww.common import logger FUZZ_THRESHOLD = 70 ISO_FORMAT = '%Y-%m-%dT%H:%M:%S%z'