fixes with logging
This commit is contained in:
parent
e99b0eca50
commit
efb60782e9
1
data/.cache.csv
Normal file
1
data/.cache.csv
Normal file
@ -0,0 +1 @@
|
|||||||
|
zurich,47.3666667,8.5500002
|
|
@ -29,6 +29,7 @@ python-dateutil==2.8.1
|
|||||||
python-Levenshtein==0.12.0
|
python-Levenshtein==0.12.0
|
||||||
pytz==2019.3
|
pytz==2019.3
|
||||||
regex==2020.1.8
|
regex==2020.1.8
|
||||||
|
scalpl==0.3.0
|
||||||
six==1.14.0
|
six==1.14.0
|
||||||
timezonefinder==4.2.0
|
timezonefinder==4.2.0
|
||||||
traitlets==4.3.3
|
traitlets==4.3.3
|
||||||
|
4
src/tww/common.py
Normal file
4
src/tww/common.py
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import logging
|
||||||
|
|
||||||
|
logging.basicConfig()
|
||||||
|
logger = logging.getLogger()
|
@ -21,5 +21,5 @@
|
|||||||
var radius = canvas.height / 2;
|
var radius = canvas.height / 2;
|
||||||
ctx.translate(radius, radius);
|
ctx.translate(radius, radius);
|
||||||
radius = radius * 0.90;
|
radius = radius * 0.90;
|
||||||
drawClock(ctx, radius, "{{dst_dt.iso8601_time}}");
|
drawClock(ctx, radius, "{{dt.iso8601_time}}");
|
||||||
</script>
|
</script>
|
@ -1,7 +1,6 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
import locale
|
import locale
|
||||||
import logging
|
|
||||||
import re
|
import re
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
@ -12,6 +11,7 @@ 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 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 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
|
dt_tz_translation, get_local_now, query_to_format_result
|
||||||
|
from common import logger
|
||||||
|
|
||||||
custom_locale = resolve_locale()
|
custom_locale = resolve_locale()
|
||||||
|
|
||||||
@ -314,10 +314,6 @@ def parse_args():
|
|||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
||||||
logging.basicConfig()
|
|
||||||
logger = logging.getLogger()
|
|
||||||
|
|
||||||
|
|
||||||
def setup_logging_level(debug=False):
|
def setup_logging_level(debug=False):
|
||||||
log_level = logging.DEBUG if debug else logging.ERROR
|
log_level = logging.DEBUG if debug else logging.ERROR
|
||||||
logger.setLevel(log_level)
|
logger.setLevel(log_level)
|
||||||
|
@ -29,6 +29,8 @@ from pytz.exceptions import UnknownTimeZoneError
|
|||||||
from timezonefinder import TimezoneFinder
|
from timezonefinder import TimezoneFinder
|
||||||
from word2number import w2n
|
from word2number import w2n
|
||||||
|
|
||||||
|
from common import logger
|
||||||
|
|
||||||
FUZZ_THRESHOLD = 70
|
FUZZ_THRESHOLD = 70
|
||||||
ISO_FORMAT = '%Y-%m-%dT%H:%M:%S%z'
|
ISO_FORMAT = '%Y-%m-%dT%H:%M:%S%z'
|
||||||
DEFAULT_FORMAT = '%Y-%m-%d %H:%M:%S%z'
|
DEFAULT_FORMAT = '%Y-%m-%d %H:%M:%S%z'
|
||||||
|
Loading…
Reference in New Issue
Block a user