From 454e2a2a692f8cca80ae48760df1a51290acb92f Mon Sep 17 00:00:00 2001 From: derrod Date: Mon, 21 Jun 2021 12:22:08 +0200 Subject: [PATCH] [utils] Set config modified state and mod time on write --- legendary/utils/config.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/legendary/utils/config.py b/legendary/utils/config.py index 6621141..5738a19 100644 --- a/legendary/utils/config.py +++ b/legendary/utils/config.py @@ -1,5 +1,6 @@ import configparser import os +import time class LGDConf(configparser.ConfigParser): @@ -16,6 +17,11 @@ class LGDConf(configparser.ConfigParser): return super().read(filename) + def write(self, *args, **kwargs): + self.modified = False + super().write(*args, **kwargs) + self.modtime = int(time.time()) + def set(self, *args, **kwargs): if self.read_only: return