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)