summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-decoratortools.spec366
-rw-r--r--sources1
3 files changed, 368 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..91be0a5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/DecoratorTools-1.8.zip
diff --git a/python-decoratortools.spec b/python-decoratortools.spec
new file mode 100644
index 0000000..9637165
--- /dev/null
+++ b/python-decoratortools.spec
@@ -0,0 +1,366 @@
+%global _empty_manifest_terminate_build 0
+Name: python-DecoratorTools
+Version: 1.8
+Release: 1
+Summary: Class, function, and metaclass decorators -- even in Python 2.3 (now with source debugging for generated code)!
+License: PSF or ZPL
+URL: http://cheeseshop.python.org/pypi/DecoratorTools
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/86/78/8de8bc5f64c125d17be429c5da33344bf1690f745f121737d5b6fbfe828c/DecoratorTools-1.8.zip
+BuildArch: noarch
+
+
+%description
+Want to use decorators, but still need to support Python 2.3? Wish you could
+have class decorators, decorate arbitrary assignments, or match decorated
+function signatures to their original functions? Want to get metaclass
+features without creating metaclasses? How about synchronized methods?
+
+"DecoratorTools" gets you all of this and more. Some quick examples::
+
+ # Method decorator example
+ from peak.util.decorators import decorate
+
+ class Demo1(object):
+ decorate(classmethod) # equivalent to @classmethod
+ def example(cls):
+ print "hello from", cls
+
+
+ # Class decorator example
+ from peak.util.decorators import decorate_class
+
+ def my_class_decorator():
+ def decorator(cls):
+ print "decorating", cls
+ return cls
+ decorate_class(decorator)
+
+ class Demo2:
+ my_class_decorator()
+
+ # "decorating <class Demo2>" will be printed when execution gets here
+
+
+Installing DecoratorTools (using ``"easy_install DecoratorTools"`` or
+``"setup.py install"``) gives you access to the ``peak.util.decorators``
+module. The tools in this module have been bundled for years inside of PEAK,
+PyProtocols, RuleDispatch, and the zope.interface package, so they have been
+widely used and tested. (Unit tests are also included, of course.)
+
+This standalone version is backward-compatible with the bundled versions, so you
+can mix and match decorators from this package with those provided by
+zope.interface, TurboGears, etc.
+
+For complete documentation, see the `DecoratorTools manual`_.
+
+Changes since version 1.7:
+
+ * The ``@template_function`` decorator now supports using a return value
+ instead of a docstring, in order to work with the "-OO" option to Python;
+ it's highly recommended that you update your template functions to use
+ a return value instead of a docstring. (The error message has also been
+ improved for the missing docstring case.)
+
+ * Fixed metaclass collisions in ``classy`` subclasses that mix in abstract
+ classes (e.g. ``collections.Sequence``) in Python 2.6+.
+
+Changes since version 1.6:
+
+ * Added ``synchronized`` decorator to support locking objects during method
+ execution.
+
+Changes since version 1.5:
+
+ * Added ``classy`` base class that allows you to do the most often-needed
+ metaclass behviors *without* needing an actual metaclass.
+
+Changes since version 1.4:
+
+ * Added ``enclosing_frame()`` function, so that complex decorators that call
+ DecoratorTools functions while being called *by* DecoratorTools functions,
+ will work correctly.
+
+Changes since version 1.3:
+
+ * Added support for debugging generated code, including the code generated
+ by ``rewrap()`` and ``template_function``.
+
+Changes since version 1.2:
+
+ * Added ``rewrap()`` function and ``template_function`` decorator to support
+ signature matching for decorated functions. (These features are similar to
+ the ones provided by Michele Simionato's "decorator" package, but do not
+ require Python 2.4 and don't change the standard idioms for creating
+ decorator functions.)
+
+ * ``decorate_class()`` will no longer apply duplicate class decorator
+ callbacks unless the ``allow_duplicates`` argument is true.
+
+Changes since version 1.1:
+
+ * Fixed a problem where instances of different struct types could equal each
+ other
+
+Changes since version 1.0:
+
+ * The ``struct()`` decorator makes it easy to create tuple-like data
+ structure types, by decorating a constructor function.
+
+.. _DecoratorTools Manual: http://peak.telecommunity.com/DevCenter/DecoratorTools#toc
+
+.. _toc:
+
+%package -n python3-DecoratorTools
+Summary: Class, function, and metaclass decorators -- even in Python 2.3 (now with source debugging for generated code)!
+Provides: python-DecoratorTools
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-DecoratorTools
+Want to use decorators, but still need to support Python 2.3? Wish you could
+have class decorators, decorate arbitrary assignments, or match decorated
+function signatures to their original functions? Want to get metaclass
+features without creating metaclasses? How about synchronized methods?
+
+"DecoratorTools" gets you all of this and more. Some quick examples::
+
+ # Method decorator example
+ from peak.util.decorators import decorate
+
+ class Demo1(object):
+ decorate(classmethod) # equivalent to @classmethod
+ def example(cls):
+ print "hello from", cls
+
+
+ # Class decorator example
+ from peak.util.decorators import decorate_class
+
+ def my_class_decorator():
+ def decorator(cls):
+ print "decorating", cls
+ return cls
+ decorate_class(decorator)
+
+ class Demo2:
+ my_class_decorator()
+
+ # "decorating <class Demo2>" will be printed when execution gets here
+
+
+Installing DecoratorTools (using ``"easy_install DecoratorTools"`` or
+``"setup.py install"``) gives you access to the ``peak.util.decorators``
+module. The tools in this module have been bundled for years inside of PEAK,
+PyProtocols, RuleDispatch, and the zope.interface package, so they have been
+widely used and tested. (Unit tests are also included, of course.)
+
+This standalone version is backward-compatible with the bundled versions, so you
+can mix and match decorators from this package with those provided by
+zope.interface, TurboGears, etc.
+
+For complete documentation, see the `DecoratorTools manual`_.
+
+Changes since version 1.7:
+
+ * The ``@template_function`` decorator now supports using a return value
+ instead of a docstring, in order to work with the "-OO" option to Python;
+ it's highly recommended that you update your template functions to use
+ a return value instead of a docstring. (The error message has also been
+ improved for the missing docstring case.)
+
+ * Fixed metaclass collisions in ``classy`` subclasses that mix in abstract
+ classes (e.g. ``collections.Sequence``) in Python 2.6+.
+
+Changes since version 1.6:
+
+ * Added ``synchronized`` decorator to support locking objects during method
+ execution.
+
+Changes since version 1.5:
+
+ * Added ``classy`` base class that allows you to do the most often-needed
+ metaclass behviors *without* needing an actual metaclass.
+
+Changes since version 1.4:
+
+ * Added ``enclosing_frame()`` function, so that complex decorators that call
+ DecoratorTools functions while being called *by* DecoratorTools functions,
+ will work correctly.
+
+Changes since version 1.3:
+
+ * Added support for debugging generated code, including the code generated
+ by ``rewrap()`` and ``template_function``.
+
+Changes since version 1.2:
+
+ * Added ``rewrap()`` function and ``template_function`` decorator to support
+ signature matching for decorated functions. (These features are similar to
+ the ones provided by Michele Simionato's "decorator" package, but do not
+ require Python 2.4 and don't change the standard idioms for creating
+ decorator functions.)
+
+ * ``decorate_class()`` will no longer apply duplicate class decorator
+ callbacks unless the ``allow_duplicates`` argument is true.
+
+Changes since version 1.1:
+
+ * Fixed a problem where instances of different struct types could equal each
+ other
+
+Changes since version 1.0:
+
+ * The ``struct()`` decorator makes it easy to create tuple-like data
+ structure types, by decorating a constructor function.
+
+.. _DecoratorTools Manual: http://peak.telecommunity.com/DevCenter/DecoratorTools#toc
+
+.. _toc:
+
+%package help
+Summary: Development documents and examples for DecoratorTools
+Provides: python3-DecoratorTools-doc
+%description help
+Want to use decorators, but still need to support Python 2.3? Wish you could
+have class decorators, decorate arbitrary assignments, or match decorated
+function signatures to their original functions? Want to get metaclass
+features without creating metaclasses? How about synchronized methods?
+
+"DecoratorTools" gets you all of this and more. Some quick examples::
+
+ # Method decorator example
+ from peak.util.decorators import decorate
+
+ class Demo1(object):
+ decorate(classmethod) # equivalent to @classmethod
+ def example(cls):
+ print "hello from", cls
+
+
+ # Class decorator example
+ from peak.util.decorators import decorate_class
+
+ def my_class_decorator():
+ def decorator(cls):
+ print "decorating", cls
+ return cls
+ decorate_class(decorator)
+
+ class Demo2:
+ my_class_decorator()
+
+ # "decorating <class Demo2>" will be printed when execution gets here
+
+
+Installing DecoratorTools (using ``"easy_install DecoratorTools"`` or
+``"setup.py install"``) gives you access to the ``peak.util.decorators``
+module. The tools in this module have been bundled for years inside of PEAK,
+PyProtocols, RuleDispatch, and the zope.interface package, so they have been
+widely used and tested. (Unit tests are also included, of course.)
+
+This standalone version is backward-compatible with the bundled versions, so you
+can mix and match decorators from this package with those provided by
+zope.interface, TurboGears, etc.
+
+For complete documentation, see the `DecoratorTools manual`_.
+
+Changes since version 1.7:
+
+ * The ``@template_function`` decorator now supports using a return value
+ instead of a docstring, in order to work with the "-OO" option to Python;
+ it's highly recommended that you update your template functions to use
+ a return value instead of a docstring. (The error message has also been
+ improved for the missing docstring case.)
+
+ * Fixed metaclass collisions in ``classy`` subclasses that mix in abstract
+ classes (e.g. ``collections.Sequence``) in Python 2.6+.
+
+Changes since version 1.6:
+
+ * Added ``synchronized`` decorator to support locking objects during method
+ execution.
+
+Changes since version 1.5:
+
+ * Added ``classy`` base class that allows you to do the most often-needed
+ metaclass behviors *without* needing an actual metaclass.
+
+Changes since version 1.4:
+
+ * Added ``enclosing_frame()`` function, so that complex decorators that call
+ DecoratorTools functions while being called *by* DecoratorTools functions,
+ will work correctly.
+
+Changes since version 1.3:
+
+ * Added support for debugging generated code, including the code generated
+ by ``rewrap()`` and ``template_function``.
+
+Changes since version 1.2:
+
+ * Added ``rewrap()`` function and ``template_function`` decorator to support
+ signature matching for decorated functions. (These features are similar to
+ the ones provided by Michele Simionato's "decorator" package, but do not
+ require Python 2.4 and don't change the standard idioms for creating
+ decorator functions.)
+
+ * ``decorate_class()`` will no longer apply duplicate class decorator
+ callbacks unless the ``allow_duplicates`` argument is true.
+
+Changes since version 1.1:
+
+ * Fixed a problem where instances of different struct types could equal each
+ other
+
+Changes since version 1.0:
+
+ * The ``struct()`` decorator makes it easy to create tuple-like data
+ structure types, by decorating a constructor function.
+
+.. _DecoratorTools Manual: http://peak.telecommunity.com/DevCenter/DecoratorTools#toc
+
+.. _toc:
+
+%prep
+%autosetup -n DecoratorTools-1.8
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-DecoratorTools -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Thu May 18 2023 Python_Bot <Python_Bot@openeuler.org> - 1.8-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..f12e8bf
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+f161004115c3d04ed976c230c8a91d87 DecoratorTools-1.8.zip