mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
Rename nlx exception to dvc
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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'):
|
||||
|
||||
+3
-3
@@ -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):
|
||||
|
||||
+3
-3
@@ -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):
|
||||
|
||||
+3
-3
@@ -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):
|
||||
|
||||
+3
-3
@@ -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):
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
class NeatLynxException(Exception):
|
||||
class DvcException(Exception):
|
||||
def __init__(self, msg):
|
||||
Exception.__init__(self, msg)
|
||||
|
||||
+3
-3
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
+3
-3
@@ -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):
|
||||
|
||||
+2
-2
@@ -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)
|
||||
Reference in New Issue
Block a user