summaryrefslogtreecommitdiff
path: root/scripts/roboto_data.py
diff options
context:
space:
mode:
authorRoozbeh Pournader <roozbeh@google.com>2015-01-07 19:00:54 -0800
committerJames Godfrey-Kittle <jamesgk@google.com>2015-04-16 12:16:24 -0700
commita86c86786a6980296408bf22a625747ba9607c7d (patch)
tree7bd53b9ce34510e639561cced8b7e6a47a7a946b /scripts/roboto_data.py
parent403041dcfae9f364038c3dcc034238d2ea1ddafc (diff)
Add tests for version and revision numbers.
Also add a touchup to fix the revision number.
Diffstat (limited to 'scripts/roboto_data.py')
-rw-r--r--scripts/roboto_data.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/roboto_data.py b/scripts/roboto_data.py
index ef2a773..96a1060 100644
--- a/scripts/roboto_data.py
+++ b/scripts/roboto_data.py
@@ -1,8 +1,11 @@
#!/usr/bin/python
"""Post-build changes for Roboto for Android."""
+import os
+from os import path
import re
+
WEIGHTS = {
'Thin': 250,
'Light': 300,
@@ -25,3 +28,13 @@ def extract_weight_name(font_name):
return 'Regular'
else:
return match.group(1)
+
+
+def get_build_number():
+ """Returns the build number as a five-digit string."""
+ build_number_txt = path.join(
+ path.dirname(__file__), os.pardir, 'res', 'buildnumber.txt')
+ build_number = open(build_number_txt).read().strip()
+ assert re.match('[0-9]{5}', build_number)
+ return build_number
+