mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-06 15:27:59 +00:00
adding notemplate config options
This commit is contained in:
@@ -16,12 +16,13 @@ class Dotfile(DictParser):
|
||||
key_noempty = 'ignoreempty'
|
||||
key_trans_r = 'trans_read'
|
||||
key_trans_w = 'trans_write'
|
||||
key_notemplate = 'notemplate'
|
||||
|
||||
def __init__(self, key, dst, src,
|
||||
actions=[], trans_r=None, trans_w=None,
|
||||
link=LinkTypes.NOLINK, noempty=False,
|
||||
cmpignore=[], upignore=[],
|
||||
instignore=[]):
|
||||
instignore=[], notemplate=False):
|
||||
"""
|
||||
constructor
|
||||
@key: dotfile key
|
||||
@@ -35,6 +36,7 @@ class Dotfile(DictParser):
|
||||
@upignore: patterns to ignore when updating
|
||||
@cmpignore: patterns to ignore when comparing
|
||||
@instignore: patterns to ignore when installing
|
||||
@notemplate: disable template for this dotfile
|
||||
"""
|
||||
self.actions = actions
|
||||
self.dst = dst
|
||||
@@ -47,6 +49,7 @@ class Dotfile(DictParser):
|
||||
self.upignore = upignore
|
||||
self.cmpignore = cmpignore
|
||||
self.instignore = instignore
|
||||
self.notemplate = notemplate
|
||||
|
||||
if self.link != LinkTypes.NOLINK and \
|
||||
(
|
||||
@@ -91,10 +94,12 @@ class Dotfile(DictParser):
|
||||
value['noempty'] = value.get(cls.key_noempty, False)
|
||||
value['trans_r'] = value.get(cls.key_trans_r)
|
||||
value['trans_w'] = value.get(cls.key_trans_w)
|
||||
value['notemplate'] = value.get(cls.key_notemplate, False)
|
||||
# remove old entries
|
||||
value.pop(cls.key_noempty, None)
|
||||
value.pop(cls.key_trans_r, None)
|
||||
value.pop(cls.key_trans_w, None)
|
||||
value.pop(cls.key_notemplate, None)
|
||||
return value
|
||||
|
||||
def __eq__(self, other):
|
||||
@@ -114,6 +119,7 @@ class Dotfile(DictParser):
|
||||
out += '\n{}src: \"{}\"'.format(indent, self.src)
|
||||
out += '\n{}dst: \"{}\"'.format(indent, self.dst)
|
||||
out += '\n{}link: \"{}\"'.format(indent, str(self.link))
|
||||
out += '\n{}notemplate: \"{}\"'.format(indent, str(self.notemplate))
|
||||
|
||||
out += '\n{}pre-action:'.format(indent)
|
||||
some = self.get_pre_actions()
|
||||
|
||||
Reference in New Issue
Block a user