Пример #1
0
    def get_dependancy_files(self):

        includes1a = MyFileWalker.get_all_func_calls(self.contents, 'add_file', argpos=1)
        includes1b = MyFileWalker.get_all_func_calls(self.contents, 'add_file_mpl', argpos=1)
        includes = includes1a + includes1b

        includes2 = []
        re_outputline = re.compile(r"""#\s*INPUT:\s*'(.*)'\s*$""", re.MULTILINE)
        for match in re_outputline.finditer(self.contents):
            includes2.append(match.groups()[0])

        return includes + includes2
Пример #2
0
    def get_output_files(self):
        includes_1 = MyFileWalker.get_all_func_calls(self.contents, 'savefig', argpos=0)
        includes_2 = MyFileWalker.get_all_func_calls(self.contents, 'save', argpos=0)

        # OUTPUT: 'filename' lines
        includes_3 = []
        re_outputline = re.compile(r"""#\s*OUTPUT:\s*'(.*)'\s*$""", re.MULTILINE)
        for match in re_outputline.finditer(self.contents):
            includes_3.append(match.groups()[0])

        includes = includes_1 + includes_2 + includes_3

        return includes