X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=pygost%2Fiface.py;h=e2d6a4c89d5c9c1234726d420ecad54d8977cf57;hb=744398c0b6a3ab223d91cbf56a72932a7c87381d;hp=3fcaacdcc9feb7091a55c1f1fbc734e6165118be;hpb=34c9c9a4f95eecfee75fc36d75d2ee45d1054a25;p=pygost.git diff --git a/pygost/iface.py b/pygost/iface.py index 3fcaacd..e2d6a4c 100644 --- a/pygost/iface.py +++ b/pygost/iface.py @@ -1,20 +1,22 @@ from abc import ABCMeta from abc import abstractmethod +from pygost.utils import hexenc + # This function is taken from six package as is def add_metaclass(metaclass): """Class decorator for creating a class with a metaclass.""" def wrapper(cls): orig_vars = cls.__dict__.copy() - slots = orig_vars.get('__slots__') + slots = orig_vars.get("__slots__") if slots is not None: if isinstance(slots, str): slots = [slots] for slots_var in slots: orig_vars.pop(slots_var) - orig_vars.pop('__dict__', None) - orig_vars.pop('__weakref__', None) + orig_vars.pop("__dict__", None) + orig_vars.pop("__weakref__", None) return metaclass(cls.__name__, cls.__bases__, orig_vars) return wrapper @@ -42,7 +44,7 @@ class PEP247(object): """Return the hash value as a string containing 8-bit data. """ - @abstractmethod def hexdigest(self): """Return the hash value as a string containing hexadecimal digits. """ + return hexenc(self.digest())