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

Python log.debug函数代码示例

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

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



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

示例1: _add

    def _add(self):


        #self._widget.do_draw()
        label = self._widget.get_children()[0]
        label = gtk.Label()

        label.show()

        self._widget.set_size_request(-1, 23)
        self._widget.show()
        self._widget.set_view(True)

        if self._widget.is_voidplace():
            self._widget.show_voidplace()

        self._widget.set_view(True)
        #self._table.attach(self._widget, 0,2,self._x,self._y)

        #self._widget.do_voidplace()

        self._table.set_row_spacing(self._x,self._spacing)
        #from umit.interfaceeditor.BugDiff import BugDiff
        #BugDiff.pdic(self._coords)
        log.debug('CommandVoidplace: add voidplace')
开发者ID:aregee,项目名称:network-scanner,代码行数:25,代码来源:PageNotebook.py


示例2: start

    def start(self, reader):
        self.reader = reader

        self.icon = None
        self.wnd_pos = (0, 0)

        self.menu = gtk.Menu()
        self.menu.show()

        action = gtk.Action(None, '_Quit', 'Quit from UMIT', gtk.STOCK_QUIT)
        action.connect('activate', self.__on_quit)

        item = action.create_menu_item()
        item.show()

        self.menu.append(item)

        self.type = self.notifier = None

        # Force to use win32 module
        if WIN32_PRESENT:
            self.set_type(TrayPlugin.TYPE_WINDOWS)
        else:
            self.set_type(tray_prefs.parser['notifications']['type'].value)
            tray_prefs.parser['notifications']['type'].value = self.type

            logo = os.path.join(Path.icons_dir, 'umit_16.ico')
            log.debug('Creating status icon with %s as logo' % logo)

            self.icon = gtk.status_icon_new_from_file(logo)
            tray_prefs.change_cb = self.set_type

        self.icon.connect('popup-menu', self.__on_right_click)
        self.icon.connect('activate', self.__on_activate)
开发者ID:aregee,项目名称:network-scanner,代码行数:34,代码来源:main.py


示例3: _add_page

    def _add_page(self):
        log.debug('<<< Add new page')
        if self.label == None :
            label = self._notebook.create_label(self._name)
        else : 
            label = self.label

        if self._number == -1:
            self._notebook.sections_widgets_list.append(label)
            self._notebook.sections_widgets[label] = self._notebook.get_n_pages()
        else:
            num = self._number
            self._notebook.sections_widgets_list.insert(num,label)
            self._notebook.sections_widgets[label] = self._number-1
            for i in range(num-1, len(self._notebook.sections_widgets)-1):
                widget_tmp = self._notebook.sections_widgets_list[i+1]
                self._notebook.sections_widgets[widget_tmp] = self._notebook.sections_widgets[widget_tmp] + 1 

        self._notebook.insert_page(self._page, label, self._number)
        #self._notebook.append_page(self._page, label)
        self._page.show_all()
        label.voidplace()
        label.show_all()

        #profilecore
        #print self._name
        elem = self._profilecore.search_in_groups(self._name)
        if elem == None:

            self._profilecore.add_section(self._name)
            label.set_name(self._name)
开发者ID:aregee,项目名称:network-scanner,代码行数:31,代码来源:PageNotebook.py


示例4: _remove_option

    def _remove_option(self):

        widget = self._widget
        childs = widget.get_children()
        self._saved = [] 
        for i in childs:
            widget.remove(i)
            self._saved.append(i)
        t = gtk.Label('-')
        t.set_size_request(-1, 23)
        t.show()

        widget.pack_start(t)
        widget.do_voidplace()


        #Profile Core modifications: 
        po = self._widget.get_profileoption()

        widget_prev = self._page.get_prev_widget(self._widget)
        #widget_next = self._page.get_next_widget(self._widget)
        #print widget_prev
        #print widget_next
        #po.set_next_opt(None)

        #XXX <--- this protection should be wrong, too defencive 
        if widget_prev!=None:

            widget_prev.get_profileoption().set_next_opt(po.get_next_opt())

        self._profilecore.remove_opt(po.get_section(), po.get_label())


        log.debug('Removing option, Adding Void Place')
开发者ID:aregee,项目名称:network-scanner,代码行数:34,代码来源:PageNotebook.py


示例5: _add_option

    def _add_option(self):
        widget_option = self._widget_option
        widget = self._widget
        childs = widget.get_children()
        widget.remove(childs[0])
        if widget.is_voidplace():
            widget.unload_voidplace()
        if self._saved==None:
            for k in widget_option:
                widget.pack_start(k)
                k.show_all()
        else: 
            for k in self._saved:
                widget.pack_start(k)
                k.show_all()
        #self._widget.show_all()
        #widget_option.show() # XXX - may be need 

        #Profile Core modifications: 
        po = self._widget.get_profileoption()
        #print po.get_next_opt()
        widget_prev = self._page.get_prev_widget(self._widget)
        #widget_next = self._page.get_next_widget(self._widget)
        #print widget_prev
        #print widget_next
        if widget_prev !=None:
            po.set_next_opt(widget_prev.get_profileoption().get_next_opt())
            widget_prev.get_profileoption().set_next_opt(po.get_label())
        self._profilecore.add_from_profileoption(po)



        log.debug('Adding option')
开发者ID:aregee,项目名称:network-scanner,代码行数:33,代码来源:PageNotebook.py


示例6: delete_files

    def delete_files(self, widget):
        # NOTE: This method should be adapted in umit.core.UserConf
        # Creating an empty recent_scans file
        
        log.debug('>>> Reset store files:  -  %s' % base_paths['user_dir'])

        reset_user_dir(base_paths['user_dir'])
开发者ID:aregee,项目名称:network-scanner,代码行数:7,代码来源:GeneralSettings.py


示例7: add_profile

    def add_profile(self, profile_name, **attributes):
        log.debug(">>> Add Profile '%s': %s" % (profile_name, attributes))
        try:
            self.add_section(profile_name)
        except DuplicateSectionError:
            return None
        except ValueError:
            return None

        for attr in attributes:
            if attr != "options":
                self._set_it(profile_name, attr, attributes[attr])

        options = attributes["options"]
        if isinstance(options, basestring):
            self._set_it(profile_name, "options", options)
            # Assuming there are no values for these options
            options = {}
        elif isinstance(options, dict):
            self._set_it(profile_name, "options", ",".join(options))

        for opt in options:
            if options[opt]:
                self._set_it(profile_name, opt, options[opt])
        self.save_changes()
开发者ID:aregee,项目名称:network-scanner,代码行数:25,代码来源:UmitConf.py


示例8: __create_tab

    def __create_tab(self, tab_name, section_name, tab):
        log.debug(">>> Tab name: %s" % tab_name)
        log.debug(">>>Creating profile editor section: %s" % section_name)

        vbox = HIGVBox()
        table = HIGTable()
        section = HIGSectionLabel(section_name)

        vbox._pack_noexpand_nofill(section)
        vbox._pack_noexpand_nofill(HIGSpacer(table))
        vbox.set_border_width(6)

        tab.fill_table(table, True)
        self.scrollwindow = HIGScrolledWindow()
        self.scrollwindow.set_size_request(600,300)
        vp = gtk.Viewport()
        vp.add(vbox)
        vp.set_shadow_type(gtk.SHADOW_NONE)
        self.scrollwindow.add(vp)

        vbox_tmp = HIGVBox()
        vbox_tmp.set_border_width(6)
        vbox_tmp.set_spacing(12)
        vbox_tmp.pack_start(self.scrollwindow)


        self.notebook.append_page(vbox_tmp, gtk.Label(tab_name))
开发者ID:aregee,项目名称:network-scanner,代码行数:27,代码来源:ProfileEditor.py


示例9: __init__

    def __init__(self, value, \
                 name=None, def_value=None, desc=None, \
                 attrs=(), parent=None):
        """
        Create a variable

        @param value the value for variable
        @param name the name for variable (optional if are in list)
        @param def_val the default value for variable (optional if is user conf)
        @param desc the description of value (optional if in user conf)
        @param attrs a list of attributes
        @param sectiondict the section dict
        """
        self._value = self.__class__.convert(value)
        self._name = name
        self._def_val = self.__class__.convert(def_value)
        self._desc = desc
        self._parent = parent

        # Compatibility for child objects
        self.add_attribute(attrs, 'id', Integer, '_id')

        self.set_attributes(attrs)
        self.check_validity()

        if not Variable.setted(self._value):
            raise Exception("Value not setted")
        
        if not isinstance(self._value, self.__class__.element_type):
            raise Exception("Unable to set a valid type")
        
        log.debug(">>> Variable named '%s' allocate with value '%s'" % (self._name, self._value))
开发者ID:aregee,项目名称:network-scanner,代码行数:32,代码来源:Parser.py


示例10: _move_down

    def _move_down(self):

        widget_swap = self._get_next()
        if not self._voidplace : 
            self._profilecore.move_option_down(self._section_name, 
                                               self._name, 
                                               widget_swap.get_name())
        self._swap( widget_swap, self._move)
        #x, y = self._coords[widget_swap]
        #self._move.set_select(False)
        #widget_swap.set_select(False)

        #w_tmp = gtk.Label('tmp')
        #self._table.attach(w_tmp, 1,2, x, y)
        #self._table.remove(widget_swap)
        #self._table.attach(widget_swap, 0,2, self._x, self._x+1)
        #self._table.remove(self._move)

        #self._table.attach(self._move, 0,2, x, y)
        #self._table.remove(w_tmp)

        #self._coords[widget_swap] = [self._x, self._y]
        #self._coords[self._move] = [x,y]
        self._parent.send_signal()
        self._move.do_draw()
        log.debug('<<< Moving item down')
开发者ID:aregee,项目名称:network-scanner,代码行数:26,代码来源:PageNotebook.py


示例11: delete_section

    def delete_section(self):
        if self._old_select.is_voidplace():

            log.debug('Key press event on NotebookEditable \
                      -- unload voidplace')
            #self._old_select.unload_voidplace()
            #label_tmp =self.get_tab_label(self.get_nth_page(
                #self.get_current_page()))
            #num = self.sections_widgets[label_tmp]
            #del self.sections_widgets[label_tmp]
            #for i in range(num, len(self.sections_widgets)):
                #print i
                #widget_tmp = self.sections_widgets_list[i+1]
                #self.sections_widgets[widget_tmp] = self.sections_widgets[widget_tmp] - 1 

            #self.sections_widgets_list.pop(num)
            #self.remove_page(self.get_current_page())
            num = self.get_current_page()
            cmd = CommandPageNotebook(self,
                                      self.get_nth_page(num),num, 
                                      self._profilecore,
                                      False)
            command_manager.add_command(cmd)

            self._old_select=None
        else: 
            log.debug('Key press event on NotebookEditable -- \
                      CommandAddRemoveLabel')
            cmd = CommandAddRemoveLabel(self._old_select, 
                                        self._old_select.get_text(), self._profilecore,False)
            command_manager.add_command(cmd)
        self.emit('need-save', 'Sections', None)
开发者ID:aregee,项目名称:network-scanner,代码行数:32,代码来源:Profile.py


示例12: _move_right

    def _move_right(self):
        log.debug("move right")
        current = self._notebook.get_current_page()
        self._notebook.reorder_child(self._page,current+self._number )
        name = self._page.get_name()
        if name != None :
            self._profilecore.move_section_right(name)

        #Ajust sections childs (NotebookLabel)

        dic = self._notebook.sections_widgets
        list = self._notebook.sections_widgets_list

        list_tmp = []
        for i in range(len(list)):
            widget = list.pop()
            list_tmp.append(widget)
            if widget.get_name()==name :
                break 
        w_tmp = list_tmp.pop()
        w_tmp2 = list_tmp.pop()
        num = dic[w_tmp] 
        dic[w_tmp] = dic[w_tmp2]
        dic[w_tmp2] = num
        list.append(w_tmp2)
        list.append(w_tmp)
        for i in range(len(list_tmp)):
            list.append(list_tmp.pop())
开发者ID:aregee,项目名称:network-scanner,代码行数:28,代码来源:Profile.py


示例13: get_scan_results

    def get_scan_results(self):
        scan_file = None
        for i in range(self.scan_notebook.get_n_pages()):
            sbook_page = self.scan_notebook.get_nth_page(i)

            if not sbook_page.status.get_empty():
                scan_file = sbook_page.parsed.nmap_xml_file
                if hasattr(scan_file, "name"):
                    # this scan was loaded from a file so nmap_xml_file is
                    # actually a file object, but we are interested only in
                    # the file name.
                    scan_file = scan_file.name

            if scan_file and os.access(scan_file, os.R_OK) and\
               os.path.isfile(scan_file):
                log.debug(">>> Retrieving unsaved scan result: %s" % scan_file)

                try:
                    parsed = NmapParser()
                    parsed.set_xml_file(scan_file)
                    parsed.parse()
                    parsed.scan_name = "Unsaved " + sbook_page.get_tab_label()
                    parsed.unsaved = True
                except:
                    pass
                else:
                    yield parsed
开发者ID:aregee,项目名称:network-scanner,代码行数:27,代码来源:SearchResult.py


示例14: _on_remove_press

 def _on_remove_press(self, widget):
     log.debug('<<< Remove Option from OptionList')
     selected = self.get_selected()
     (model, iter) = self.get_selected_option()
     if selected!=None:
         self._new_list.remove(selected)
         self._model.remove(iter)
开发者ID:aregee,项目名称:network-scanner,代码行数:7,代码来源:Tools.py


示例15: _update_label

 def _update_label(self, widget):
     #XXX Replace by Command
     log.debug("Update Label")
     selected = self._selected
     cmd = CommandChangeLabel(selected, self._entry_name.get_text(), 
                              self._profilecore,self._boxeditable, True)
     command_manager.add_command(cmd)
开发者ID:aregee,项目名称:network-scanner,代码行数:7,代码来源:Tools.py


示例16: match_port

 def match_port(self, port):
     log.debug("Match port:%s" % port)
     if port == [""] or port == ["*"]:
         return True
     
     ports = []
     
     for p in self.parsed_scan.ports:
         for portid in p:
             if self.port_open and portid["state"] == "open":
                 ports.append(portid["portid"])
             elif self.port_filtered and portid["state"] == "filtered":
                 ports.append(portid["portid"])
             elif self.port_closed and portid["state"] == "closed":
                 ports.append(portid["portid"])
             elif not self.port_open and \
                     not self.port_filtered and \
                     not self.port_closed:
                 # In case every port state is False, add every port
                 ports.append(portid["portid"])
                 
     for keyport in port:
         if keyport not in ports:
             return False # No match for asked port
     else:
         return True # Every given port matched current result
开发者ID:aregee,项目名称:network-scanner,代码行数:26,代码来源:SearchResult.py


示例17: sanity_settings

    def sanity_settings(self, settings):
        log.debug(">>> Sanitize %s" % str(settings))

        tuple_regex = "[\(\[]\s?(\d+)\s?,\s?(\d+)\s?,\s?(\d+)\s?[\)\]]"
        if isinstance(settings, basestring):
            settings = [int(t) for t in re.findall(tuple_regex, settings)[0]]

        return settings
开发者ID:aregee,项目名称:network-scanner,代码行数:8,代码来源:UmitConf.py


示例18: on_key_press

    def on_key_press(self, widget, event):
        _keyval = gtk.gdk.keyval_name(event.keyval)
        log.debug('Key press event on NotebookEditable')
        if self._old_select==None:
            log.debug('Key press event on NotebookEditable -- Return')
            return

        if _keyval == "Delete" :
            self.delete_section()
开发者ID:aregee,项目名称:network-scanner,代码行数:9,代码来源:Profile.py


示例19: _remove_label

    def _remove_label(self):

        self._widget.voidplace()

        #ProfileCore
        if self._new : 
            pass



        log.debug('Removing label, Adding Void Place')
开发者ID:aregee,项目名称:network-scanner,代码行数:11,代码来源:Profile.py


示例20: root_dir

def root_dir():
    """Retrieves root dir on current filesystem"""
    curr_dir = os.getcwd()
    while True:
        splited = os.path.dirname(curr_dir)
        if curr_dir == splited:
            break
        curr_dir = splited

    log.debug(">>> Root dir: %s" % curr_dir)
    return curr_dir
开发者ID:aregee,项目名称:network-scanner,代码行数:11,代码来源:Paths.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python I18N._函数代码示例发布时间:2022-05-27
下一篇:
Python I18N._函数代码示例发布时间: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