/usr/share/pyshared/rst2pdf/config.py is in rst2pdf 0.93-1.
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 | # -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
"""Singleton config object"""
import ConfigParser
import os
from rst2pdf.rson import loads
cfdir = os.path.join(os.path.expanduser('~'), '.rst2pdf')
cfname = os.path.join(cfdir, 'config')
def getValue(section, key, default=None):
section = section.lower()
key = key.lower()
try:
return loads(conf.get(section, key))
except Exception:
return default
class ConfigError(Exception):
def __init__(self, modulename, msg):
self.modulename = modulename
self.msg = msg
conf = ConfigParser.SafeConfigParser()
def parseConfig(extracf=None):
global conf
cflist = ["/etc/rst2pdf.conf", cfname]
if extracf:
cflist.append(extracf)
conf = ConfigParser.SafeConfigParser()
conf.read(cflist)
parseConfig()
|