コード例 #1
0
ファイル: pycore.py プロジェクト: longruiliu/vimrc
    def get_string_module(self, code, resource=None, force_errors=False):
        """Returns a `PyObject` object for the given code

        If `force_errors` is `True`, `exceptions.ModuleSyntaxError` is
        raised if module has syntax errors.  This overrides
        ``ignore_syntax_errors`` project config.

        """
        return PyModule(self, code, resource, force_errors=force_errors)
コード例 #2
0
 def get_pymodule(self, resource, force_errors=False):
     if resource in self.module_map:
         return self.module_map[resource]
     if resource.is_folder():
         result = PyPackage(self.pycore,
                            resource,
                            force_errors=force_errors)
     else:
         result = PyModule(self.pycore,
                           resource=resource,
                           force_errors=force_errors)
     self.module_map[resource] = result
     self.observer.add_resource(resource)
     return result