def parse_pac_file(pacfile): """ Reads the pacfile and evaluates it in the Javascript engine created by init(). """ try: with open(pacfile) as f: pac_script = f.read() _pacparser.parse_pac_string(pac_script) except IOError: raise IOError('Could not read the pacfile.')
def parse_pac_file(pacfile): """ Reads the pacfile and evaluates it in the Javascript engine created by init(). """ try: f = open(pacfile) pac_script = f.read() except IOError: print('Could not read the pacfile: %s\n%s' % (pacfile, sys.exc_info()[1])) return f.close() _pacparser.parse_pac_string(pac_script)
def parse_pac_string(pac_script): """ Evaluates pac_script in the Javascript engine created by init(). """ _pacparser.parse_pac_string(pac_script)