Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1037)

Unified Diff: mojo/tools/mopy/file_hash.py

Issue 878933003: Move the apptest runner and parts of mopy to the public SDK. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/tools/mopy/config.py ('k') | mojo/tools/mopy/gn.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/tools/mopy/file_hash.py
diff --git a/mojo/tools/mopy/file_hash.py b/mojo/tools/mopy/file_hash.py
deleted file mode 100644
index abdd821c985b21be3a065741927ea77468cce105..0000000000000000000000000000000000000000
--- a/mojo/tools/mopy/file_hash.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-
-# pylint: disable=E0611
-from hashlib import sha256
-
-from mopy.memoize import memoize
-
-_logging = logging.getLogger()
-
-@memoize
-def file_hash(filename):
- """Returns a string representing the hash of the given file."""
- _logging.debug("Hashing %s ...", filename)
- with open(filename, mode='rb') as f:
- m = sha256()
- while True:
- block = f.read(4096)
- if not block:
- break
- m.update(block)
- _logging.debug(" => %s", m.hexdigest())
- return m.hexdigest()
« no previous file with comments | « mojo/tools/mopy/config.py ('k') | mojo/tools/mopy/gn.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698