# # FinkConf.py # pyFinkCommander # # Created by Glenn Kerbein on 2/11/07. # Copyright (c) 2007 Spontaneous Dancing Productions. All rights reserved. # __creator__ = "Glenn Kerbein" __name__ = "FinkConf" __copyright__ = "2007" import string from Foundation import * class FinkConf: def __init__(self): pass def parser(self): """Gets all of the contents of fink.conf""" e = open('/sw/etc/fink.conf', 'r').readlines() e.pop(0) return e def mirrors(self): """Returns the mirrors from fink.conf""" m = dict() s = self.parser() for q in s[6:18]: m[q.split(': ')[0]] = q.split(': ')[1] del q, s return m def trees(self): """returns trees from fink.conf""" q = self.parser()[24].split() q.pop(0) return q