diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2017-01-28 03:22:36 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2017-01-28 03:22:36 +0300 |
commit | 31422dd2fcc657757beb37a386f9f2da5c5a8568 (patch) | |
tree | 7f5db796921e97301e5f68d9d71d2340fab00988 | |
parent | refactoring (diff) | |
download | vk-scripts-31422dd2fcc657757beb37a386f9f2da5c5a8568.tar.gz vk-scripts-31422dd2fcc657757beb37a386f9f2da5c5a8568.zip |
bin.utils.output -> bin.utils.io
-rw-r--r-- | bin/mutual_friends.py | 8 | ||||
-rw-r--r-- | bin/online_sessions.py | 10 | ||||
-rw-r--r-- | bin/utils/io.py (renamed from bin/utils/output.py) | 0 |
3 files changed, 9 insertions, 9 deletions
diff --git a/bin/mutual_friends.py b/bin/mutual_friends.py index 1d231b0..f67f987 100644 --- a/bin/mutual_friends.py +++ b/bin/mutual_friends.py @@ -12,7 +12,7 @@ import sys from vk.api import API, Language from vk.user import UserField -from .utils import output +from .utils import io _OUTPUT_USER_FIELDS = UserField.UID, UserField.FIRST_NAME, UserField.LAST_NAME @@ -32,7 +32,7 @@ class OutputSinkMutualFriends(metaclass=abc.ABCMeta): class OutputSinkCSV(OutputSinkMutualFriends): def __init__(self, fd=sys.stdout): - self._writer = output.FileWriterCSV(fd) + self._writer = io.FileWriterCSV(fd) def write_mutual_friends(self, friend_list): for user in friend_list: @@ -40,7 +40,7 @@ class OutputSinkCSV(OutputSinkMutualFriends): class OutputSinkJSON(OutputSinkMutualFriends): def __init__(self, fd=sys.stdout): - self._writer = output.FileWriterJSON(fd) + self._writer = io.FileWriterJSON(fd) def write_mutual_friends(self, friend_list): self._writer.write(friend_list) @@ -54,7 +54,7 @@ class OutputFormat(Enum): @staticmethod def open_file(path=None): - return output.open_output_text_file(path) + return io.open_output_text_file(path) def create_sink(self, fd=sys.stdout): if self is OutputFormat.CSV: diff --git a/bin/online_sessions.py b/bin/online_sessions.py index f5707c0..c291fc5 100644 --- a/bin/online_sessions.py +++ b/bin/online_sessions.py @@ -15,7 +15,7 @@ from vk.tracking.db import Format as DatabaseFormat from vk.user import UserField from .utils.bar_chart import BarChartBuilder -from .utils import output +from .utils import io class GroupBy(Enum): USER = 'user' @@ -70,7 +70,7 @@ class OutputConverterCSV: class OutputSinkCSV(OutputSinkOnlineSessions): def __init__(self, fd=sys.stdout): - self._writer = output.FileWriterCSV(fd) + self._writer = io.FileWriterCSV(fd) _CONVERT_KEY = { GroupBy.USER: OutputConverterCSV.convert_user, @@ -127,7 +127,7 @@ class OutputConverterJSON: class OutputSinkJSON(OutputSinkOnlineSessions): def __init__(self, fd=sys.stdout): - self._writer = output.FileWriterJSON(fd) + self._writer = io.FileWriterJSON(fd) _DURATION_FIELD = 'duration' @@ -257,9 +257,9 @@ class OutputFormat(Enum): def open_file(self, path=None): if self is OutputFormat.PLOT: - return output.open_output_binary_file(path) + return io.open_output_binary_file(path) else: - return output.open_output_text_file(path) + return io.open_output_text_file(path) def _parse_group_by(s): try: diff --git a/bin/utils/output.py b/bin/utils/io.py index 70c1a3a..70c1a3a 100644 --- a/bin/utils/output.py +++ b/bin/utils/io.py |