From 5d0970ef11c79c4f82de8c8ebbe9323c6f1872ac Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 2 Jun 2022 21:32:22 -0400 Subject: [PATCH] Use @property decorator to satisfy intersphinx. Ref #21. Workaround for sphinx-doc/sphinx#10514 --- cssutils/css/cssstylesheet.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cssutils/css/cssstylesheet.py b/cssutils/css/cssstylesheet.py index e4bf0727..f82537ed 100644 --- a/cssutils/css/cssstylesheet.py +++ b/cssutils/css/cssstylesheet.py @@ -131,7 +131,13 @@ def _getUsedURIs(self): useduris.update(r2.selectorList._getUsedUris()) return useduris - def _setCssRules(self, cssRules): + @property + def cssRules(self): + "All Rules in this style sheet, a :class:`~cssutils.css.CSSRuleList`." + return self._cssRules + + @cssRules.setter + def cssRules(self, cssRules): "Set new cssRules and update contained rules refs." cssRules.append = self.insertRule cssRules.extend = self.insertRule @@ -142,12 +148,6 @@ def _setCssRules(self, cssRules): self._cssRules = cssRules - cssRules = property( - lambda self: self._cssRules, - _setCssRules, - "All Rules in this style sheet, a " ":class:`~cssutils.css.CSSRuleList`.", - ) - def _getCssText(self): "Textual representation of the stylesheet (a byte string)." return cssutils.ser.do_CSSStyleSheet(self)