diff options
Diffstat (limited to 'dotfiles/dotfile.py')
-rw-r--r-- | dotfiles/dotfile.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/dotfiles/dotfile.py b/dotfiles/dotfile.py index d81e585..64bfabb 100644 --- a/dotfiles/dotfile.py +++ b/dotfiles/dotfile.py @@ -31,6 +31,16 @@ class Dotfile(object): def __repr__(self): return '<Dotfile %r>' % self.name + def __hash__(self): + return hash((self.name, self.target)) + + def __eq__(self, othr): + return ((self.name, self.target) == + (othr.name, othr.target)) + + def __lt__(self, othr): + return self.name < othr.name + def _ensure_dirs(self, debug): """Ensure the directories for both name and target are in place. @@ -145,9 +155,11 @@ class Dotfile(object): if copy: raise NotImplementedError() if self.name.exists(): - raise Exists(self.name) + # nothing to do + return if not self.target.exists(): raise TargetMissing(self.name) + import pdb; pdb.set_trace() self._ensure_dirs(debug) self._link(debug, home) |