From 42c40306d23b1161f5fed12b5bdd730eb57f27d8 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Sat, 25 Mar 2017 20:19:08 -0700 Subject: [PATCH] Rename nlx exception to dvc --- dvc/cmd_data_import.py | 6 +++--- dvc/cmd_data_remove.py | 8 ++++---- dvc/cmd_data_sync.py | 6 +++--- dvc/cmd_init.py | 6 +++--- dvc/cmd_repro.py | 6 +++--- dvc/cmd_run.py | 6 +++--- dvc/config.py | 6 +++--- dvc/exceptions.py | 2 +- dvc/git_wrapper.py | 6 +++--- dvc/path/data_path.py | 12 ++++++------ dvc/repository_change.py | 6 +++--- dvc/state_file.py | 6 +++--- dvc/utils.py | 4 ++-- 13 files changed, 40 insertions(+), 40 deletions(-) diff --git a/dvc/cmd_data_import.py b/dvc/cmd_data_import.py index 470efd839..83f8b9ab2 100644 --- a/dvc/cmd_data_import.py +++ b/dvc/cmd_data_import.py @@ -7,14 +7,14 @@ import requests from dvc.cmd_base import CmdBase from dvc.cmd_data_sync import sizeof_fmt from dvc.logger import Logger -from dvc.exceptions import NeatLynxException +from dvc.exceptions import DvcException from dvc.state_file import StateFile from dvc.utils import run -class DataImportError(NeatLynxException): +class DataImportError(DvcException): def __init__(self, msg): - NeatLynxException.__init__(self, 'Import error: {}'.format(msg)) + DvcException.__init__(self, 'Import error: {}'.format(msg)) class CmdDataImport(CmdBase): diff --git a/dvc/cmd_data_remove.py b/dvc/cmd_data_remove.py index 1f8dc9639..e91c11b79 100644 --- a/dvc/cmd_data_remove.py +++ b/dvc/cmd_data_remove.py @@ -4,14 +4,14 @@ import fasteners from boto.s3.connection import S3Connection from dvc.cmd_base import CmdBase -from dvc.exceptions import NeatLynxException +from dvc.exceptions import DvcException from dvc.logger import Logger from dvc.utils import run -class DataRemoveError(NeatLynxException): +class DataRemoveError(DvcException): def __init__(self, msg): - NeatLynxException.__init__(self, 'Data remove error: {}'.format(msg)) + DvcException.__init__(self, 'Data remove error: {}'.format(msg)) class CmdDataRemove(CmdBase): @@ -63,7 +63,7 @@ class CmdDataRemove(CmdBase): else: self.remove_data_instance(target) return True - except NeatLynxException as ex: + except DvcException as ex: Logger.error('Unable to remove data file "{}": {}'.format(target, ex)) return False diff --git a/dvc/cmd_data_sync.py b/dvc/cmd_data_sync.py index 2a14b08f9..b3ae26914 100644 --- a/dvc/cmd_data_sync.py +++ b/dvc/cmd_data_sync.py @@ -5,13 +5,13 @@ from boto.s3.connection import S3Connection from dvc.cmd_base import CmdBase from dvc.logger import Logger -from dvc.exceptions import NeatLynxException +from dvc.exceptions import DvcException from dvc.utils import run -class DataSyncError(NeatLynxException): +class DataSyncError(DvcException): def __init__(self, msg): - NeatLynxException.__init__(self, 'Data sync error: {}'.format(msg)) + DvcException.__init__(self, 'Data sync error: {}'.format(msg)) def sizeof_fmt(num, suffix='B'): diff --git a/dvc/cmd_init.py b/dvc/cmd_init.py index 694c860b4..b06f48648 100644 --- a/dvc/cmd_init.py +++ b/dvc/cmd_init.py @@ -4,13 +4,13 @@ from pathlib import Path from dvc.cmd_base import CmdBase from dvc.logger import Logger from dvc.config import Config -from dvc.exceptions import NeatLynxException +from dvc.exceptions import DvcException from dvc.utils import run -class InitError(NeatLynxException): +class InitError(DvcException): def __init__(self, msg): - NeatLynxException.__init__(self, 'Init error: {}'.format(msg)) + DvcException.__init__(self, 'Init error: {}'.format(msg)) class CmdInit(CmdBase): diff --git a/dvc/cmd_repro.py b/dvc/cmd_repro.py index 3b6b4cc1e..118584b3b 100644 --- a/dvc/cmd_repro.py +++ b/dvc/cmd_repro.py @@ -5,15 +5,15 @@ import fasteners from dvc.cmd_base import CmdBase from dvc.cmd_run import CmdRun from dvc.logger import Logger -from dvc.exceptions import NeatLynxException +from dvc.exceptions import DvcException from dvc.path.data_path import NotInDataDirError from dvc.state_file import StateFile from dvc.utils import run -class ReproError(NeatLynxException): +class ReproError(DvcException): def __init__(self, msg): - NeatLynxException.__init__(self, 'Run error: {}'.format(msg)) + DvcException.__init__(self, 'Run error: {}'.format(msg)) class CmdRepro(CmdRun): diff --git a/dvc/cmd_run.py b/dvc/cmd_run.py index 6d3a0ee30..283036022 100644 --- a/dvc/cmd_run.py +++ b/dvc/cmd_run.py @@ -6,15 +6,15 @@ from dvc.path.data_path import NotInDataDirError from dvc.git_wrapper import GitWrapper from dvc.cmd_base import CmdBase from dvc.logger import Logger -from dvc.exceptions import NeatLynxException +from dvc.exceptions import DvcException from dvc.repository_change import RepositoryChange from dvc.state_file import StateFile from dvc.utils import run -class RunError(NeatLynxException): +class RunError(DvcException): def __init__(self, msg): - NeatLynxException.__init__(self, 'Run error: {}'.format(msg)) + DvcException.__init__(self, 'Run error: {}'.format(msg)) class CmdRun(CmdBase): diff --git a/dvc/config.py b/dvc/config.py index a0ac5e78e..397a6fa17 100644 --- a/dvc/config.py +++ b/dvc/config.py @@ -1,12 +1,12 @@ import os import configparser -from dvc.exceptions import NeatLynxException +from dvc.exceptions import DvcException -class ConfigError(NeatLynxException): +class ConfigError(DvcException): def __init__(self, msg): - NeatLynxException.__init__(self, 'Config file error: {}'.format(msg)) + DvcException.__init__(self, 'Config file error: {}'.format(msg)) class ConfigI(object): diff --git a/dvc/exceptions.py b/dvc/exceptions.py index b9ab1a9ed..11613c188 100644 --- a/dvc/exceptions.py +++ b/dvc/exceptions.py @@ -1,3 +1,3 @@ -class NeatLynxException(Exception): +class DvcException(Exception): def __init__(self, msg): Exception.__init__(self, msg) diff --git a/dvc/git_wrapper.py b/dvc/git_wrapper.py index 89c182b04..df95e5784 100644 --- a/dvc/git_wrapper.py +++ b/dvc/git_wrapper.py @@ -3,14 +3,14 @@ import sys import subprocess from dvc.path.dvc_path import DvcPath -from dvc.exceptions import NeatLynxException +from dvc.exceptions import DvcException from dvc.logger import Logger from dvc.config import Config -class GitCmdError(NeatLynxException): +class GitCmdError(DvcException): def __init__(self, msg): - NeatLynxException.__init__(self, msg) + DvcException.__init__(self, msg) class GitWrapperI(object): diff --git a/dvc/path/data_path.py b/dvc/path/data_path.py index d79db4030..088257eed 100644 --- a/dvc/path/data_path.py +++ b/dvc/path/data_path.py @@ -1,20 +1,20 @@ import os from dvc.path.dvc_path import DvcPath -from dvc.exceptions import NeatLynxException +from dvc.exceptions import DvcException from dvc.utils import cached_property -class DataFilePathError(NeatLynxException): +class DataFilePathError(DvcException): def __init__(self, msg): - NeatLynxException.__init__(self, 'Data file error: {}'.format(msg)) + DvcException.__init__(self, 'Data file error: {}'.format(msg)) -class NotInDataDirError(NeatLynxException): +class NotInDataDirError(DvcException): def __init__(self, file, data_dir): - NeatLynxException.__init__(self, + DvcException.__init__(self, 'Data file location error: the file "{}" has to be in the data directory "{}"'. - format(file, data_dir)) + format(file, data_dir)) class DataPath(object): diff --git a/dvc/repository_change.py b/dvc/repository_change.py index add7c1edc..b2d74ce56 100644 --- a/dvc/repository_change.py +++ b/dvc/repository_change.py @@ -1,12 +1,12 @@ import os -from dvc.exceptions import NeatLynxException +from dvc.exceptions import DvcException from dvc.git_wrapper import GitWrapper -class RepositoryChangeError(NeatLynxException): +class RepositoryChangeError(DvcException): def __init__(self, msg): - NeatLynxException.__init__(self, 'Repository change error: {}'.format(msg)) + DvcException.__init__(self, 'Repository change error: {}'.format(msg)) class FileModificationState(object): diff --git a/dvc/state_file.py b/dvc/state_file.py index 441586226..f002ce5f6 100644 --- a/dvc/state_file.py +++ b/dvc/state_file.py @@ -3,12 +3,12 @@ import sys import json import time -from dvc.exceptions import NeatLynxException +from dvc.exceptions import DvcException -class StateFileError(NeatLynxException): +class StateFileError(DvcException): def __init__(self, msg): - NeatLynxException.__init__(self, 'State file error: {}'.format(msg)) + DvcException.__init__(self, 'State file error: {}'.format(msg)) class StateFile(object): diff --git a/dvc/utils.py b/dvc/utils.py index dfd92912f..a49ce173f 100644 --- a/dvc/utils.py +++ b/dvc/utils.py @@ -1,4 +1,4 @@ -from dvc.exceptions import NeatLynxException +from dvc.exceptions import DvcException from dvc.logger import Logger @@ -21,6 +21,6 @@ def run(cmd): import sys try: sys.exit(cmd.run()) - except NeatLynxException as e: + except DvcException as e: Logger.error(e) sys.exit(1) \ No newline at end of file