| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 import requests | 3 import requests |
| 4 import re | 4 import re |
| 5 from in_file import InFile | 5 from in_file import InFile |
| 6 | 6 |
| 7 BRANCH_FORMAT = "https://src.chromium.org/blink/branches/chromium/%s/%s" | 7 BRANCH_FORMAT = "https://src.chromium.org/blink/branches/chromium/%s/%s" |
| 8 TRUNK_PATH = "Source/platform/RuntimeEnabledFeatures.in" | 8 TRUNK_PATH = "Source/platform/RuntimeEnabledFeatures.in" |
| 9 TRUNK_URL = "https://src.chromium.org/blink/trunk/%s" % TRUNK_PATH | 9 TRUNK_URL = "https://src.chromium.org/blink/trunk/%s" % TRUNK_PATH |
| 10 | 10 |
| 11 | 11 |
| 12 def features_path(branch): | 12 def features_path(branch): |
| 13 # RuntimeEnabledFeatures has only existed since April 2013: | 13 # RuntimeEnabledFeatures has only existed since April 2013: |
| 14 if branch <= 1453: | 14 if branch <= 1453: |
| 15 return None | 15 return None |
| 16 # Source/core/page/RuntimeEnabledFeatures.in existed by 1547 | 16 # Source/core/page/RuntimeEnabledFeatures.in existed by 1547 |
| 17 # but was in an old format without status= arguments. | 17 # but was in an old format without status= arguments. |
| 18 if branch <= 1547: | 18 if branch <= 1547: |
| 19 return None | 19 return None |
| 20 if branch <= 1650: | 20 if branch <= 1650: |
| 21 return "Source/core/page/RuntimeEnabledFeatures.in" | 21 return "Source/core/page/RuntimeEnabledFeatures.in" |
| 22 # Modern location: | 22 # Modern location: |
| 23 return TRUNK_PATH | 23 return TRUNK_PATH |
| 24 | 24 |
| 25 | 25 |
| 26 def parse_features_file(features_text): | 26 def parse_features_file(features_text): |
| 27 valid_values = { | 27 valid_values = { |
| 28 'status': ['stable', 'experimental', 'deprecated', 'test'], | 28 'status': ['stable', 'experimental', 'test'], |
| 29 } | 29 } |
| 30 defaults = { | 30 defaults = { |
| 31 'condition': None, | 31 'condition': None, |
| 32 'depends_on': [], | 32 'depends_on': [], |
| 33 'custom': False, | 33 'custom': False, |
| 34 'status': None, | 34 'status': None, |
| 35 } | 35 } |
| 36 | 36 |
| 37 # FIXME: in_file.py manually calls str.strip so conver to str here. | 37 # FIXME: in_file.py manually calls str.strip so conver to str here. |
| 38 features_lines = str(features_text).split("\n") | 38 features_lines = str(features_text).split("\n") |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 for version, feature_file in historical_tuples + active_tuples: | 167 for version, feature_file in historical_tuples + active_tuples: |
| 168 auditor.add_version(version, feature_file) | 168 auditor.add_version(version, feature_file) |
| 169 | 169 |
| 170 print "\nConsider for removal (have been stable for at least one release):" | 170 print "\nConsider for removal (have been stable for at least one release):" |
| 171 for feature in stale_features(historical_tuples): | 171 for feature in stale_features(historical_tuples): |
| 172 print feature | 172 print feature |
| 173 | 173 |
| 174 | 174 |
| 175 if __name__ == "__main__": | 175 if __name__ == "__main__": |
| 176 main() | 176 main() |
| OLD | NEW |