コード例 #1
0
def getMongoDB():
    conn = ReplicaSetConnection(
        "192.168.5.60:27017,192.168.7.52:27017,192.168.5.156:27017",
        replicaSet='ats_rs')
    conn.read_preference = ReadPreference.SECONDARY_PREFERRED
    db = conn['bugreporter']
    collection = db['original_data']
    return collection
コード例 #2
0
ファイル: GEOvector.py プロジェクト: JohnCEarls/trends
    @classmethod
    def loadGlobal(cls, filename):
        """
        Loads a previously created global_storage file
        """
        import json
        f = open(filename, 'r')
        cls.global_storage = json.load(f)
        f.close()
 
if __name__ == "__main__":
    import json
    from pymongo import ReplicaSetConnection, ReadPreference
    connection = ReplicaSetConnection("clutch:27017",  replicaSet="geo")

    connection.read_preference = ReadPreference.SECONDARY
    

    f = open("words.json",'r')
    word_dict = json.loads(f.read())
    f.close()
    #GEOvector.loadGlobal("gv_test.json" )     

    gv = GEOvector('GSE2395',word_dict, mongo_conn=connection, cache=False)

    print gv.getSparse()
    print "1"
    print sum(gv)
    print sum(gv)
    sadfjkl = raw_input('What is your name? ')
    for x in gv:
コード例 #3
0
ファイル: brstore.py プロジェクト: liuct/bugquery-lt
 def getConn(self):
     #return Connection('192.168.7.201',27017)
     conn=ReplicaSetConnection("192.168.5.60:27017,192.168.7.52:27017,192.168.5.156:27017", replicaSet='ats_rs')
     conn.read_preference = ReadPreference.SECONDARY_PREFERRED
     return conn
コード例 #4
0
 def getDB(self):        
     #return Connection('192.168.7.201',27017)['bugreporter']
     #return Connection('localhost',27017)['bugreporter']
     conn=ReplicaSetConnection("192.168.5.60:27017,192.168.7.52:27017,192.168.5.156:27017", replicaSet='ats_rs')
     conn.read_preference = ReadPreference.SECONDARY_PREFERRED
     return conn['bugreporter']
コード例 #5
0
ファイル: brconfig.py プロジェクト: liuct/bugquery-lt
def getMongoDB():
    conn=ReplicaSetConnection("192.168.5.60:27017,192.168.7.52:27017,192.168.5.156:27017", replicaSet='ats_rs')
    conn.read_preference = ReadPreference.SECONDARY_PREFERRED
    db = conn['bugreporter']
    collection = db['original_data']
    return collection