示例#1
0
文件: utils.py 项目: 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
示例#2
0
文件: showdata.py 项目: Frish/ntfs
import pycabinet
import os, sys

p = sys.argv[1]
dbname = pycabinet.get('hashkey.tch', p)
data = pycabinet.list('data/1/%s.tch' % dbname)

print "\n".join(data)
示例#3
0
文件: ntdata.py 项目: Frish/ntfs
 def __getitem__(self, k):
     if len(self.datapath) == 1:
         return safefloat(pycabinet.get(self.datapath[0], k))
     return [safefloat(pycabinet.get(db, k)) for db in self.datapath]
示例#4
0
文件: ntdata.py 项目: Frish/ntfs
 def __getitem__(self,k):
     if len(self.datapath)==1:
         return safefloat(pycabinet.get(self.datapath[0],k))
     return [safefloat(pycabinet.get(db,k)) for db in self.datapath]
示例#5
0
文件: showdata.py 项目: Frish/ntfs
import pycabinet
import os,sys

p = sys.argv[1]
dbname = pycabinet.get('hashkey.tch',p)
data = pycabinet.list('data/1/%s.tch' % dbname)

print "\n".join(data)