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


Python H.data_read方法代码示例

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


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

示例1: load_watch_data

# 需要导入模块: from helper import H [as 别名]
# 或者: from helper.H import data_read [as 别名]
def load_watch_data():
    data_path = os.path.join(sublime.packages_path(), 'User', S.FILE_WATCH_DATA)
    data = []
    try:
        data_file = open(data_path, 'rb')
    except:
        e = sys.exc_info()[1]
        info('Failed to open %s.' % data_path)
        debug(e)

    try:
        data = json.loads(H.data_read(data_file.read()))
    except:
        e = sys.exc_info()[1]
        info('Failed to parse %s.' % data_path)
        debug(e)

    # Check if expression is not already defined
    duplicates = []
    for index, entry in enumerate(data):
        matches = [x for x in S.WATCH if x['expression'] == entry['expression']]
        if matches:
            duplicates.append(entry)
        else:
            # Unset any previous value
            data[index]['value'] = None
    for duplicate in duplicates:
        data.remove(duplicate)

    if not isinstance(S.WATCH, list):
        S.WATCH = []

    # Set watch data
    S.WATCH.extend(data)
开发者ID:federivo,项目名称:SublimeTextXdebug,代码行数:36,代码来源:util.py

示例2: load_watch_data

# 需要导入模块: from helper import H [as 别名]
# 或者: from helper.H import data_read [as 别名]
def load_watch_data():
    data_path = os.path.join(sublime.packages_path(), 'User', S.FILE_WATCH_DATA)
    data = []
    try:
        data_file = open(data_path, 'rb')
    except:
        e = sys.exc_info()[1]
        info('Failed to open %s.' % data_path)
        debug(e)

    try:
        data = json.loads(H.data_read(data_file.read()))
    except:
        e = sys.exc_info()[1]
        info('Failed to parse %s.' % data_path)
        debug(e)

    # Check if expression is not already defined
    for entry in data:
        matches = [x for x in S.WATCH if x['expression'] == entry['expression']]
        if matches:
            data.remove(entry)

    if not isinstance(S.WATCH, list):
        S.WATCH = []

    # Set watch data
    S.WATCH.extend(data)
开发者ID:rooseveltrp,项目名称:SublimeTextXdebug,代码行数:30,代码来源:util.py

示例3: load_breakpoint_data

# 需要导入模块: from helper import H [as 别名]
# 或者: from helper.H import data_read [as 别名]
def load_breakpoint_data():
    data_path = os.path.join(sublime.packages_path(), 'User', S.FILE_BREAKPOINT_DATA)
    data = {}
    try:
        data_file = open(data_path, 'rb')
    except:
        e = sys.exc_info()[1]
        info('Failed to open %s.' % data_path)
        debug(e)

    try:
        data = json.loads(H.data_read(data_file.read()))
    except:
        e = sys.exc_info()[1]
        info('Failed to parse %s.' % data_path)
        debug(e)

    # Do not use deleted files or entries without breakpoints
    if data:
        for filename, breakpoint_data in data.copy().items():
            if not breakpoint_data or not os.path.isfile(filename):
                del data[filename]

    if not isinstance(S.BREAKPOINT, dict):
        S.BREAKPOINT = {}

    # Set breakpoint data
    S.BREAKPOINT.update(data)
开发者ID:federivo,项目名称:SublimeTextXdebug,代码行数:30,代码来源:util.py

示例4: read_until_null

# 需要导入模块: from helper import H [as 别名]
# 或者: from helper.H import data_read [as 别名]
 def read_until_null(self):
     """
     Get response data from debugger engine.
     """
     # Check socket connection
     if self.connected:
         # Get result data from debugger engine
         while not '\x00' in self.buffer:
             self.buffer += H.data_read(self.socket.recv(self.read_size))
         data, self.buffer = self.buffer.split('\x00', 1)
         return data
     else:
         raise ProtocolConnectionException("Xdebug is not connected")
开发者ID:pirog,项目名称:SublimeTextXdebug,代码行数:15,代码来源:session.py

示例5: read_until_null

# 需要导入模块: from helper import H [as 别名]
# 或者: from helper.H import data_read [as 别名]
 def read_until_null(self):
     """
     Get response data from debugger engine.
     """
     # Check socket connection
     if self.connected:
         # Get result data from debugger engine
         try:
             while not "\x00" in self.buffer:
                 self.buffer += H.data_read(self.socket.recv(self.read_size))
             data, self.buffer = self.buffer.split("\x00", 1)
             return data
         except:
             e = sys.exc_info()[1]
             raise ProtocolConnectionException(e)
     else:
         raise ProtocolConnectionException("Xdebug is not connected")
开发者ID:notriddle,项目名称:SublimeTextXdebug,代码行数:19,代码来源:protocol.py


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