Commit 03399001 authored by PidgeyL's avatar PidgeyL
Browse files

satisfy pyflakes

parent 52b1597c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ import argparse
import json
from bson import json_util

from lib import CVEs
import lib.CVEs as cves
from lib.Config import Configuration

# connect to db
@@ -40,7 +40,7 @@ rankinglookup = args.r
vfeedlookup = args.v
capeclookup = args.c

l = CVEs.last(rankinglookup=rankinglookup, vfeedlookup=vfeedlookup, capeclookup=capeclookup)
l = cves.last(rankinglookup=rankinglookup, vfeedlookup=vfeedlookup, capeclookup=capeclookup)

for cveid in dumpallcveid():
    item = l.getcve(cveid=cveid)
+4 −4
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ import time
import datetime
import argparse

import lib.CVEs
import lib.CVEs as cves

argParser = argparse.ArgumentParser(description='Dump last CVE entries in RSS/Atom format or in HTML tables')
argParser.add_argument('-f', type=str, help='Output format (rss1,rss2,atom,html)', default='rss1')
@@ -35,7 +35,7 @@ else:
    last = 10

ref = "http://adulau.github.com/cve-search/"
cves = CVEs.last(rankinglookup=args.r, namelookup=args.n, capeclookup=args.c)
cvelist = cves.last(rankinglookup=args.r, namelookup=args.n, capeclookup=args.c)

if not(args.f == "html"):
    from feedformatter import Feed
@@ -50,7 +50,7 @@ else:
    print ("<style>.cve table { border-collapse: collapse; text-align: left; width: 100%; } .cve {font: normal 12px/150% Geneva, Arial, Helvetica, sans-serif; background: #fff; overflow: hidden; border: 1px solid #006699; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; }.cve table td, .cve table th { padding: 3px 10px; }.cve table tbody td { color: #00496B; border-left: 1px solid #E1EEF4;font-size: 12px;font-weight: normal; }.cve table tbody .alt td { background: #E1EEF4; color: #00496B; }.cve table tbody td:first-child { border-left: none; }.cve table tbody tr:last-child td { border-bottom: none; }.cve table tfoot td div { border-top: 1px solid #006699;background: #E1EEF4;} .cve table tfoot td { padding: 0; font-size: 12px } .cve table tfoot td div{ padding: 0px; }</style>")
    print ("<title>Last " + str(args.l) + " CVE entries</title>")
    print ("</head><body>")
for x in cves.get(limit=last):
for x in cvelist.get(limit=last):
    if not(args.f == "html"):
        if args.r:
            if "ranking" not in x:
@@ -82,7 +82,7 @@ for x in cves.get(limit=last):
        print ("<tr><td>Vulnerable configuration:</td></tr>")
        print ("<tr><td><ul>")
        for v in x['vulnerable_configuration']:
            sys.stdout.write("<li>" + cves.getcpe(v) + "</li>")
            sys.stdout.write("<li>" + cvelist.getcpe(v) + "</li>")
        print ("</ul></td></tr>")
        if args.r:
            print ("<tr><td>Ranking:" + str(x['ranking']) + "</td></tr>")