From f627d48163a05801868915e69d630a2961178374 Mon Sep 17 00:00:00 2001 From: Jon Bernard Date: Tue, 5 Jan 2016 09:49:50 -0500 Subject: Rename sync/unsync to link/unlink I think this naming is more appropriate and intuitive --- dotfiles.py | 14 +++++++------- test_dotfiles.py | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dotfiles.py b/dotfiles.py index af35d13..caf5108 100644 --- a/dotfiles.py +++ b/dotfiles.py @@ -76,7 +76,7 @@ class Dotfile(object): if self.target.check(exists=1): raise OSError(errno.EEXIST, self.target) self.name.move(self.target) - self.sync() + self.link() def remove(self): if self.target.check(exists=0): @@ -84,10 +84,10 @@ class Dotfile(object): self.name.remove() self.target.move(self.name) - def sync(self): + def link(self): self.name.mksymlinkto(self.target) - def unsync(self): + def unlink(self): self.name.remove() @@ -164,16 +164,16 @@ def status(repo, all, color): @cli.command() @click.argument('files', nargs=-1, type=click.Path()) @pass_repo -def sync(repo, files): +def link(repo, files): """Create any missing symlinks.""" for filename in files: - click.echo('Dotfile(%s).sync()' % filename) + click.echo('Dotfile(%s).link()' % filename) @cli.command() @click.argument('files', nargs=-1, type=click.Path(exists=True)) @pass_repo -def unsync(repo, files): +def unlink(repo, files): """Remove existing symlinks.""" for filename in files: - click.echo('Dotfile(%s).unsync()' % filename) + click.echo('Dotfile(%s).unlink()' % filename) diff --git a/test_dotfiles.py b/test_dotfiles.py index e5bdda2..1bb9a07 100644 --- a/test_dotfiles.py +++ b/test_dotfiles.py @@ -102,11 +102,11 @@ class TestDotfile(object): assert name.check(file=1, link=0) @pytest.mark.parametrize('times', range(1, 4)) - def test_sync(self, repo, home, times): + def test_link(self, repo, home, times): name = home.join('.vimrc') target = repo.ensure('vimrc') - Dotfile(name, target).sync() + Dotfile(name, target).link() assert target.check(file=1, link=0) assert name.check(file=1, link=1) @@ -114,11 +114,11 @@ class TestDotfile(object): for x in range(2, times): with pytest.raises(py.error.EEXIST): - Dotfile(name, target).sync() + Dotfile(name, target).link() assert target.check(file=1, link=0) assert name.check(file=1, link=1) assert name.samefile(target) @pytest.mark.xfail(reason='not implemented yet') - def test_unsync(self): + def test_unlink(self): assert False -- cgit v1.2.3