and more...

This commit is contained in:
j 2014-05-13 01:43:27 +02:00
commit 0c18dad1b5
20 changed files with 293 additions and 146 deletions

View file

@ -1,12 +1,23 @@
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
from __future__ import division
import base64
import hashlib
import os
import ox
import pdf
import epub
import txt
import os
import base64
import ox
def get_id(f):
return base64.b32encode(ox.sha1sum(f).decode('hex'))
def get_id(f=None, data=None):
if data:
return base64.b32encode(hashlib.sha1(data).digest())
else:
return base64.b32encode(ox.sha1sum(f).decode('hex'))
def metadata(f):
ext = f.split('.')[-1]