code: def fromfile(filename):
    
    patchset = PatchSet()
    debug("reading %s" % filename)
    fp = open(filename, "rb")
    res = patchset.parse(fp)
    fp.close()
    if res == True:
      return patchset
    return False
docs: Parse patch file. If successful, returns
        PatchSet() object. Otherwise returns False.