removed support for multiple interpreters
This commit is contained in:
parent
e2e839fe6f
commit
c0c4f4f56e
25
__init__.py
25
__init__.py
@ -38,7 +38,6 @@ import hmac
|
||||
import logging
|
||||
import os
|
||||
from functools import partial
|
||||
import sys
|
||||
import time
|
||||
|
||||
|
||||
@ -58,8 +57,6 @@ except ImportError:
|
||||
__DESCRIPTION__ = """The Module {\\tt %s} is designed to help on all issues with files and folders.
|
||||
For more Information read the documentation.""" % __name__.replace('_', '\\_')
|
||||
"""The Module Description"""
|
||||
__INTERPRETER__ = (3, )
|
||||
"""The Tested Interpreter-Versions"""
|
||||
|
||||
|
||||
def dirlist(path='.', expression='*', rekursive=True):
|
||||
@ -277,12 +274,8 @@ def uid(path, max_staleness=3600):
|
||||
fake_mtime) # trick to workaround file system / platform
|
||||
# limitations causing permanent trouble
|
||||
)
|
||||
if sys.version_info < (3, 0):
|
||||
secret = ''
|
||||
return hmac.new(secret, repr(uid), hashlib.sha1).hexdigest()
|
||||
else:
|
||||
secret = b''
|
||||
return hmac.new(secret, bytes(repr(uid), 'latin-1'), hashlib.sha1).hexdigest()
|
||||
secret = b''
|
||||
return hmac.new(secret, bytes(repr(uid), 'latin-1'), hashlib.sha1).hexdigest()
|
||||
|
||||
|
||||
def uid_filelist(path='.', expression='*', rekursive=True):
|
||||
@ -309,14 +302,10 @@ def uid_filelist(path='.', expression='*', rekursive=True):
|
||||
fl = filelist(path, expression, rekursive)
|
||||
fl.sort()
|
||||
for f in fl:
|
||||
if sys.version_info < (3, 0):
|
||||
with open(f, 'rb') as fh:
|
||||
SHAhash.update(hashlib.md5(fh.read()).hexdigest())
|
||||
else:
|
||||
with open(f, mode='rb') as fh:
|
||||
d = hashlib.md5()
|
||||
for buf in iter(partial(fh.read, 128), b''):
|
||||
d.update(buf)
|
||||
SHAhash.update(d.hexdigest().encode())
|
||||
with open(f, mode='rb') as fh:
|
||||
d = hashlib.md5()
|
||||
for buf in iter(partial(fh.read, 128), b''):
|
||||
d.update(buf)
|
||||
SHAhash.update(d.hexdigest().encode())
|
||||
#
|
||||
return SHAhash.hexdigest()
|
||||
|
Loading…
x
Reference in New Issue
Block a user