Commit ede99dd6 authored by Alexandre Dulaunoy's avatar Alexandre Dulaunoy
Browse files

Merge pull request #66 from adulau/master

Enhanced output of the web admin part
parents 22cd2d53 d843d700
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -207,7 +207,8 @@ if __name__ == '__main__':
        i = info.find_one({'db': 'cve'})
        if i is not None:
            if f.headers['last-modified'] == i['last-modified']:
                sys.exit("Not modified")
                print("Not modified")
                sys.exit(0)
        info.update({'db': 'cve'}, {"$set": {'last-modified': f.headers['last-modified']}}, upsert=True)

        # get your parser on !!
+2 −1
Original line number Diff line number Diff line
@@ -174,7 +174,8 @@ except:
i = info.find_one({'db': 'capec'})
if i is not None:
    if f.headers['last-modified'] == i['last-modified']:
        sys.exit("Not modified")
        print("Not modified")
        sys.exit(0)
# parse xml and store in database
parser.parse(f)
bulk = capec.initialize_ordered_bulk_op()
+2 −1
Original line number Diff line number Diff line
@@ -88,7 +88,8 @@ except:
i = info.find_one({'db': 'cpe'})
if i is not None:
    if f.headers['last-modified'] == i['last-modified']:
        sys.exit("Not modified")
        print("Not modified")
        sys.exit(0)
# parse xml and store in database
parser.parse(f)
bulk = cpe.initialize_ordered_bulk_op()
+2 −1
Original line number Diff line number Diff line
@@ -50,7 +50,8 @@ date = False
if icve is not None and icpeo is not None:
    # Go check date
    if icve['last-modified'] >= icpeo['last-modified']:
        sys.exit("Not modified")
        print("Not modified")
        sys.exit(0)
    else:
        date = True

+2 −1
Original line number Diff line number Diff line
@@ -91,7 +91,8 @@ lastmodified = f.headers['last-modified']
i = info.find_one({'db': 'cwe'})
if i is not None:
    if f.headers['last-modified'] == i['last-modified']:
        sys.exit("Not modified")
        print("Not modified")
        sys.exit(0)

# preparing xml by saving in a tempfile and unzipping
tmpdir = tempfile.gettempdir()
Loading