/usr/share/pyshared/MailPing/config.py is in mailping 0.0.4ubuntu5+really0.0.4-3ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | import os, errno
from MailPing import fileutil
class NoSuchConfigItem(Exception):
"""Configuration item does not exist."""
class _NoDefault:
pass
def getTime(configdir, name, default=_NoDefault):
t = fileutil.getTime(os.path.join(configdir, name))
if t < 0:
if default is _NoDefault:
raise NoSuchConfigItem, name
else:
t = default
return t
def getEmail(configdir, name, default=_NoDefault):
path = os.path.join(configdir, name)
try:
f=file(path)
except IOError, e:
if e.errno == errno.ENOENT:
if default is _NoDefault:
raise NoSuchConfigItem, name
else:
return default
else:
raise
l=f.readline()
l=l.strip()
return l
DEFAULT_CONFIGDIR = '/etc/mailping'
DEFAULT_STATEDIR = '/var/lib/mailping'
def getConfigDir():
return os.environ.get('MAILPING_CONFIGDIR',
DEFAULT_CONFIGDIR)
def getStateDir():
return os.environ.get('MAILPING_STATEDIR',
DEFAULT_STATEDIR)
|