Return the unquoted value of a variable from a file.. QUOTED_VALUE='quotes' -> str('quotes') UNQUOTED_VALUE=noquotes -> str('noquotes')
(fn, variable)
| 71 | return "'%s'"%(value.replace("'", "'\"'\"'")) |
| 72 | |
| 73 | def grepValue(fn, variable): |
| 74 | """ |
| 75 | Return the unquoted value of a variable from a file.. |
| 76 | QUOTED_VALUE='quotes' -> str('quotes') |
| 77 | UNQUOTED_VALUE=noquotes -> str('noquotes') |
| 78 | """ |
| 79 | variable = variable + '=' |
| 80 | for ln in open(fn, 'r'): |
| 81 | if ln.startswith(variable): |
| 82 | value = ln[len(variable):].strip() |
| 83 | return value.strip("\"'") |
| 84 | raise RuntimeError("Cannot find variable %s" % variable[:-1]) |
| 85 | |
| 86 | _cache_getVersion = None |
| 87 |
no test coverage detected
searching dependent graphs…