mirror of
https://github.com/derrod/legendary.git
synced 2025-07-04 15:38:14 +00:00
[utils] Set config modified state and mod time on write
This commit is contained in:
parent
a4cbf5892a
commit
454e2a2a69
|
@ -1,5 +1,6 @@
|
||||||
import configparser
|
import configparser
|
||||||
import os
|
import os
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
class LGDConf(configparser.ConfigParser):
|
class LGDConf(configparser.ConfigParser):
|
||||||
|
@ -16,6 +17,11 @@ class LGDConf(configparser.ConfigParser):
|
||||||
|
|
||||||
return super().read(filename)
|
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):
|
def set(self, *args, **kwargs):
|
||||||
if self.read_only:
|
if self.read_only:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue