parameters: (self, old, new)
docstring: return tuple of source file, target file
docstring_summary: return tuple of source file, target file
docstring_tokens: return tuple of source file target file
function: def findfiles(self, old, new):
      """ return tuple of source file, target file """
      if old == b'/dev/null':
        handle, abspath = tempfile.mkstemp(suffix='pypatch')
        abspath = abspath.encode()
        # The source file must contain a line for the hunk matching to succeed.
        os.write(handle, b' ')
        os.close(handle)
        if not exists(new):
          handle = open(new, 'wb')
          handle.close()
        return abspath, new
      elif exists(old):
        return old, old
      elif exists(new):
        return new, new
      elif new == b'/dev/null':
        return None, None
      else:
        # [w] Google Code generates broken patches with its online editor
        debug("broken patch from Google Code, stripping prefixes..")
        if old.startswith(b'a/') and new.startswith(b'b/'):
          old, new = old[2:], new[2:]
          debug("   %s" % old)
          debug("   %s" % new)
          if exists(old):
            return old, old
          elif exists(new):
            return new, new
        return None, None
function_tokens: def findfiles ( self , old , new ) : if old == b'/dev/null' : handle , abspath = tempfile . mkstemp ( suffix = 'pypatch' ) abspath = abspath . encode ( ) # The source file must contain a line for the hunk matching to succeed. os . write ( handle , b' ' ) os . close ( handle ) if not exists ( new ) : handle = open ( new , 'wb' ) handle . close ( ) return abspath , new elif exists ( old ) : return old , old elif exists ( new ) : return new , new elif new == b'/dev/null' : return None , None else : # [w] Google Code generates broken patches with its online editor debug ( "broken patch from Google Code, stripping prefixes.." ) if old . startswith ( b'a/' ) and new . startswith ( b'b/' ) : old , new = old [ 2 : ] , new [ 2 : ] debug ( "   %s" % old ) debug ( "   %s" % new ) if exists ( old ) : return old , old elif exists ( new ) : return new , new return None , None