determine what modules this file provides -- we work off of the preprocessed file if it exists.
(self)
| 84 | |
| 85 | |
| 86 | def defined_modules(self): |
| 87 | """determine what modules this file provides -- we work off of the |
| 88 | preprocessed file if it exists.""" |
| 89 | |
| 90 | defines = [] |
| 91 | |
| 92 | with io.open(self.search_name(), "r", encoding="latin-1") as f: |
| 93 | |
| 94 | for line in f: |
| 95 | |
| 96 | # strip off the comments |
| 97 | idx = line.find("!") |
| 98 | line = line[:idx] |
| 99 | |
| 100 | # we want a module definition itself, not a 'module procedure' |
| 101 | # also, Fortran is case-insensitive |
| 102 | rebreak = module_re.search(line) |
| 103 | rebreak2 = module_proc_re.search(line) |
| 104 | if rebreak and not rebreak2: |
| 105 | defines.append(rebreak.group(4).lower()) |
| 106 | |
| 107 | return defines |
| 108 | |
| 109 | |
| 110 | def needed_modules(self): |
no test coverage detected