aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/bin/track_status.py
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-01-28 02:40:27 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-01-28 02:40:27 +0300
commit1c0e2c13d4f0acbe42e43d886df4f1067506efed (patch)
tree8d76116d718293275315605b66f1466af7d09c27 /bin/track_status.py
parentbin: move file i/o to a separate module (diff)
downloadvk-scripts-1c0e2c13d4f0acbe42e43d886df4f1067506efed.tar.gz
vk-scripts-1c0e2c13d4f0acbe42e43d886df4f1067506efed.zip
vk: move file i/o to a separate module
Diffstat (limited to 'bin/track_status.py')
-rw-r--r--bin/track_status.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/track_status.py b/bin/track_status.py
index 404c1ec..4c679c5 100644
--- a/bin/track_status.py
+++ b/bin/track_status.py
@@ -63,10 +63,13 @@ def track_status(
if db_fmt is DatabaseFormat.LOG or db_path is None:
db_fmt = DatabaseFormat.NULL
- with DatabaseFormat.LOG.create_writer(log_path) as log_writer:
+ with DatabaseFormat.LOG.open_output_file(log_path) as log_fd:
+ log_writer = DatabaseFormat.LOG.create_writer(log_fd)
tracker.add_database_writer(log_writer)
- with db_fmt.create_writer(db_path) as db_writer:
+ with db_fmt.open_output_file(db_path) as db_fd:
+ db_writer = db_fmt.create_writer(db_fd)
tracker.add_database_writer(db_writer)
+
tracker.loop(uids)
def main(args=None):