diff options
-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): |