def get_ts_info(): path = "/etc/torrentserver/tsconf.conf" d = dict() if os.path.exists(path): for l in open(path): row = map(str.strip, l.split(":", 1)) if len(row) == 2: d[row[0]] = row[1] return d