Chromium Code Reviews| Index: appengine/findit/util_scripts/script_util.py |
| diff --git a/appengine/findit/util_scripts/script_util.py b/appengine/findit/util_scripts/script_util.py |
| index dc4da5cf06aa4618ecacfb9279df174e69ab996d..9f6486dec46f1715cc1787c67ccc859236cbddeb 100644 |
| --- a/appengine/findit/util_scripts/script_util.py |
| +++ b/appengine/findit/util_scripts/script_util.py |
| @@ -9,6 +9,12 @@ import os |
| import subprocess |
| import sys |
| +from lib.cache_decorator import Cached |
| +from local_cache import LocalCacher # pylint: disable=W |
| + |
| +_COMMAND_OUPUT_CACHE_DIR = os.path.join(os.path.dirname(__file__), |
| + '.command_output_cache') |
|
wrengr
2016/11/11 18:26:26
Wait, weren't we putting temp files in ~/.predator
Sharu Jiang
2016/11/12 01:01:50
Oops.. should have put this into the ~/*
|
| + |
| def SetUpSystemPaths(): # pragma: no cover |
| """Sets system paths so as to import modules in findit, third_party and |
| @@ -29,7 +35,8 @@ def SetUpSystemPaths(): # pragma: no cover |
| sys.path.insert(1, findit_root_dir) |
| -# TODO(katesonia): Add local cache for this function. |
| +@Cached(namespace='Command-output', |
| + cacher=LocalCacher(cache_dir=_COMMAND_OUPUT_CACHE_DIR)) |
| def GetCommandOutput(command): |
| """Gets the output stream of executable command. |