예제 #1
0
파일: vfeedcli.py 프로젝트: Debug-Orz/vFeed
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() 
예제 #2
0
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()
예제 #3
0
파일: vfeedcli.py 프로젝트: GovReady/vFeed
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()