Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Unified Diff: tools/telemetry/build/update_docs.py

Issue 17560002: [telemetry] Remove all pyc files before doing presumibit work (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/build/update_docs.py
diff --git a/tools/telemetry/build/update_docs.py b/tools/telemetry/build/update_docs.py
index d5f6d0ca51d74b795274f0154578b32cc7eb079a..b1be09fad8a298100a7ed4f0168e19830e8b2de4 100644
--- a/tools/telemetry/build/update_docs.py
+++ b/tools/telemetry/build/update_docs.py
@@ -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
+ pycpath = os.path.join(dirname, filename)
tonyg 2013/06/21 19:02:38 I'd find these more readable as pyc_path and py_pa
+ pypath = os.path.splitext(pycpath)[0] + '.py'
+ if not os.path.exists(pypath):
+ os.remove(pypath)
+
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__ + '.'):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698