diff options
author | Jon Bernard <jbernard@jbernard.io> | 2016-10-12 15:45:36 -0400 |
---|---|---|
committer | Jon Bernard <jbernard@jbernard.io> | 2016-10-12 15:45:36 -0400 |
commit | 682c61eff17da66a94d10dcd680280745774e3fd (patch) | |
tree | b6b08ca29b0c0ab989fba7300095e3727e53345b | |
parent | e94accc4c6d00f8b496dcd431b6bf83b61afa00d (diff) | |
download | dotfiles-682c61eff17da66a94d10dcd680280745774e3fd.tar.gz dotfiles-682c61eff17da66a94d10dcd680280745774e3fd.tar.bz2 dotfiles-682c61eff17da66a94d10dcd680280745774e3fd.zip |
Cleanup exception imports
-rw-r--r-- | dotfiles/dotfile.py | 8 | ||||
-rw-r--r-- | tests/test_dotfile.py | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/dotfiles/dotfile.py b/dotfiles/dotfile.py index daa4a54..99541c0 100644 --- a/dotfiles/dotfile.py +++ b/dotfiles/dotfile.py @@ -1,13 +1,12 @@ import py.path from click import echo -from .exceptions import IsSymlink, NotASymlink -from .exceptions import TargetExists, TargetMissing -from .exceptions import Exists +from .exceptions import \ + IsSymlink, NotASymlink, TargetExists, TargetMissing, Exists class Dotfile(object): - """An configuration file managed within a repository. + """A configuration file managed within a repository. :param name: name of the symlink in the home directory (~/.vimrc) :param target: where the symlink should point to (~/Dotfiles/vimrc) @@ -73,6 +72,7 @@ class Dotfile(object): def add(self, debug=False): """Move a dotfile to it's target and create a symlink.""" if self.name.check(link=1): + # XXX: if the name is already a link, we *could* just move it. raise IsSymlink(self.name) if self.target.check(exists=1): raise TargetExists(self.name) diff --git a/tests/test_dotfile.py b/tests/test_dotfile.py index b2dcd28..4d81c6c 100644 --- a/tests/test_dotfile.py +++ b/tests/test_dotfile.py @@ -2,8 +2,8 @@ import pytest import py.path from dotfiles.dotfile import Dotfile -from dotfiles.exceptions import IsSymlink, NotASymlink -from dotfiles.exceptions import TargetExists, TargetMissing, Exists +from dotfiles.exceptions import \ + IsSymlink, NotASymlink, TargetExists, TargetMissing, Exists def _dotfile(repo, name, target=None): |