def applySettings (self, filenameOrDict):
        if type (filenameOrDict) == str:
            file = open (filenameOrDict)
            buffer = file.read ()
            setList = []
            for child in buffer.split ('\n'):
                if len (child) == 0:
                    continue
                if child.startswith ('#'):
                    continue
                pair = match ('^([^=]+)=(.*)$', child)
                if pair is None:
                    print 'Warning, Bad formatting in line: ' + child
                    continue
                key = pair.group (1)
                value = pair.group (2)
                setList.append ((key.strip (), value.strip ()))
            settings = blank ()
            for key, value in setList:
                setattr (settings, key, value)
        elif type (filenameOrDict) == dict:
            settings = blank ()
            for key, value in filenameOrDict.iteritems ():
                setattr (settings, key, str (value))
        else:
            raise RuntimeError ('Bad type for settings')
        self.formatSettings (settings)
dataset/ETHPy150Open dotskapes/dotSkapes/modules/savage/graph/base.py/BaseGraph.applySettings/original