docstring format
This commit is contained in:
parent
83d4705bca
commit
a851d8dd74
|
@ -12,25 +12,21 @@ class MMConfig(object):
|
||||||
self.cfg = ConfigObj(path)
|
self.cfg = ConfigObj(path)
|
||||||
|
|
||||||
def __getitem__(self, key):
|
def __getitem__(self, key):
|
||||||
"""
|
""" We always return a copy of the config item to prevent
|
||||||
We always return a copy of the config item to prevent callers from
|
callers from doing any modifications through the returned
|
||||||
doing any modifications through the returned objects methods
|
objects methods """
|
||||||
"""
|
|
||||||
return copy.deepcopy(self.cfg[key])
|
return copy.deepcopy(self.cfg[key])
|
||||||
|
|
||||||
def __setitem__(self, key, value):
|
def __setitem__(self, key, value):
|
||||||
"""
|
""" We use this method not to allow anybody to mess around with
|
||||||
We use this method not to allow anybody to mess around with config file
|
config file any settings made should be done through MMConfig's
|
||||||
any settings made should be done through MMConfig's instance methods
|
instance methods """
|
||||||
"""
|
|
||||||
raise ConfigAccessViolation(key)
|
raise ConfigAccessViolation(key)
|
||||||
|
|
||||||
def save(self): self.cfg.write()
|
def save(self): self.cfg.write()
|
||||||
|
|
||||||
def last_ran(self):
|
def last_ran(self):
|
||||||
"""
|
""" Returns the last time media monitor was ran by looking at
|
||||||
Returns the last time media monitor was ran by looking at the time when
|
the time when the file at 'index_path' was modified """
|
||||||
the file at 'index_path' was modified
|
|
||||||
"""
|
|
||||||
return mmp.last_modified(self.cfg['index_path'])
|
return mmp.last_modified(self.cfg['index_path'])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue