def main(): if len(sys.argv) == 3: myinput = sys.argv[2] apiMethod = sys.argv[1] if apiMethod == "search": search = vFeedSearch(myinput) search.search() exit(0) if apiMethod == "export": vfeed = vFeedXML(myinput) vfeed.export() exit(0) vfeed = vFeed(myinput) try: globals()['call_%s' % apiMethod](vfeed) except: print'[error] the method %s is not implemented' % apiMethod else: exit(0) elif len(sys.argv) == 2: apiMethod = sys.argv[1] if apiMethod == "update": db = vFeedUpdate() db.update() exit(0) if apiMethod == "get_stats": stat = vFeedStats() stat.get_stats() exit(0) if apiMethod == "get_latest": stat = vFeedStats() stat.get_latest() exit(0) else: get_help() else: get_help()
def main(): if len(sys.argv) == 3: myinput = sys.argv[2] apiMethod = sys.argv[1] if apiMethod == "search": search = vFeedSearch(myinput) search.search() exit(0) if apiMethod == "export": vfeed = vFeedXML(myinput) vfeed.export() exit(0) vfeed = vFeed(myinput) try: globals()['call_%s' % apiMethod](vfeed) except: print '[error] the method %s is not implemented' % apiMethod else: exit(0) elif len(sys.argv) == 2: apiMethod = sys.argv[1] if apiMethod == "update": db = vFeedUpdate() db.update() exit(0) if apiMethod == "get_stats": stat = vFeedStats() stat.get_stats() exit(0) if apiMethod == "get_latest": stat = vFeedStats() stat.get_latest() exit(0) else: get_help() else: get_help()
def main(): if len(sys.argv) == 3: myCVE = sys.argv[2] apiMethod = sys.argv[1] if apiMethod == "export": vfeed = vFeedXML(myCVE) vfeed.export() exit(0) vfeed = vFeed(myCVE) try: globals()['call_%s' % apiMethod](vfeed) except: print'[error] the method %s is not implemented' % apiMethod else: exit(0) elif len(sys.argv) == 2: apiMethod = sys.argv[1] if apiMethod == "update": db = vFeedUpdate() db.update() exit(0) if apiMethod == "stats": stat = vFeedStats() stat.stats() exit(0) if apiMethod == "latest_cve": stat = vFeedStats() stat.latest_cve() exit(0) else: get_help() else: get_help()