Esempio n. 1
0
File: ntdata.py Progetto: Frish/ntfs
 def save(self):
     for k,v in self.data.items():
         if len(self.datapath)==1:
             pycabinet.put(self.datapath[0],str(k),str(v))
         else:
             for db in self.datapath:
                 pycabinet.put(db,str(k),str(v))
Esempio n. 2
0
File: ntdata.py Progetto: Frish/ntfs
 def save(self):
     for k, v in self.data.items():
         if len(self.datapath) == 1:
             pycabinet.put(self.datapath[0], str(k), str(v))
         else:
             for db in self.datapath:
                 pycabinet.put(db, str(k), str(v))
Esempio n. 3
0
File: utils.py Progetto: Frish/ntfs
def genkey(s):
    hashdb = safetch('hashkey.tch')
    key = pycabinet.get(hashdb,s)
    if key==None:
        key=ntsha1(s)
        pycabinet.put(hashdb,s,key)
    fname = safetch( "%s.tch" % key, autodir(s) )
    return key
Esempio n. 4
0
import pycabinet

db = 'my.tcb'
print "create db", db
pycabinet.create(db)
pycabinet.put2(db, 'yanxu', '123')
pycabinet.put2(db, 'yanxu', '456')
print pycabinet.list2(db)

db = 'my.tch'
print "create db", db
pycabinet.create(db)
pycabinet.put(db, 'yanxu', '123')
pycabinet.put(db, 'qingfeng', '456')
print pycabinet.list(db)
print "out key yanxu:"
pycabinet.out(db, 'yanxu')
print pycabinet.list(db)
Esempio n. 5
0
import pycabinet

db = "my.tcb"
print "create db", db
pycabinet.create(db)
pycabinet.put2(db, "yanxu", "123")
pycabinet.put2(db, "yanxu", "456")
print pycabinet.list2(db)

db = "my.tch"
print "create db", db
pycabinet.create(db)
pycabinet.put(db, "yanxu", "123")
pycabinet.put(db, "qingfeng", "456")
print pycabinet.list(db)
print "out key yanxu:"
pycabinet.out(db, "yanxu")
print pycabinet.list(db)