Commit 65915aa4 authored by nduca@chromium.org's avatar nduca@chromium.org

[telemetry] Remove all pyc files before doing presumibit work

Avoids presubmit failures when stale pyc files are found

NOTRY=True

Review URL: https://chromiumcodereview.appspot.com/17560002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207955 0039d316-1c4b-4281-b951-d872f2087c98
parent 9350fad9
......@@ -23,6 +23,16 @@ def RemoveAllDocs():
for filename in filenames:
os.remove(os.path.join(dirname, filename))
def RemoveAllStalePycFiles():
for dirname, _, filenames in os.walk(telemetry_dir):
for filename in filenames:
if not filename.endswith('.pyc'):
continue
pyc_path = os.path.join(dirname, filename)
py_path = os.path.splitext(pyc_path)[0] + '.py'
if not os.path.exists(py_path):
os.remove(py_path)
def GenerateHTMLForModule(module):
html = pydoc.html.page(pydoc.describe(module),
pydoc.html.document(module, module.__name__))
......@@ -59,6 +69,7 @@ def WriteHTMLForModule(module):
f.write(page)
def GetAllModulesToDocument(module):
RemoveAllStalePycFiles()
modules = [module]
for _, modname, _ in pkgutil.walk_packages(
module.__path__, module.__name__ + '.'):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment