• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python log.debug函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中mfp.log.debug函数的典型用法代码示例。如果您正苦于以下问题:Python debug函数的具体用法?Python debug怎么用?Python debug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: _callback_wrapper

 def _callback_wrapper(self, thunk):
     try:
         return thunk()
     except Exception as e:
         import traceback
         log.debug("Exception in GUI operation:", e)
         log.debug_traceback()
         return False
开发者ID:bgribble,项目名称:mfp,代码行数:8,代码来源:gui_main.py


示例2: command

 def command(self, action, data):
     if action == "buffer":
         log.debug("scopeplot: got buffer info", data)
         self.buf_info = data
         self.shm_obj = None 
     elif action == "grab":
         self._grab()
         self.plot.invalidate()
     return True
开发者ID:wrl,项目名称:mfp,代码行数:9,代码来源:scopeplot.py


示例3: load_complete

 def load_complete(self):
     self.load_in_progress = False 
     if self.selected_patch is None and len(self.patches):
         self.selected_patch = self.patches[0]
     if self.selected_layer is None and self.selected_patch is not None:
         self.layer_select(self.selected_patch.layers[0])
     self.object_view.refresh()
     self.layer_view.refresh()
     log.debug("Patch GUI completed")
开发者ID:wrl,项目名称:mfp,代码行数:9,代码来源:patch_window.py


示例4: label_edit_finish

 def label_edit_finish(self, widget, new_text, aborted=False):
     if self.obj_id is None:
         self.create(self.proc_type, None)
     if self.obj_id is None:
         log.debug("TextElement: could not create obj")
     elif new_text != self.value:
         self.value = new_text
         self.label.set_markup(self.value)
         MFPGUI().mfp.send(self.obj_id, 0, self.value)
     self.update()
开发者ID:wrl,项目名称:mfp,代码行数:10,代码来源:text_element.py


示例5: __init__

    def __init__(self, init_type, init_args, patch, scope, name):
        self.buffer = None
        self.retrig_value = True 
        self.need_buffer_send = False 

        if init_args is not None:
            log.debug("scope: Does not accept init args")

        self.gui_params = dict(plot_type="scope")
        Processor.__init__(self, 1, 1, init_type, init_args, patch, scope, name)
开发者ID:wrl,项目名称:mfp,代码行数:10,代码来源:plot.py


示例6: patch_close

def patch_close(self):
    p = self.selected_patch
    if p and p.deletable: 
        self.patch_select_next() 
        self.patches.remove(p)
        p.delete()
    else: 
        log.debug("Cannot close window. Close UI via plugin host Edit button")
    if not len(self.patches):
        self.quit()
开发者ID:bgribble,项目名称:mfp,代码行数:10,代码来源:patch_window_select.py


示例7: grab_handler

 def grab_handler(stage, event):
     try: 
         if not self.embed.has_focus():
             self.embed.grab_focus()
         return self.input_mgr.handle_event(stage, event)
     except Exception, e:
         import traceback 
         log.error("Error handling UI event", event) 
         log.debug(e)
         traceback.print_exc()
         return False
开发者ID:wrl,项目名称:mfp,代码行数:11,代码来源:patch_window.py


示例8: set_scope

    def set_scope(self, obj_id, scope_name):
        from .mfp_app import MFPApp
        obj = MFPApp().recall(obj_id)

        if obj is None or isinstance(obj, MFPApp):
            log.debug("Cannot find object for %s to set scope to %s" % (obj_id, scope_name))
            return

        scope = obj.patch.scopes.get(scope_name)
        if scope is None:
            scope = obj.patch.add_scope(scope_name)
        obj.assign(obj.patch, scope, obj.name)
开发者ID:bgribble,项目名称:mfp,代码行数:12,代码来源:mfp_command.py


示例9: layer_scope_edited

    def layer_scope_edited(layer, new_value):
        from mfp import log
        if isinstance(layer, Layer):
            p = self.selected_patch
            if not p.has_scope(new_value):
                log.debug("Adding scope", new_value, "to patch", self.selected_patch)
                MFPCommand().add_scope(self.selected_patch.obj_id, new_value)

            layer.scope = new_value
            self.selected_patch.send_params()
            for obj in self.objects:
                if obj.obj_id is not None and obj.layer == layer:
                    MFPCommand().set_scope(obj.obj_id, new_value)
                    self.refresh(obj)
        return True
开发者ID:wrl,项目名称:mfp,代码行数:15,代码来源:patch_window_views.py


示例10: obj_selected

 def obj_selected(obj):
     self._select(obj)
     if isinstance(obj, PatchElement): 
         self.layer_select(obj.layer)
     elif isinstance(obj, PatchInfo):
         self.layer_select(obj.layers[0])
     elif isinstance(obj, tuple):
         scope = obj[0]
         patch = obj[1] 
         if isinstance(patch, PatchInfo):
             for l in patch.layers:
                 if l.scope == scope:
                     self.layer_select(l)
                     return 
             self.layer_select(patch.layers[0])
         else:
             log.debug("[obj_selected] Got tuple", obj)
             self.layer_select(patch.layer)
开发者ID:bgribble,项目名称:mfp,代码行数:18,代码来源:patch_window_views.py


示例11: autoplace_noselection

    def autoplace_noselection(self):
        width, height = self.window.stage.get_size()
        spacing = self.NONE_SPACING
        cols = int(width / spacing)
        rows = int(height / spacing)

        if self.placement > rows * cols:
            self.placement = 0

        log.debug(self.placement, width, cols, height, rows)

        x = self.X_OFF + (self.placement % cols) * spacing
        y = self.Y_OFF + int(self.placement / cols) * spacing

        self._set_autoplace(x, y)

        self.placement += 1
        return True
开发者ID:bgribble,项目名称:mfp,代码行数:18,代码来源:autoplace.py


示例12: trigger

    def trigger(self):
        if isinstance(self.inlets[0], BufferInfo):
            self.buffer = self.inlets[0]
            if self.gui_created:
                MFPApp().gui_command.command(self.obj_id, "buffer", self.buffer)
            else: 
                self.need_buffer_send = True 
        elif self.inlets[0] is True:
            pass
        elif self.inlets[0] is False:
            if self.gui_created:
                self.grab()
        if self.buffer is None:
            log.debug("scope: got input from buffer, but no bufferinfo.. requesting")
            self.outlets[0] = MethodCall("bufinfo")

        if self.gui_created and self.need_buffer_send:
            self.need_buffer_send = False 
            MFPApp().gui_command.command(self.obj_id, "buffer", self.buffer)
开发者ID:wrl,项目名称:mfp,代码行数:19,代码来源:plot.py


示例13: open_context

    def open_context(self, node_id, context_id, owner_pid, samplerate):
        from .dsp_object import DSPContext 
        from .mfp_app import MFPApp
        try: 
            ctxt_name = open("/proc/%d/cmdline" % owner_pid, "r").read().split("\x00")[0]
            log.debug("open_context: new context, name=%s" % ctxt_name)
        except: 
            ctxt_name = ""

        if MFPApp().samplerate != samplerate: 
            log.debug("open_context: samplerate changing from %d to %d" % 
                      (MFPApp().samplerate, samplerate))
            MFPApp().samplerate = samplerate 


        if DSPContext.create(node_id, context_id, ctxt_name):
            return True
        else:
            return False
开发者ID:bgribble,项目名称:mfp,代码行数:19,代码来源:mfp_command.py


示例14: _grab

    def _grab(self):
        def offset(channel):
            return channel * self.buf_info.size * self.FLOAT_SIZE
        if self.buf_info is None:
            return None
        if self.shm_obj is None:
            self.shm_obj = SharedMemory(self.buf_info.buf_id)

        self.data = []

        try:
            for c in range(self.buf_info.channels):
                os.lseek(self.shm_obj.fd, offset(c), os.SEEK_SET)
                slc = os.read(self.shm_obj.fd, int(self.buf_info.size * self.FLOAT_SIZE))
                self.data.append(list(numpy.fromstring(slc, dtype=numpy.float32)))
                self.set_bounds(0, None, len(self.data[0])*1000/self.samplerate, None)
        except Exception as e:
            log.debug("scopeplot: error grabbing data", e)
            import traceback
            traceback.print_exc()
            return None
开发者ID:bgribble,项目名称:mfp,代码行数:21,代码来源:scopeplot.py


示例15: label_edit_finish

    def label_edit_finish(self, *args):
        t = self.label.get_text()

        if t != self.label_text:
            parts = t.split(' ', 1)
            self.obj_type = parts[0]
            if len(parts) > 1:
                self.obj_args = parts[1]

            log.debug("PlotElement: type=%s, args=%s" % (self.obj_type, self.obj_args))
            self.proc_type = self.obj_type
            self.create(self.proc_type, self.obj_args)

            if self.obj_id is None:
                log.debug("PlotElement: could not create", self.obj_type, self.obj_args)
            else:
                self.send_params()
                self.draw_ports()

            # FIXME set label to non-editing style
            self.update()
开发者ID:bgribble,项目名称:mfp,代码行数:21,代码来源:plot_element.py


示例16: call

    def call(self, target):
        try:
            m = getattr(target, self.method)
        except AttributeError as e:
            raise MethodCallError("Method '%s' not found for type '%s'" % (self.method, target.init_type))

        if callable(m):
            try:
                return m(*self.args, **self.kwargs)
            except Exception as e:
                log.debug("Error calling", self.method, "on", target)
                log.debug( "args=%s, kwargs=%s" % (self.args, self.kwargs))
                log.debug_traceback()
                raise MethodCallError("Method '%s' for type '%s' raised exception '%s' %s"
                                      % (self.method, target.init_type, e, type(e)))
        elif self.fallback:
            try:
                return self.fallback([self] + self.args, **self.kwargs)
            except Exception as e:
                raise MethodCallError("Method fallback '%s' for type '%s' raised exception '%s'"
                                      % (self.method, target.init_type, e))
        else:
            log.debug("MethodCall.call():", target, self.method, m, type(m))
            raise MethodCallError("Method '%s' of type '%s' cannot be called" 
                            % (self.method, target.init_type))
开发者ID:bgribble,项目名称:mfp,代码行数:25,代码来源:method.py


示例17: slice

    def slice(self, start, end, channel=0):
        if self.shm_obj is None:
            self.shm_obj = SharedMemory(self.buf_id)

        if start < 0:
            start = 0
        if start >= self.size:
            start = self.size-1
        if end < 0:
            end = 0

        if end >= self.size:
            end = self.size-1

        try:
            os.lseek(self.shm_obj.fd, self.offset(channel, start), os.SEEK_SET)
            slc = os.read(self.shm_obj.fd, (end - start) * self.FLOAT_SIZE)
            self.outlets[1] = list(numpy.fromstring(slc, dtype=numpy.float32))
        except Exception as e:
            import traceback 
            tb = traceback.format_exc()
            log.debug("buffer~: slice error '%s" % e)
            self.error(tb)
            return None
开发者ID:bgribble,项目名称:mfp,代码行数:24,代码来源:buffer.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python models.XMLdata类代码示例发布时间:2022-05-27
下一篇:
Python mforms.Utilities类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap