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

Python api.devlog函数代码示例

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

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



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

示例1: _showContextMenu

    def _showContextMenu(self, item, pos, val):
        """Pop up a context menu when an item is right-clicked on the list view."""
                                                                                               
                                               
                                               
                                               
                              
        popup = qt.QPopupMenu(self)

        selected_items = self._getSelectedItems()

        if not selected_items:
                                                      
            popup.insertItem('Create Workspace', 100)
        else:
            if len(selected_items) == 1:
                if item.object.isActive():
                    popup.insertItem('Save', self._saveWorkspace)
                    popup.insertItem('Synchronize', self._syncWorkspace)
                    popup.insertItem('Close', 300)
                else:
                    popup.insertItem('Open', lambda: self._openWorkspace(item))
                    popup.insertItem('Delete', lambda: self._deleteWorkspace(item))
            
                popup.insertItem('Properties', lambda: self._showWorkspaceProperties(item))

            elif len(selected_items) > 1: 
                popup.insertItem('Delete', lambda: self._deleteWorkspaces(selected_items))
            else:
                api.devlog("ERROR: right click on an valid item (%r) which has a null object" % item)
            
        ret = popup.exec_loop(pos)
        
        api.devlog("contextMenuEvent WorkspaceItem - item: %s - ret %s" % (self.name, ret))
开发者ID:Behk,项目名称:faraday,代码行数:34,代码来源:workspacebrowser.py


示例2: _showRepositoryConfigDialog

    def _showRepositoryConfigDialog(self):

        repoconfig_dialog = RepositoryConfigDialog(self, CONF.getCouchURI(),
                                                   CONF.getCouchIsReplicated(),
                                                   CONF.getCouchReplics(),
                                                   callback=None)
        result = repoconfig_dialog.exec_loop()
        if result == qt.QDialog.Accepted:
            repourl, isReplicated, replics = repoconfig_dialog.getData()
            api.devlog("repourl = %s" % repourl)
            wm = self._main_app.getWorkspaceManager()
            if not CouchDbManager.testCouch(repourl):
                self.showPopup("""
                Repository URL Not valid, check if
                service is available and that connection string is from
                the form: http[s]://hostname:port""")
                return

            CONF.setCouchUri(repourl)
            CONF.setCouchIsReplicated(isReplicated)
            CONF.setCouchReplics(replics)
            CONF.saveConfig()

            wm.closeWorkspace()
            wm.resource()
            wm.openWorkspace('untitled')

            mwin = self._main_app.getMainWindow()
            mwin.getWorkspaceTreeView().loadAllWorkspaces()
            mwin.getWorkspaceTreeView().setDefaultWorkspace()
开发者ID:m0sth8,项目名称:faraday,代码行数:30,代码来源:mainwindow.py


示例3: _showContextMenu

    def _showContextMenu(self, item, pos, val):
        """Pop up a context menu when an item is right-clicked on the list view."""

        popup = qt.QPopupMenu(self)

        selected_items = self._getSelectedItems()

        if not selected_items:

            popup.insertItem("No action available", 100)
        else:
            if len(selected_items) == 1:
                if item.is_active:
                    popup.insertItem("No action available", 100)
                else:
                    popup.insertItem("Open", lambda: self._openWorkspace(item))
                    popup.insertItem("Delete", lambda: self._deleteWorkspace(item))

                # popup.insertItem('Properties', lambda: self._showWorkspaceProperties(item))

            elif len(selected_items) > 1:
                popup.insertItem("Delete", lambda: self._deleteWorkspaces(selected_items))
            else:
                api.devlog("ERROR: right click on an valid item (%r) which has a null object" % item)

        ret = popup.exec_loop(pos)

        api.devlog("contextMenuEvent WorkspaceItem - item: %s - ret %s" % (self.name, ret))
开发者ID:followboy1999,项目名称:faraday,代码行数:28,代码来源:workspacebrowser.py


示例4: _openWorkspace

 def _openWorkspace(self, item):
                                            
                                                                  
     api.devlog("Opening workspace %s selected on the Workspace Perspective" % item.name)
     self._getMainApp().openWorkspace(item.object.name)
                      
     self.loadAllWorkspaces()
开发者ID:Behk,项目名称:faraday,代码行数:7,代码来源:workspacebrowser.py


示例5: _delValue

    def _delValue(self, attrName, valID):
        # attribute passed as a parameter MUST BE  the name
        # of an internal attribute which is a dictionary indexed
        # with a string ID
        api.devlog("(%s)._delValue(%s, %s)" % (self, attrName, valID))
        ref = self.__getattribute__(attrName)
        api.devlog("ref.keys() = %s" % ref.keys())
        if valID in ref:
            val = ref[valID]
            del ref[valID]
            val.delete()
            return True

        hash_id = get_hash([valID])
        if hash_id in ref:
            val = ref[hash_id]
            del ref[hash_id]
            val.delete()
            return True

        for element in ref.itervalues():
            if valID == element.name:
                val = ref[element.getID()]
                del ref[element.getID()]
                val.delete()
                return True

        # none of the ids were found
        return False
开发者ID:BecomingMore,项目名称:faraday,代码行数:29,代码来源:common.py


示例6: _checkDate

    def _checkDate(self,rowdate):
        
        mret=True                              
        msave=True                
        
        if not self._lsdate:                
                                         
            if self._sdate:                     
                self._lsdate=self._sdate                                       
            else:
                self._lsdate=rowdate                                      

                                                           
        if self._cdate(self._lsdate,rowdate):
            msave=False
        
        if self._sdate:
            self._mwhere =" and updated_at > to_timestamp('"+self._sdate+"','YYYY-MM-DD HH24:MI:SS.US');"
                                                    
                                                      
                
        if msave:
            try:
                f=open(self.path,"w")
                f.write(rowdate)
                f.close()
                self._lsdate=rowdate
            except:
                api.devlog ("Can't save metasploit lastupdate file")
                return
        
        return mret
开发者ID:Behk,项目名称:faraday,代码行数:32,代码来源:plugin.py


示例7: parseOutputString

    def parseOutputString(self, output, debug=False):

        host_info = re.search(
            r"(\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b)",
            output)

        host_mac_addr = re.search(r"([\dA-F]{2}(?:[-:][\dA-F]{2}){5})", output)

        if host_info is None:
            api.devlog("No hosts detected")
        else:

            for line in output.split('\n'):
                vals = line.split("\t")

                if len(vals[0].split(".")) == 4:

                    host = vals[0]
                    h_id = self.createAndAddHost(host)
                    i_id = self.createAndAddInterface(
                        h_id, host, ipv4_address=host, mac=vals[1])
                    n_id = self.createAndAddNoteToHost(
                        h_id, "NIC VENDOR:", vals[2])

        return True
开发者ID:Sliim,项目名称:faraday,代码行数:25,代码来源:plugin.py


示例8: _doSql

 def _doSql(self, db, sql):
     try:
         api.devlog("SQL:" + sql)
         db.execute(sql)
     except Exception, e:
         print ("Error SQL[" + e.pgcode + "] - " + e.pgerror)
         return None
开发者ID:infobyte,项目名称:faraday,代码行数:7,代码来源:plugin.py


示例9: sigCHLDHandler

    def sigCHLDHandler(self, sig, frame):
        """SIGCHLD handler

        :signal: int
        :frame: frame object

        Automatically called upon SIGCHLD.

        Normally you do not need to do anything with this function but
        if your application needs to disable SIGCHLD for some time for
        reasons beyond your control, you should call this function afterwards
        to make sure that no SIGCHLDs where missed.
        """
        found = False
        # iterating the list doesn't perform any system call
        for process in self.process_list:
            if process.pid is None:
                continue
            if not process.running:
                continue
            try:
                wpid, status = os.waitpid(process.pid, os.WNOHANG)
            except OSError:
                # [Errno 10] No child processes
                # XXX: bug in process.py ?
                continue
            if wpid > 0:
                os.write(self.fd[1], struct.pack('II', wpid, status))
                devlog("sigCHLDHandler - signal = %d - wpid = %d - status = %d" % (sig, wpid, status))
                found = True
        if (not found and
            not self.old_sigCHLDHandler in (signal.SIG_IGN, signal.SIG_DFL)):
            self.old_sigCHLDHandler(sig) # call the old handler
开发者ID:0x24bin,项目名称:BurpSuite,代码行数:33,代码来源:procctrl.py


示例10: _importVulnsCvs

    def _importVulnsCvs(self,item):
        filename =  qt.QFileDialog.getOpenFileName(
                    CONF.getDefaultTempPath(),
                    "Csv vulnerability file  (*.*)",
                    None,
                    "open file dialog",
                    "Choose a vulnerability file" );
        
        if os.path.isfile(filename):
            with open(filename) as f:
                data = f.read()
            f.close()

            for l in data.split("\n"):
                api.devlog(l)
                if re.search("^#",l):
                    api.devlog("ERROR FILE")
                    continue
                
                d = l.split("|")
                
                if len(d) <=8:
                    api.log("Error vuln line: ("+l+")" )
                else:
                    self._newVulnImport(d[1],d[2],d[3],d[4],d[5],d[6],d[7])
开发者ID:diokhancze,项目名称:faraday,代码行数:25,代码来源:hostsbrowser.py


示例11: parseOutputString

    def parseOutputString(self, output, debug=False):

        host_info = re.search(r"Connected to (.+)\.", output)
        banner = re.search("220?([\w\W]+)$", output)
        if re.search("Connection timed out", output) is None and host_info is not None:
            hostname = host_info.group(1)
            ip_address = self.resolve(hostname)
            self._version = banner.groups(0) if banner else ""
            if debug:
                print ip_address

            h_id = self.createAndAddHost(ip_address)

            i_id = self.createAndAddInterface(
                h_id,
                ip_address,
                ipv4_address=ip_address,
                hostname_resolution=hostname)

            s_id = self.createAndAddServiceToInterface(
                h_id,
                i_id,
                "ftp",
                "tcp",
                ports=[self._port],
                status="open")

        if debug is True:
            api.devlog("Debug is active")

        return True
开发者ID:MrMugiwara,项目名称:faraday,代码行数:31,代码来源:plugin.py


示例12: _checkFullDelete

 def _checkFullDelete(self):
                                                     
                                                                          
                                                               
     api.devlog("Doing service checkFullDelete")
     if not self._interfaces and not self._applications:
         if self.getParent() is not None:
             self.getParent().delService(self.getID())
开发者ID:0x24bin,项目名称:BurpSuite,代码行数:8,代码来源:hosts.py


示例13: close

 def close(self, session, status, *args):
     #TODO: por alguna razon queda colgado un QSocketNotifier
     # QSocketNotifier: invalid socket 17 and type 'Read', disabling...
     # y eso cuelga la aplicacion
     api.devlog("ShellEnvironment close was called - session = %r, status = %r , *args = %r" % (session, status, args))
     if self._close_callback is not None:
         self._close_callback(self.name, self)
     else:
         api.devlog("close was call but callback is not set")
开发者ID:BecomingMore,项目名称:faraday,代码行数:9,代码来源:env.py


示例14: setPorts

 def setPorts(self, ports):
     if ports is not None:
         if isinstance(ports, (str,unicode)):
             self._ports = [int(ports)]
         elif isinstance(ports, int):
             self._ports = [ports]
         elif isinstance(ports, list):
             self._ports = [int(p) for p in ports]
         else:
             api.devlog("ports must be a string, an int o a list of any of those types")
开发者ID:BecomingMore,项目名称:faraday,代码行数:10,代码来源:hosts.py


示例15: setSavingModel

 def setSavingModel(self, value):
     api.devlog("setSavingModel: %s" % value)
     self._saving_model_flag = value
     if value:
         self._saving_model_lock.acquire()
     else:
         try:
             self._saving_model_lock.release()
         except RuntimeError:
             pass
开发者ID:followboy1999,项目名称:faraday,代码行数:10,代码来源:controller.py


示例16: _newVuln

 def _newVuln(self, item):
     api.devlog("newVuln")
     if item is not None and item.object is not None:
         vuln_web_enabled = False
         if item.object.class_signature == "Service":
             vuln_web_enabled = True
         dialog = NewVulnDialog(
             self,
             callback=self._newVulnSelectedCallback,
             vuln_web_enabled=vuln_web_enabled)
         dialog.exec_loop()
开发者ID:Exploit-install,项目名称:faraday,代码行数:11,代码来源:hostsbrowser.py


示例17: __matchesCustomPrompt

    def __matchesCustomPrompt(self, txt):
        """
        checks if the current text matches our custom prompt format
        and returns true in that case, false otherwise
        """
        if not self._custom_prompt_format:
            api.devlog("prompt format (PS1) is not defined.\nThis may cause unexpected results...")
            return False

        txt = txt.strip()
        m = self._custom_prompt_format.search(txt)
        return (m is not None)
开发者ID:BecomingMore,项目名称:faraday,代码行数:12,代码来源:env.py


示例18: _removeHost

 def _removeHost(self, host_id):
     item = self._host_items.get(host_id, None)
     if host_id in self._host_items:
         del self._host_items[host_id]
     for category in self._category_tree.keys():
         if host_id in self._category_tree.get(category):
             self._category_tree[category].remove(host_id)
             category_item = self._getCategoryListViewItem(category)
             try:
                 category_item.takeItem(item)
             except Exception:
                 api.devlog("Exception taking item from category")
开发者ID:Exploit-install,项目名称:faraday,代码行数:12,代码来源:hostsbrowser.py


示例19: do_checkin

 def do_checkin(self):
     try:
         revision_up = revision_commit = self._client.checkin(self.persistence_path,
                                               log_message="",                                        
                                               recurse=True)
         api.devlog("[SVN] revision after commit %s" % str(revision_up)[23:-2])
     except pysvn.ClientError, e:
         api.devlog("[SVN] Commit action failed: %s" % str(e))
         for message, code in e.args[1]:
             if code != 155015:
                                                                                
                 raise
开发者ID:Behk,项目名称:faraday,代码行数:12,代码来源:common.py


示例20: rename

 def rename(self, old, new):
     """
     Renames/Moves a file or folder
     """
     result = False
     try:
         self._client.move(old, new)
         result = True
         api.devlog("[SVN] moved %s to %s" % (old, new))
     except Exception:
         pass
     
     return result
开发者ID:Behk,项目名称:faraday,代码行数:13,代码来源:common.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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