예제 #1
0
파일: index.py 프로젝트: natan04/cve-search
 def listImport(self, force=None, path=None):
   _list = request.url_rule.split('/')[2]
   file = request.files['file']
   force = request.form.get('force')
   count = wl.countWhitelist() if _list.lower == 'whitelist' else bl.countBlacklist()
   if (count == 0) | (not count) | (force == "f"):
     if _list.lower == 'whitelist':
       wl.dropWhitelist()
       wl.importWhitelist(TextIOWrapper(file.stream))
     else:
       bl.dropBlacklist()
       bl.importBlacklist(TextIOWrapper(file.stream))
     status = _list[0]+"l_imported"
   else:
     status = _list[0]+"l_already_filled"
   return render_template('admin.html', status=status, **self.adminInfo())
예제 #2
0
파일: index.py 프로젝트: adulau/cve-search
 def listImport(self, force=None, path=None):
   _list = request.url_rule.split('/')[2]
   file = request.files['file']
   force = request.form.get('force')
   count = wl.countWhitelist() if _list.lower == 'whitelist' else bl.countBlacklist()
   if (count == 0) | (not count) | (force == "f"):
     if _list.lower == 'whitelist':
       wl.dropWhitelist()
       wl.importWhitelist(TextIOWrapper(file.stream))
     else:
       bl.dropBlacklist()
       bl.importBlacklist(TextIOWrapper(file.stream))
     status = _list[0]+"l_imported"
   else:
     status = _list[0]+"l_already_filled"
   return render_template('admin.html', status=status, **self.adminInfo())
예제 #3
0
def listImport():
    _list = request.url_rule.rule.split("/")[2]
    file = request.files["file"]
    force = request.form.get("force")
    count = countWhitelist() if _list.lower() == "whitelist" else countBlacklist()
    if (count == 0) | (not count) | (force == "f"):
        if _list.lower() == "whitelist":
            dropWhitelist()
            importWhitelist(file.stream)
        else:
            dropBlacklist()
            importBlacklist(file.stream)
        status = _list[0] + "l_imported"
    else:
        status = _list[0] + "l_already_filled"
    return render_template("admin.html", status=status, **adminInfo())