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

Unified Diff: services/icu_data/embed_icu_data.py

Issue 979043003: Fix shell_apptest for android. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: namespace Created 5 years, 9 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 | « services/icu_data/data.h ('k') | services/icu_data/icu_data_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/icu_data/embed_icu_data.py
diff --git a/services/icu_data/embed_icu_data.py b/services/icu_data/embed_icu_data.py
deleted file mode 100755
index 515a3bb767b95ee9f11f53b88573460894c24831..0000000000000000000000000000000000000000
--- a/services/icu_data/embed_icu_data.py
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 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 os
-import sys
-import hashlib
-
-in_file = sys.argv[1]
-out_file = sys.argv[2]
-
-out_dir = os.path.dirname(out_file)
-
-data = None
-with open(in_file, "rb") as f:
- data = f.read()
-
-if not os.path.exists(out_dir):
- os.makedirs(out_dir)
-
-sha1hash = hashlib.sha1(data).hexdigest()
-
-values = ["0x%02x" % ord(c) for c in data]
-lines = []
-chunk_size = 16
-for i in range(0, len(values), chunk_size):
- lines.append(", ".join(values[i: i + chunk_size]))
-
-with open(out_file, "w") as f:
- f.write('#include "services/icu_data/data.h"\n')
- f.write("namespace icu_data {\n")
- f.write("const char kICUDataTable[%d] = {\n" % len(data))
- f.write(",\n".join(lines))
- f.write("\n};\n")
- f.write("const size_t kICUDataTableSize = sizeof(kICUDataTable);\n")
- f.write("const char kICUDataTableHash[] = \"%s\";\n" % sha1hash)
- f.write("}\n")
« no previous file with comments | « services/icu_data/data.h ('k') | services/icu_data/icu_data_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698