cc-4105: added docstrings, formatted code

This commit is contained in:
Rudi Grinberg 2012-08-15 11:22:44 -04:00
parent 1f422a9609
commit e9114b3468
4 changed files with 11 additions and 7 deletions

View file

@ -8,8 +8,7 @@ import media.monitor.pure as mmp
class MMConfig(object):
def __init__(self, path):
if not os.path.exists(path):
raise NoConfigFile(path)
if not os.path.exists(path): raise NoConfigFile(path)
self.cfg = ConfigObj(path)
def __getitem__(self, key):
@ -29,6 +28,10 @@ class MMConfig(object):
def save(self): self.cfg.write()
def last_ran(self):
"""
Returns the last time media monitor was ran by looking at the time when
the file at 'index_path' was modified
"""
return mmp.last_modified(self.cfg['index_path'])
# Remove this after debugging...