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


Python HistoryItem.updateTag方法代码示例

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


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

示例1: _impactDone

# 需要导入模块: from core.data.db.history import HistoryItem [as 别名]
# 或者: from core.data.db.history.HistoryItem import updateTag [as 别名]
 def _impactDone(self, event, impact):
     # Keep calling this from timeout_add until isSet
     if not event.isSet():
         return True
     # We stop the throbber, and hide it
     self.throbber.hide()
     self.throbber.running(False)
     # Analyze the impact
     if impact.ok:
         #   Lets check if we found any vulnerabilities
         #
         #   TODO: I should actually show ALL THE REQUESTS generated by audit plugins...
         #               not just the ones with vulnerabilities.
         #
         for result in impact.result:
             for itemId in result.getId():
                 historyItem = HistoryItem()
                 historyItem.load(itemId)
                 historyItem.updateTag(historyItem.tag + result.plugin_name)
                 historyItem.info = result.getDesc()
                 historyItem.save()
     else:
         if impact.exception.__class__ == w3afException:
             msg = str(impact.exception)
         elif impact.exception.__class__ == w3afMustStopException:
             msg = "Stopped sending requests because " + str(impact.exception)
         else:
             raise impact.exception
         # We stop the throbber, and hide it
         self.throbber.hide()
         self.throbber.running(False)
         gtk.gdk.threads_enter()
         helpers.friendlyException(msg)
         gtk.gdk.threads_leave()
     return False
开发者ID:adambaldwin2,项目名称:test,代码行数:37,代码来源:reqResViewer.py

示例2: test_find

# 需要导入模块: from core.data.db.history import HistoryItem [as 别名]
# 或者: from core.data.db.history.HistoryItem import updateTag [as 别名]
 def test_find(self):
     find_id = random.randint(1, 499)
     url = url_object('http://w3af.org/a/b/foobar.php?foo=123')
     tag_value = createRandAlNum(10)
     for i in xrange(0, 500):
         fr = FuzzReq(url, dc={'a': ['1']})
         code = 200
         if i == find_id:
             code = 302
         res = httpResponse(code, '<html>',{'Content-Type':'text/html'}, url, url)
         h1 = HistoryItem()
         h1.request = fr
         res.setId(i)
         h1.response = res
         if i == find_id:
             h1.toggleMark()
             h1.updateTag(tag_value)
         h1.save()
     h2 = HistoryItem()
     self.assertEqual(len(h2.find([('tag', "%"+tag_value+"%", 'like')])), 1)
     self.assertEqual(len(h2.find([('code', 302, '=')])), 1)
     self.assertEqual(len(h2.find([('mark', 1, '=')])), 1)
     self.assertEqual(len(h2.find([('has_qs', 1, '=')])), 500)
     self.assertEqual(len(h2.find([('has_qs', 1, '=')], resultLimit=10)), 10)
     results = h2.find([('has_qs', 1, '=')], resultLimit=1, orderData=[('id','desc')])
     self.assertEqual(results[0].id, 499)
     search_data = []
     search_data.append(('id', find_id + 1, "<"))
     search_data.append(('id', find_id - 1, ">"))
     self.assertEqual(len(h2.find(search_data)), 1)
开发者ID:1d3df9903ad,项目名称:w3af,代码行数:32,代码来源:test_history.py

示例3: editTag

# 需要导入模块: from core.data.db.history import HistoryItem [as 别名]
# 或者: from core.data.db.history.HistoryItem import updateTag [as 别名]
 def editTag(self, cell, path, new_text, model):
     """Edit tag."""
     model[path][4] = new_text
     historyItem = HistoryItem()
     historyItem.load(model[path][0])
     historyItem.updateTag(new_text, True)
     return
开发者ID:1d3df9903ad,项目名称:w3af,代码行数:9,代码来源:httpLogTab.py

示例4: test_tag

# 需要导入模块: from core.data.db.history import HistoryItem [as 别名]
# 或者: from core.data.db.history.HistoryItem import updateTag [as 别名]
    def test_tag(self):
        tag_id = random.randint(501, 999)
        tag_value = createRandAlNum(10)
        url = url_object('http://w3af.org/a/b/c.php')

        for i in xrange(501, 1000):
            fr = FuzzReq(url, dc={'a': ['1']})
            res = httpResponse(200, '<html>',{'Content-Type':'text/html'}, url, url)
            h1 = HistoryItem()
            h1.request = fr
            res.setId(i)
            h1.response = res
            if i == tag_id:
                h1.updateTag(tag_value)
            h1.save()

        h2 = HistoryItem()
        h2.load(tag_id)
        self.assertEqual(h2.tag, tag_value)
开发者ID:1d3df9903ad,项目名称:w3af,代码行数:21,代码来源:test_history.py


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