wownero-python/tests/utils.py
Maciej "RooTer" Urbański 12e69da496 continuous integration goodies from rooterkyberian (#26)
* continuous integration goodies

* fixed test_address not running

* fixup `python setup.py test`

* fixup readme.rst formatting
2018-06-12 13:09:35 +02:00

14 lines
407 B
Python

class ClassPropertyDescriptor(object):
"""Based on https://stackoverflow.com/questions/5189699/how-to-make-a-class-property"""
def __init__(self, fget):
self.fget = fget
def __get__(self, obj, klass):
if klass is None:
klass = type(obj)
return self.fget.__get__(obj, klass)()
def classproperty(func):
return ClassPropertyDescriptor(classmethod(func))