本文整理匯總了Python中Tardis.Util.recordMetaData方法的典型用法代碼示例。如果您正苦於以下問題:Python Util.recordMetaData方法的具體用法?Python Util.recordMetaData怎麽用?Python Util.recordMetaData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tardis.Util
的用法示例。
在下文中一共展示了Util.recordMetaData方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: generateMetadata
# 需要導入模塊: from Tardis import Util [as 別名]
# 或者: from Tardis.Util import recordMetaData [as 別名]
def generateMetadata(db, cacheDir):
conn = db.conn
r = conn.execute("SELECT COUNT(*) FROM CheckSums WHERE IsFile = 1")
n = r.fetchone()[0]
c = conn.cursor()
r = c.execute("SELECT Checksum, Size, Compressed, Encrypted, DiskSize, Basis FROM Checksums WHERE IsFile = 1 ORDER BY CheckSum")
metas = 0
logger.info("Generating metadata/recovery info for %d files", n)
with progressbar.ProgressBar(max_value=int(n)) as bar:
batch = r.fetchmany(4096)
while batch:
for row in batch:
# recordMetaData(cache, checksum, size, compressed, encrypted, disksize, basis=None, logger=None):
Util.recordMetaData(cacheDir, row[0], row[1], row[2], row[3], row[4], basis=row[5], logger=logger)
metas += 1
bar.update(metas)
batch = r.fetchmany(4096)