mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-06 10:48:00 +00:00
Add option to symlink only child files
This commit is contained in:
@@ -5,12 +5,14 @@ Copyright (c) 2017, deadc0de6
|
||||
represents a dotfile in dotdrop
|
||||
"""
|
||||
|
||||
from dotdrop.linktypes import LinkTypes
|
||||
|
||||
|
||||
class Dotfile:
|
||||
|
||||
def __init__(self, key, dst, src,
|
||||
actions={}, trans_r=None, trans_w=None,
|
||||
link=False, cmpignore=[], noempty=False):
|
||||
link=LinkTypes.NOLINK, cmpignore=[], noempty=False):
|
||||
# key of dotfile in the config
|
||||
self.key = key
|
||||
# path where to install this dotfile
|
||||
@@ -32,10 +34,11 @@ class Dotfile:
|
||||
|
||||
def __str__(self):
|
||||
msg = 'key:\"{}\", src:\"{}\", dst:\"{}\", link:\"{}\"'
|
||||
return msg.format(self.key, self.src, self.dst, self.link)
|
||||
return msg.format(self.key, self.src, self.dst, self.link.name)
|
||||
|
||||
def __eq__(self, other):
|
||||
return self.__dict__ == other.__dict__
|
||||
|
||||
def __hash__(self):
|
||||
return hash(self.dst) ^ hash(self.src) ^ hash(self.key)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user