aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/vk/utils/tracking/db/format.py
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-06-18 23:56:48 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-06-18 23:56:48 +0300
commit48b19f2c9fec8a7e2f26ddd058c794d4f5a33894 (patch)
tree23f397fdad7a38ea2f7d3890593fddedd0572867 /vk/utils/tracking/db/format.py
parentREADME update (diff)
downloadvk-scripts-48b19f2c9fec8a7e2f26ddd058c794d4f5a33894.tar.gz
vk-scripts-48b19f2c9fec8a7e2f26ddd058c794d4f5a33894.zip
vk.utils.tracking -> vk.tracking
Diffstat (limited to 'vk/utils/tracking/db/format.py')
-rw-r--r--vk/utils/tracking/db/format.py35
1 files changed, 0 insertions, 35 deletions
diff --git a/vk/utils/tracking/db/format.py b/vk/utils/tracking/db/format.py
deleted file mode 100644
index 4856094..0000000
--- a/vk/utils/tracking/db/format.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2016 Egor Tensin <Egor.Tensin@gmail.com>
-# This file is licensed under the terms of the MIT License.
-# See LICENSE.txt for details.
-
-from enum import Enum
-
-from .backend import *
-
-class Format(Enum):
- CSV = 'csv'
- LOG = 'log'
- NULL = 'null'
-
- def create_writer(self, fd):
- if self is Format.CSV:
- return csv.Writer(fd)
- elif self is Format.LOG:
- return log.Writer(fd)
- elif self is Format.NULL:
- return 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)
- elif self is Format.LOG:
- raise NotImplementedError()
- elif self is Format.NULL:
- return null.Reader(fd)
- else:
- raise NotImplementedError('unsupported database format: ' + str(self))
-
- def __str__(self):
- return self.value