当前位置: 首页>>代码示例>>Python>>正文


Python codeop.CommandCompiler方法代码示例

本文整理汇总了Python中codeop.CommandCompiler方法的典型用法代码示例。如果您正苦于以下问题:Python codeop.CommandCompiler方法的具体用法?Python codeop.CommandCompiler怎么用?Python codeop.CommandCompiler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在codeop的用法示例。


在下文中一共展示了codeop.CommandCompiler方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: read_command

# 需要导入模块: import codeop [as 别名]
# 或者: from codeop import CommandCompiler [as 别名]
def read_command(self) -> Optional[CodeType]:
        """Read a command from the user line by line.

        Returns a code object suitable for execution.
        """

        reader = self.reader

        line = await reader.readline()
        if line == b"":
            raise ConnectionResetError()

        try:
            # skip the newline to make CommandCompiler work as advertised
            codeobj = self.compiler(line.rstrip(b"\n"))
        except SyntaxError:
            await self.send_exception()
            return None

        return codeobj 
开发者ID:tulir,项目名称:mautrix-python,代码行数:22,代码来源:manhole.py

示例2: __init__

# 需要导入模块: import codeop [as 别名]
# 或者: from codeop import CommandCompiler [as 别名]
def __init__(self, locals=None):
        """Constructor.

        The optional 'locals' argument specifies the dictionary in
        which code will be executed; it defaults to a newly created
        dictionary with key "__name__" set to "__console__" and key
        "__doc__" set to None.

        """
        if locals is None:
            locals = {"__name__": "__console__", "__doc__": None}
        self.locals = locals
        self.compile = CommandCompiler() 
开发者ID:glmcdona,项目名称:meddle,代码行数:15,代码来源:code.py

示例3: __init__

# 需要导入模块: import codeop [as 别名]
# 或者: from codeop import CommandCompiler [as 别名]
def __init__(self):
        """Create a new InputSplitter instance.
        """
        self._buffer = []
        self._compile = codeop.CommandCompiler()
        self.encoding = get_input_encoding() 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:8,代码来源:inputsplitter.py

示例4: __init__

# 需要导入模块: import codeop [as 别名]
# 或者: from codeop import CommandCompiler [as 别名]
def __init__(self):
        self.breakpoints = {}
        self.redirect = True
        self.socket = None
        self.procuuid = None

        self.__messageHandlers = {}
        self.__initMessageHandlers()

        # special objects representing the main scripts thread and frame
        self.mainThread = self
        self.framenr = 0

        # The context to run the debugged program in.
        self.debugMod = imp.new_module('__main__')
        self.debugMod.__dict__['__builtins__'] = __builtins__

        # The list of complete lines to execute.
        self.buffer = ''

        # The list of regexp objects to filter variables against
        self.globalsFilterObjects = []
        self.localsFilterObjects = []

        self._fncache = {}
        self.dircache = []
        self.passive = False    # used to indicate the passive mode
        self.running = None
        self.test = None
        self.debugging = False
        self.userInput = None

        self.forkAuto = False
        self.forkChild = False

        self.readstream = None
        self.pollingDisabled = False

        self.callTraceEnabled = None

        self.compileCommand = codeop.CommandCompiler()

        self.__encoding = 'utf-8'
        self.eventExit = None
        self.__needEpilogue = True 
开发者ID:SergeySatskiy,项目名称:codimension,代码行数:47,代码来源:clientbase_cdm_dbg.py


注:本文中的codeop.CommandCompiler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。