Commit 8028ec6d authored by PidgeyL's avatar PidgeyL
Browse files

review imports

parent 8cab04d2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ import re

from optparse import OptionParser

from lib.Query import lastentries, apigetcve, apibrowse, apisearch
from lib.Query import apigetcve

optp = OptionParser()
optp.add_option('-c', '--cve', dest='cve', default='CVE-2015-0001', help='CVE id to convert')
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ def bulkvFeedUpdate(dbpath, vfeedmap):
        else:
          icveid = names.index("cveid")
      except Exception as ex:
        sys.exit('Exeption in %s: %s' % (vmap, ex))
        print('Exeption in %s: %s' % (vmap, ex))
        continue
      mapArray={}
      for i in range(0,len(r)):
+1 −3
Original line number Diff line number Diff line
@@ -18,8 +18,6 @@ import importlib
import lib.DatabaseLayer as db
from lib.Config import Configuration as conf
from lib.Config import ConfigReader
from lib.Plugins import Plugin, WebPlugin
from flask_login import current_user

class PluginManager():
  def __init__(self):
@@ -180,7 +178,7 @@ class PluginManager():
        return ("error.html", {'status': {'except': 'plugin-not-webplugin'}})
    return ("error.html", {'status': {'except': 'plugin-not-loaded'}})

  def openSubpage(self, subpage, **args):
  def openSubpage(self, name, subpage, **args):
    if name.strip() in self.plugins.keys(): # Check if plugin exists
      if self.plugins[name].isWebPlugin():  # Check if plugin is web plugin
        pageInfo = self.plugins[name].getSubpage(subpage, **args)
+1 −12
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@
# Copyright (c) 2014-2016 	Pieter-Jan Moreels - pieterjan.moreels@gmail.com

# Imports
from datetime import datetime
from dateutil import tz
import dateutil.parser
import re
@@ -62,7 +61,7 @@ def impactScore(cve):
      A=((cve['impact'])['availability']).upper()
      res = 10.41*(1-(1-score[C])*(1-score[I])*(1-score[A]))
      return 10.0 if res > 10.0 else res
    except Exception as ex:
    except:
      return '-'

def exploitabilityScore(cve):
@@ -100,16 +99,6 @@ def vFeedName(string):
    string=string.replace('cve_','')
    return string.title()

def convertDateToDBFormat(string):
    valid_formats = ['%d-%m-%y', '%d/%m/%Y', '%d/%m/%y', '%Y-%m-%d']
    result = None
    for valid_format in valid_formats:
        try:
            result = datetime.strptime(string, valid_format)
        except ValueError:
            continue
    return result

def mergeSearchResults(database, plugins):
    if 'errors' in database:
        results = {'data':[], 'errors':database['errors']}
+0 −1
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@ runPath = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(runPath, ".."))

import json
import re

from lib.Toolkit import toStringFormattedCPE
import lib.DatabaseLayer as db
Loading