7a73b8ef627f3ae64bd38c3b4b403e3196cea290,search_xmpp.py,,,#,21

Before Change


    raw_input = input

// config
Config = configparser.ConfigParser()
Config.read(os.path.join(runPath, "./configuration.ini"))
// default config
mongoHost = "localhost"
mongoPort = 27017
mongoDB = "cvedb"
// read config from file
if ("Host" in Config["Mongo"]) and (Config.get("Mongo", "Host")!=""):
    mongoHost = Config.get("Mongo", "Host")
if ("Port" in Config["Mongo"]) and (Config.get("Mongo", "Port")!=""):
    mongoPort = int(Config.get("Mongo", "Port"))
if ("DB" in Config["Mongo"]) and (Config.get("Mongo", "DB")!=""):
    mongoDB = Config.get("Mongo", "DB")

rankinglookup = True

connect = pymongo.MongoClient(mongoHost,mongoPort)
db = connect[mongoDB]
collection = db.cves

helpmessage = "\nlast <n> cve entries (output: JSON) \n"
helpmessage = helpmessage + "cvetweet <n> cve entries (output: Text) \n"

After Change



rankinglookup = True

db = Configuration.getMongoConnection()
collection = db.cves

helpmessage = "\nlast <n> cve entries (output: JSON) \n"
helpmessage = helpmessage + "cvetweet <n> cve entries (output: Text) \n"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 56

Instances


Project Name: cve-search/cve-search
Commit Name: 7a73b8ef627f3ae64bd38c3b4b403e3196cea290
Time: 2015-01-22
Author: pieterjan.moreels@gmail.com
File Name: search_xmpp.py
Class Name:
Method Name:


Project Name: cve-search/cve-search
Commit Name: 7a73b8ef627f3ae64bd38c3b4b403e3196cea290
Time: 2015-01-22
Author: pieterjan.moreels@gmail.com
File Name: db_mgmt_admin.py
Class Name:
Method Name:


Project Name: cve-search/cve-search
Commit Name: 7a73b8ef627f3ae64bd38c3b4b403e3196cea290
Time: 2015-01-22
Author: pieterjan.moreels@gmail.com
File Name: search_xmpp.py
Class Name:
Method Name:


Project Name: cve-search/cve-search
Commit Name: 7a73b8ef627f3ae64bd38c3b4b403e3196cea290
Time: 2015-01-22
Author: pieterjan.moreels@gmail.com
File Name: db_ranking.py
Class Name:
Method Name: