removed support for multiple interpreters

This commit is contained in:
Dirk Alders 2025-08-17 14:32:55 +02:00
parent e2e839fe6f
commit c0c4f4f56e

View File

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