From 6898c465080338d6483d0ce9013fe50f4a0fb53b Mon Sep 17 00:00:00 2001 From: Shao-Chun Ma Date: Sat, 16 Feb 2019 16:14:04 +0100 Subject: [PATCH] command: refactor Move the message to parent class. Fixes #1619 --- dvc/command/data_sync.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dvc/command/data_sync.py b/dvc/command/data_sync.py index 8217465a3..a35f0a39f 100644 --- a/dvc/command/data_sync.py +++ b/dvc/command/data_sync.py @@ -7,6 +7,10 @@ from dvc.command.base import CmdBase class CmdDataBase(CmdBase): + def __init__(self, args): + self.UP_TO_DATE_MSG = "Everything is up-to-date." + super().__init__(args) + def do_run(self, target): pass @@ -22,8 +26,6 @@ class CmdDataBase(CmdBase): class CmdDataPull(CmdDataBase): - UP_TO_DATE_MSG = "Everything is up-to-date." - def do_run(self, target=None): try: processed_files_count = self.repo.pull( @@ -46,8 +48,6 @@ class CmdDataPull(CmdDataBase): class CmdDataPush(CmdDataBase): - UP_TO_DATE_MSG = "Everything is up-to-date." - def do_run(self, target=None): try: processed_files_count = self.repo.push( @@ -69,8 +69,6 @@ class CmdDataPush(CmdDataBase): class CmdDataFetch(CmdDataBase): - UP_TO_DATE_MSG = "Everything is up-to-date." - def do_run(self, target=None): try: processed_files_count = self.repo.fetch(