kompress.kopen improvements

- tests
- uniform handling for bytes/str, always return utf8 str by default
This commit is contained in:
Dima Gerasimov 2020-05-04 08:37:36 +01:00
parent c3a77b6256
commit 8b8a85e8c3
7 changed files with 52 additions and 24 deletions

View file

@ -18,7 +18,7 @@ import icalendar # type: ignore
from icalendar.cal import Todo # type: ignore
logger = LazyLogger('my.rtm')
logger = LazyLogger(__name__)
# TODO extract in a module to parse RTM's ical?
@ -98,8 +98,8 @@ class DAL:
def dal():
last = get_files(config.export_path, glob='*.ical.xz')[-1]
with kopen(last, 'rb') as fo:
last = get_files(config.export_path)[-1]
with kopen(last) as fo:
data = fo.read()
return DAL(data=data, revision='TODO')