r261642 - Allow running dump_format_style.py from any directory.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 23 08:11:45 PST 2016


Author: alexfh
Date: Tue Feb 23 10:11:43 2016
New Revision: 261642

URL: http://llvm.org/viewvc/llvm-project?rev=261642&view=rev
Log:
Allow running dump_format_style.py from any directory.

Modified:
    cfe/trunk/docs/tools/dump_format_style.py

Modified: cfe/trunk/docs/tools/dump_format_style.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/tools/dump_format_style.py?rev=261642&r1=261641&r2=261642&view=diff
==============================================================================
--- cfe/trunk/docs/tools/dump_format_style.py (original)
+++ cfe/trunk/docs/tools/dump_format_style.py Tue Feb 23 10:11:43 2016
@@ -4,11 +4,13 @@
 # Run from the directory in which this file is located to update the docs.
 
 import collections
+import os
 import re
 import urllib2
 
-FORMAT_STYLE_FILE = '../../include/clang/Format/Format.h'
-DOC_FILE = '../ClangFormatStyleOptions.rst'
+CLANG_DIR = os.path.join(os.path.dirname(__file__), '../..')
+FORMAT_STYLE_FILE = os.path.join(CLANG_DIR, 'include/clang/Format/Format.h')
+DOC_FILE = os.path.join(CLANG_DIR, 'docs/ClangFormatStyleOptions.rst')
 
 
 def substitute(text, tag, contents):




More information about the cfe-commits mailing list