Changeset 2712

Show
Ignore:
Timestamp:
11/06/17 01:36:01 (3 years ago)
Author:
jwoithe
Message:

Fixes for scons3/python3 in doxygen-related scripts.

Apply some fixes needed for use under scons3/python3. The resulting code
seems to run correctly with scons2 under python2 so there's no obvious
reason these can't go in now. Thanks to Orcan Ogetbil for the patch.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/admin/doxygen.py

    r864 r2712  
    4444import glob 
    4545from fnmatch import fnmatch 
     46from functools import reduce 
    4647 
    4748def DoxyfileParse(file_contents): 
     
    5354 
    5455   import shlex 
    55    lex = shlex.shlex(instream = file_contents, posix = True) 
     56   lex = shlex.shlex(instream = file_contents.decode(), posix = True) 
    5657   lex.wordchars += "*+./-:" 
    5758   lex.whitespace = lex.whitespace.replace("\n", "") 
     
    99100 
    100101   # compress lists of len 1 into single strings 
     102   to_pop = [] 
    101103   for (k, v) in data.items(): 
    102104      if len(v) == 0: 
    103          data.pop(k) 
     105         # data.pop(k)  # Shouldn't modify dictionary while looping 
     106         to_pop.append(k) 
    104107 
    105108      # items in the following list will be kept as lists and not converted to strings 
     
    109112      if len(v) == 1: 
    110113         data[k] = v[0] 
     114 
     115   for k in to_pop: 
     116      data.pop(k) 
    111117 
    112118   return data