| Index: tools/metrics/histograms/update_policies.py
|
| diff --git a/tools/metrics/histograms/update_policies.py b/tools/metrics/histograms/update_policies.py
|
| index 79f524f690b97a526fb139a90d0fd5233679b797..ec09ebafb82ae3bf05e33622701de8c693bae3b3 100644
|
| --- a/tools/metrics/histograms/update_policies.py
|
| +++ b/tools/metrics/histograms/update_policies.py
|
| @@ -16,15 +16,13 @@ from ast import literal_eval
|
| from optparse import OptionParser
|
| from xml.dom import minidom
|
|
|
| -import print_style
|
| +sys.path.append(os.path.join(os.path.dirname(__file__), '..')) # tools/metrics
|
| +from common.diff_util import PromptUserToAcceptDiff
|
| +from common import path_util
|
| +from histograms import print_style
|
|
|
| -# Import the metrics/common module.
|
| -sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common'))
|
| -from diff_util import PromptUserToAcceptDiff
|
| -
|
| -HISTOGRAMS_PATH = 'histograms.xml'
|
| -POLICY_TEMPLATES_PATH = (
|
| - '../../../components/policy/resources/policy_templates.json')
|
| +HISTOGRAMS_PATH = path_util.GetHistogramsFile()
|
| +POLICY_TEMPLATES_PATH = 'components/policy/resources/policy_templates.json'
|
| ENUM_NAME = 'EnterprisePolicies'
|
|
|
| class UserError(Exception):
|
| @@ -114,7 +112,7 @@ def main():
|
| sys.stderr.write(__doc__)
|
| sys.exit(1)
|
|
|
| - with open(POLICY_TEMPLATES_PATH, 'rb') as f:
|
| + with open(path_util.GetInputFile(POLICY_TEMPLATES_PATH), 'rb') as f:
|
| policy_templates = literal_eval(f.read())
|
| with open(HISTOGRAMS_PATH, 'rb') as f:
|
| histograms_doc = minidom.parse(f)
|
|
|