示例#1
0
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.')
示例#2
0
文件: __init__.py 项目: betaY/crawler
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.')
示例#3
0
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)
示例#4
0
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)
示例#5
0
def parse_pac_string(pac_script):
    """
  Evaluates pac_script in the Javascript engine created by init().
  """
    _pacparser.parse_pac_string(pac_script)
示例#6
0
文件: __init__.py 项目: betaY/crawler
def parse_pac_string(pac_script):
  """
  Evaluates pac_script in the Javascript engine created by init().
  """
  _pacparser.parse_pac_string(pac_script)