Пример #1
0
    def analyze_script(self, filenames):
        """
        Analyze given scripts and get dependencies on other Python modules.

        return two lists - python modules and python extensions
        """
        from modulegraph.find_modules import find_modules, parse_mf_results

        mf = find_modules(filenames, excludes=self.excludes)
        py_files, extensions = parse_mf_results(mf)

        return py_files, extensions
Пример #2
0
    def analyze_script(self, filenames):
        """
        Analyze given scripts and get dependencies on other Python modules.

        return two lists - python modules and python extensions
        """
        from modulegraph.find_modules import find_modules, parse_mf_results

        mf = find_modules(filenames, excludes=self.excludes)
        py_files, extensions = parse_mf_results(mf)

        return py_files, extensions
Пример #3
0
    def finalize_modulefinder(self, mf):
        for item in mf.flatten():
            if isinstance(item, Package) and item.filename == '-':
                fn = os.path.join(self.temp_dir, 'empty_package', '__init__.py')
                if not os.path.exists(fn):
                    dn = os.path.dirname(fn)
                    if not os.path.exists(dn):
                        os.makedirs(dn)
                    fp = open(fn, 'w')
                    fp.close()

                item.filename = fn

        py_files, extensions = parse_mf_results(mf)
        py_files = list(py_files)
        extensions = list(extensions)
        return py_files, extensions
Пример #4
0
    def finalize_modulefinder(self, mf):
        for item in mf.flatten():
            if isinstance(item, Package) and item.filename == '-':
                fn = os.path.join(self.folders.temp_dir, 'empty_package',
                                  '__init__.py')
                if not os.path.exists(fn):
                    dn = os.path.dirname(fn)
                    if not os.path.exists(dn):
                        os.makedirs(dn)
                    fp = open(fn, 'w')
                    fp.close()

                item.filename = fn

        py_files, extensions = parse_mf_results(mf)
        py_files = list(py_files)
        extensions = list(extensions)
        return py_files, extensions
Пример #5
0
 def finalize_modulefinder(self, mf):
     py_files, extensions = parse_mf_results(mf)
     py_files = list(py_files)
     extensions = list(extensions)
     return py_files, extensions
Пример #6
0
 def finalize_modulefinder(self, mf):
     py_files, extensions = parse_mf_results(mf)
     py_files = list(py_files)
     extensions = list(extensions)
     return py_files, extensions