diff options
author | Roozbeh Pournader <roozbeh@google.com> | 2015-01-07 19:00:54 -0800 |
---|---|---|
committer | James Godfrey-Kittle <jamesgk@google.com> | 2015-04-16 12:16:24 -0700 |
commit | a86c86786a6980296408bf22a625747ba9607c7d (patch) | |
tree | 7bd53b9ce34510e639561cced8b7e6a47a7a946b /scripts/roboto_data.py | |
parent | 403041dcfae9f364038c3dcc034238d2ea1ddafc (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.py | 13 |
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 + |