(self, filepath)
Generates checksum of given file.

    Args:
      filepath: String of filepath.

    Returns:
      f_hash: SHA1 hash for the file provided in filepath.
Generates checksum of given file.
Generates checksum of given file .
def GetFileChecksum(self, filepath):
    """Generates checksum of given file.

    Args:
      filepath: String of filepath.

    Returns:
      f_hash: SHA1 hash for the file provided in filepath.
    """
    statinfo = os.stat(filepath)
    if statinfo.st_size/1048576 < 200:
      f_content = open(filepath, 'r').read()
      f_hash = hashlib.sha1(f_content).hexdigest()
      return f_hash
    else:
      cmd = ['shasum', filepath]
      (stdout, unused_sterr, unused_rc) = RunProcess(cmd)
      return stdout.split()[0]
def GetFileChecksum ( self , filepath ) : statinfo = os . stat ( filepath ) if statinfo . st_size / 1048576 < 200 : f_content = open ( filepath , 'r' ) . read ( ) f_hash = hashlib . sha1 ( f_content ) . hexdigest ( ) return f_hash else : cmd = [ 'shasum' , filepath ] ( stdout , unused_sterr , unused_rc ) = RunProcess ( cmd ) return stdout . split ( ) [ 0 ]