From c6935bf1775ae73edf525376b79aeafc05f673b1 Mon Sep 17 00:00:00 2001 From: jblum Date: Fri, 22 May 2009 21:16:37 +0000 Subject: Quick fix for ubuntu docs dir. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@11087 221aa14e-8319-0410-a670-987f0aec2ac5 --- grc/src/platforms/python/utils/extract_docs.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'grc/src') diff --git a/grc/src/platforms/python/utils/extract_docs.py b/grc/src/platforms/python/utils/extract_docs.py index dfc0b7e97..ac0fe59b4 100644 --- a/grc/src/platforms/python/utils/extract_docs.py +++ b/grc/src/platforms/python/utils/extract_docs.py @@ -77,15 +77,17 @@ def extract(key): @param key the block key @return a string with documentation """ - #get potential xml file matches for the key - if os.path.exists(DOCS_DIR) and os.path.isdir(DOCS_DIR): - matches = filter(lambda f: is_match(key, f), os.listdir(DOCS_DIR)) - else: matches = list() + UBUNTU_DOCS_DIR = '/usr/share/doc/gnuradio-doc/xml' + if os.path.exists(DOCS_DIR): docs_dir = DOCS_DIR + elif os.path.exists(UBUNTU_DOCS_DIR): docs_dir = UBUNTU_DOCS_DIR + else: return '' + #extract matches + matches = filter(lambda f: is_match(key, f), os.listdir(docs_dir)) #combine all matches doc_strs = list() for match in matches: try: - xml_file = DOCS_DIR + '/' + match + xml_file = os.path.join(docs_dir, match) xml = etree.parse(xml_file) #extract descriptions comp_name = extract_txt(xml.xpath(DOXYGEN_NAME_XPATH)[0]).strip('\n') -- cgit