diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2017-01-28 03:11:23 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2017-01-28 03:11:23 +0300 |
commit | 7112abbe5dd8aebf44c097043f413a0542c05e5c (patch) | |
tree | 468bc272e40f6a960481290e2d16b84d08813f2b /vk/tracking/db/meta.py | |
parent | vk: move file i/o to a separate module (diff) | |
download | vk-scripts-7112abbe5dd8aebf44c097043f413a0542c05e5c.tar.gz vk-scripts-7112abbe5dd8aebf44c097043f413a0542c05e5c.zip |
add abstract classes for db readers/writers
Diffstat (limited to 'vk/tracking/db/meta.py')
-rw-r--r-- | vk/tracking/db/meta.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/vk/tracking/db/meta.py b/vk/tracking/db/meta.py new file mode 100644 index 0000000..024d9d8 --- /dev/null +++ b/vk/tracking/db/meta.py @@ -0,0 +1,25 @@ +# Copyright (c) 2017 Egor Tensin <Egor.Tensin@gmail.com> +# This file is part of the "VK scripts" project. +# For details, see https://github.com/egor-tensin/vk-scripts. +# Distributed under the MIT License. + +import abc +from collections.abc import Iterable + +class Writer(metaclass=abc.ABCMeta): + @abc.abstractmethod + def on_initial_status(self, user): + pass + + @abc.abstractmethod + def on_status_update(self, user): + pass + + @abc.abstractmethod + def on_connection_error(self, e): + pass + +class Reader(Iterable, metaclass=abc.ABCMeta): + @abc.abstractmethod + def __iter__(self): + pass |