aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/vk/tracking/db
diff options
context:
space:
mode:
Diffstat (limited to 'vk/tracking/db')
-rw-r--r--vk/tracking/db/backend/__init__.py4
-rw-r--r--vk/tracking/db/backend/log.py2
-rw-r--r--vk/tracking/db/format.py12
3 files changed, 10 insertions, 8 deletions
diff --git a/vk/tracking/db/backend/__init__.py b/vk/tracking/db/backend/__init__.py
index 4b3c278..68de924 100644
--- a/vk/tracking/db/backend/__init__.py
+++ b/vk/tracking/db/backend/__init__.py
@@ -2,4 +2,6 @@
# This file is licensed under the terms of the MIT License.
# See LICENSE.txt for details.
-__all__ = 'csv', 'log', 'null'
+from . import csv, log, null
+
+__all__ = 'csv', 'log', 'null',
diff --git a/vk/tracking/db/backend/log.py b/vk/tracking/db/backend/log.py
index 625257b..03548eb 100644
--- a/vk/tracking/db/backend/log.py
+++ b/vk/tracking/db/backend/log.py
@@ -64,7 +64,7 @@ class Writer:
return '{} was last seen at {} using {}.'.format(
Writer._format_user(user),
user.get_last_seen_time_local(),
- user.get_last_seen_platform().get_description_for_sentence())
+ user.get_last_seen_platform().get_descr_text())
@staticmethod
def _format_user_went_online(user):
diff --git a/vk/tracking/db/format.py b/vk/tracking/db/format.py
index 4856094..862c20e 100644
--- a/vk/tracking/db/format.py
+++ b/vk/tracking/db/format.py
@@ -4,7 +4,7 @@
from enum import Enum
-from .backend import *
+from . import backend
class Format(Enum):
CSV = 'csv'
@@ -13,21 +13,21 @@ class Format(Enum):
def create_writer(self, fd):
if self is Format.CSV:
- return csv.Writer(fd)
+ return backend.csv.Writer(fd)
elif self is Format.LOG:
- return log.Writer(fd)
+ return backend.log.Writer(fd)
elif self is Format.NULL:
- return null.Writer(fd)
+ return backend.null.Writer(fd)
else:
raise NotImplementedError('unsupported database format: ' + str(self))
def create_reader(self, fd):
if self is Format.CSV:
- return csv.Reader(fd)
+ return backend.csv.Reader(fd)
elif self is Format.LOG:
raise NotImplementedError()
elif self is Format.NULL:
- return null.Reader(fd)
+ return backend.null.Reader(fd)
else:
raise NotImplementedError('unsupported database format: ' + str(self))