Clean up code
Fix typos and remove unused code.
This commit is contained in:
parent
2865477dca
commit
c638e25941
4 changed files with 5 additions and 8 deletions
|
@ -3,9 +3,6 @@ from .executor import Executor
|
||||||
from .messenger import Messenger
|
from .messenger import Messenger
|
||||||
|
|
||||||
class Dispatcher(object):
|
class Dispatcher(object):
|
||||||
PLUGIN_CLASS = Executor
|
|
||||||
PLUGIN_DIR = 'dotbot/executor'
|
|
||||||
|
|
||||||
def __init__(self, base_directory):
|
def __init__(self, base_directory):
|
||||||
self._log = Messenger()
|
self._log = Messenger()
|
||||||
self._set_base_directory(base_directory)
|
self._set_base_directory(base_directory)
|
||||||
|
@ -17,7 +14,7 @@ class Dispatcher(object):
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
self._base_directory = path
|
self._base_directory = path
|
||||||
else:
|
else:
|
||||||
raise DispatchError('Nonexistant base directory')
|
raise DispatchError('Nonexistent base directory')
|
||||||
|
|
||||||
def dispatch(self, tasks):
|
def dispatch(self, tasks):
|
||||||
success = True
|
success = True
|
||||||
|
|
|
@ -23,7 +23,7 @@ class Cleaner(Executor):
|
||||||
if success:
|
if success:
|
||||||
self._log.info('All targets have been cleaned')
|
self._log.info('All targets have been cleaned')
|
||||||
else:
|
else:
|
||||||
self._log.error('Some targets were not succesfully cleaned')
|
self._log.error('Some targets were not successfully cleaned')
|
||||||
return success
|
return success
|
||||||
|
|
||||||
def _clean(self, target):
|
def _clean(self, target):
|
||||||
|
|
|
@ -30,5 +30,5 @@ class CommandRunner(Executor):
|
||||||
if success:
|
if success:
|
||||||
self._log.info('All commands have been executed')
|
self._log.info('All commands have been executed')
|
||||||
else:
|
else:
|
||||||
self._log.error('Some commands were not sucessfully executed')
|
self._log.error('Some commands were not successfully executed')
|
||||||
return success
|
return success
|
||||||
|
|
|
@ -118,10 +118,10 @@ class Linker(Executor):
|
||||||
(link_name, self._link_destination(link_name)))
|
(link_name, self._link_destination(link_name)))
|
||||||
elif not self._exists(source):
|
elif not self._exists(source):
|
||||||
if self._is_link(link_name):
|
if self._is_link(link_name):
|
||||||
self._log.warning('Nonexistant target %s -> %s' %
|
self._log.warning('Nonexistent target %s -> %s' %
|
||||||
(link_name, source))
|
(link_name, source))
|
||||||
else:
|
else:
|
||||||
self._log.warning('Nonexistant target for %s : %s' %
|
self._log.warning('Nonexistent target for %s : %s' %
|
||||||
(link_name, source))
|
(link_name, source))
|
||||||
else:
|
else:
|
||||||
self._log.lowinfo('Link exists %s -> %s' % (link_name, source))
|
self._log.lowinfo('Link exists %s -> %s' % (link_name, source))
|
||||||
|
|
Loading…
Reference in a new issue