Compare commits

...

2 Commits

Author SHA1 Message Date
b5c898035a fixed cfg.get syntax 2024-03-30 00:57:14 +01:00
2c06ecca77 output commentstring as well 2024-03-30 00:56:58 +01:00
2 changed files with 3 additions and 3 deletions

View File

@ -71,8 +71,8 @@ class Userconfig:
return False
# assemble file to tmp
commentstring = ""
if dir_config.check("Main", "commentstring"):
commentstring = dir_config.get("Main", "commentstring")
if dir_config.check(section="Main", option="commentstring"):
commentstring = dir_config.get(section="Main", option="commentstring")
self._cfg.debug.stdout(" +++ Found commentstring %s in %s" % (commentstring, df), 3)
tempfilename = self.build_file(destfiles[df], df, commentstring)

View File

@ -59,7 +59,7 @@ def read_skip_comment(fp, commentstring):
def diff(destfile, tempfile, commentstring, cfg):
"""diff destfile and tempfile, returns True if files differ, False if they are the same"""
cfg.debug.stdout("Diffing %s and %s" % (destfile, tempfile), 3)
cfg.debug.stdout("Diffing %s and %s, comment: %s" % (destfile, tempfile, commentstring), 3)
if not os.path.isfile(destfile):
cfg.debug.stdout("Destfile %s does not exist, returning True." % destfile, 3)
# destfile does not exist -> copy tempfile over