diff --git a/cssutils/css/csscharsetrule.py b/cssutils/css/csscharsetrule.py index aedd5e52..62ec2e19 100644 --- a/cssutils/css/csscharsetrule.py +++ b/cssutils/css/csscharsetrule.py @@ -147,7 +147,7 @@ def _setEncoding(self, encoding): or self._prods.IDENT != self._type(encodingtoken) ): self._log.error( - 'CSSCharsetRule: Syntax Error in encoding value ' '%r.' % encoding + 'CSSCharsetRule: Syntax Error in encoding value %r.' % encoding ) else: try: @@ -167,7 +167,7 @@ def _setEncoding(self, encoding): type = property( lambda self: self.CHARSET_RULE, - doc="The type of this rule, as defined by a CSSRule " "type constant.", + doc="The type of this rule, as defined by a CSSRule type constant.", ) wellformed = property(lambda self: bool(self.encoding)) diff --git a/cssutils/css/csscomment.py b/cssutils/css/csscomment.py index 408afb11..ae33cd92 100644 --- a/cssutils/css/csscomment.py +++ b/cssutils/css/csscomment.py @@ -85,7 +85,7 @@ def _setCssText(self, cssText): type = property( lambda self: self.COMMENT, - doc="The type of this rule, as defined by a CSSRule " "type constant.", + doc="The type of this rule, as defined by a CSSRule type constant.", ) # constant but needed: diff --git a/cssutils/css/cssfontfacerule.py b/cssutils/css/cssfontfacerule.py index b56f722b..7be1bc2a 100644 --- a/cssutils/css/cssfontfacerule.py +++ b/cssutils/css/cssfontfacerule.py @@ -149,7 +149,7 @@ def _setCssText(self, cssText): cssText = property( _getCssText, _setCssText, - doc="(DOM) The parsable textual representation of this " "rule.", + doc="(DOM) The parsable textual representation of this rule.", ) def _setStyle(self, style): @@ -173,7 +173,7 @@ def _setStyle(self, style): type = property( lambda self: self.FONT_FACE_RULE, - doc="The type of this rule, as defined by a CSSRule " "type constant.", + doc="The type of this rule, as defined by a CSSRule type constant.", ) def _getValid(self): diff --git a/cssutils/css/cssimportrule.py b/cssutils/css/cssimportrule.py index 1697cea9..26191086 100644 --- a/cssutils/css/cssimportrule.py +++ b/cssutils/css/cssimportrule.py @@ -410,12 +410,12 @@ def _getName(self): styleSheet = property( lambda self: self._styleSheet, - doc="(readonly) The style sheet referred to by this " "rule.", + doc="(readonly) The style sheet referred to by this rule.", ) type = property( lambda self: self.IMPORT_RULE, - doc="The type of this rule, as defined by a CSSRule " "type constant.", + doc="The type of this rule, as defined by a CSSRule type constant.", ) def _getWellformed(self): diff --git a/cssutils/css/cssmediarule.py b/cssutils/css/cssmediarule.py index 5567d70f..3ffda543 100644 --- a/cssutils/css/cssmediarule.py +++ b/cssutils/css/cssmediarule.py @@ -254,7 +254,7 @@ def atrule(expected, seq, token, tokenizer): cssText = property( _getCssText, _setCssText, - doc="(DOM) The parsable textual representation of this " "rule.", + doc="(DOM) The parsable textual representation of this rule.", ) @property @@ -336,7 +336,7 @@ def insertRule(self, rule, index=None): type = property( lambda self: self.MEDIA_RULE, - doc="The type of this rule, as defined by a CSSRule " "type constant.", + doc="The type of this rule, as defined by a CSSRule type constant.", ) wellformed = property(lambda self: self.media.wellformed) diff --git a/cssutils/css/cssnamespacerule.py b/cssutils/css/cssnamespacerule.py index 99e814d9..7bed4a6b 100644 --- a/cssutils/css/cssnamespacerule.py +++ b/cssutils/css/cssnamespacerule.py @@ -221,7 +221,7 @@ def _char(expected, seq, token, tokenizer=None): cssText = property( fget=_getCssText, fset=_setCssText, - doc="(DOM) The parsable textual representation of this " "rule.", + doc="(DOM) The parsable textual representation of this rule.", ) def _setNamespaceURI(self, namespaceURI): @@ -308,7 +308,7 @@ def _setPrefix(self, prefix=None): type = property( lambda self: self.NAMESPACE_RULE, - doc="The type of this rule, as defined by a CSSRule " "type constant.", + doc="The type of this rule, as defined by a CSSRule type constant.", ) wellformed = property(lambda self: self.namespaceURI is not None) diff --git a/cssutils/css/csspagerule.py b/cssutils/css/csspagerule.py index 953aa634..9c7585eb 100644 --- a/cssutils/css/csspagerule.py +++ b/cssutils/css/csspagerule.py @@ -215,7 +215,7 @@ def IDENT(expected, seq, token, tokenizer=None): else: new['wellformed'] = False self._log.error( - 'CSSPageRule selectorText: Unexpected IDENT: ' '%r' % val, token + 'CSSPageRule selectorText: Unexpected IDENT: %r' % val, token ) return expected @@ -456,7 +456,7 @@ def insertRule(self, rule, index=None): type = property( lambda self: self.PAGE_RULE, - doc="The type of this rule, as defined by a CSSRule " "type constant.", + doc="The type of this rule, as defined by a CSSRule type constant.", ) # constant but needed: diff --git a/cssutils/css/cssrule.py b/cssutils/css/cssrule.py index 2e396fe5..4e3b42ec 100644 --- a/cssutils/css/cssrule.py +++ b/cssutils/css/cssrule.py @@ -143,7 +143,7 @@ def _getParentStyleSheet(self): type = property( lambda self: self.UNKNOWN_RULE, - doc="The type of this rule, as defined by a CSSRule " "type constant.", + doc="The type of this rule, as defined by a CSSRule type constant.", ) typeString = property( @@ -185,7 +185,7 @@ def _setCssRules(self, cssRules): cssRules = property( lambda self: self._cssRules, _setCssRules, - "All Rules in this style sheet, a " ":class:`~cssutils.css.CSSRuleList`.", + "All Rules in this style sheet, a :class:`~cssutils.css.CSSRuleList`.", ) def deleteRule(self, index): diff --git a/cssutils/css/cssstyledeclaration.py b/cssutils/css/cssstyledeclaration.py index bdf336fa..acd111f6 100644 --- a/cssutils/css/cssstyledeclaration.py +++ b/cssutils/css/cssstyledeclaration.py @@ -323,7 +323,7 @@ def unexpected(expected, seq, token, tokenizer=None): self._tokensupto2(tokenizer, propertyvalueendonly=True) ) self._log.error( - 'CSSStyleDeclaration: Unexpected token, ignoring ' 'upto %r.' % ignored, + 'CSSStyleDeclaration: Unexpected token, ignoring upto %r.' % ignored, token, ) # does not matter in this case diff --git a/cssutils/css/cssstylerule.py b/cssutils/css/cssstylerule.py index 08a8226e..137d884c 100644 --- a/cssutils/css/cssstylerule.py +++ b/cssutils/css/cssstylerule.py @@ -179,7 +179,7 @@ def _setCssText(self, cssText): # noqa: C901 cssText = property( _getCssText, _setCssText, - doc="(DOM) The parsable textual representation of this " "rule.", + doc="(DOM) The parsable textual representation of this rule.", ) def __getNamespaces(self): @@ -241,7 +241,7 @@ def _setSelectorText(self, selectorText): selectorText = property( lambda self: self._selectorList.selectorText, _setSelectorText, - doc="(DOM) The textual representation of the " "selector for the rule set.", + doc="(DOM) The textual representation of the selector for the rule set.", ) def _setStyle(self, style): @@ -264,7 +264,7 @@ def _setStyle(self, style): type = property( lambda self: self.STYLE_RULE, - doc="The type of this rule, as defined by a CSSRule " "type constant.", + doc="The type of this rule, as defined by a CSSRule type constant.", ) wellformed = property(lambda self: self.selectorList.wellformed) diff --git a/cssutils/css/cssstylesheet.py b/cssutils/css/cssstylesheet.py index e8c88a5b..ee434ca4 100644 --- a/cssutils/css/cssstylesheet.py +++ b/cssutils/css/cssstylesheet.py @@ -204,7 +204,7 @@ def importrule(expected, seq, token, tokenizer): if expected > 1: self._log.error( - 'CSSStylesheet: CSSImportRule not allowed ' 'here.', + 'CSSStylesheet: CSSImportRule not allowed here.', token, xml.dom.HierarchyRequestErr, ) @@ -222,7 +222,7 @@ def namespacerule(expected, seq, token, tokenizer): if expected > 2: self._log.error( - 'CSSStylesheet: CSSNamespaceRule not allowed ' 'here.', + 'CSSStylesheet: CSSNamespaceRule not allowed here.', token, xml.dom.HierarchyRequestErr, ) @@ -248,7 +248,7 @@ def variablesrule(expected, seq, token, tokenizer): if expected > 2: self._log.error( - 'CSSStylesheet: CSSVariablesRule not allowed ' 'here.', + 'CSSStylesheet: CSSVariablesRule not allowed here.', token, xml.dom.HierarchyRequestErr, ) @@ -868,7 +868,7 @@ def insertRule(self, rule, index=None, inOrder=False, _clean=True): # noqa: C90 ownerRule = property( lambda self: self._ownerRule, - doc='A ref to an @import rule if it is imported, ' 'else ``None``.', + doc='A ref to an @import rule if it is imported, else ``None``.', ) def _getValid(self): @@ -888,7 +888,7 @@ def setSerializer(self, cssserializer): cssutils.ser = cssserializer else: raise ValueError( - 'Serializer must be an instance of ' 'cssutils.CSSSerializer.' + 'Serializer must be an instance of cssutils.CSSSerializer.' ) @Deprecated('Set pref in ``cssutils.ser.prefs`` instead.') diff --git a/cssutils/css/cssunknownrule.py b/cssutils/css/cssunknownrule.py index 3aa28aa7..215bd3c8 100644 --- a/cssutils/css/cssunknownrule.py +++ b/cssutils/css/cssunknownrule.py @@ -85,7 +85,7 @@ def CHAR(expected, seq, token, tokenizer=None): except IndexError: new['wellformed'] = False self._log.error( - 'CSSUnknownRule: Wrong nesting of ' '{, [ or (.', + 'CSSUnknownRule: Wrong nesting of {, [ or (.', token=token, ) @@ -219,7 +219,7 @@ def default(expected, seq, token, tokenizer=None): type = property( lambda self: self.UNKNOWN_RULE, - doc="The type of this rule, as defined by a CSSRule " "type constant.", + doc="The type of this rule, as defined by a CSSRule type constant.", ) wellformed = property(lambda self: bool(self.atkeyword)) diff --git a/cssutils/css/cssvalue.py b/cssutils/css/cssvalue.py index a386bd0d..9db9556b 100644 --- a/cssutils/css/cssvalue.py +++ b/cssutils/css/cssvalue.py @@ -67,10 +67,11 @@ def __repr__(self): return f"cssutils.css.{self.__class__.__name__}({self.cssText!r})" def __str__(self): - return ( - "" - % (self.__class__.__name__, self.cssValueTypeString, self.cssText, id(self)) + return "" % ( + self.__class__.__name__, + self.cssValueTypeString, + self.cssText, + id(self), ) def _setCssText(self, cssText): # noqa: C901 @@ -977,7 +978,7 @@ def item(self, index): length = property( lambda self: len(self.__items()), - doc="(DOM attribute) The number of CSSValues in the " "list.", + doc="(DOM attribute) The number of CSSValues in the list.", ) diff --git a/cssutils/css/cssvariablesrule.py b/cssutils/css/cssvariablesrule.py index ddc87960..86e292f9 100644 --- a/cssutils/css/cssvariablesrule.py +++ b/cssutils/css/cssvariablesrule.py @@ -72,16 +72,12 @@ def __repr__(self): return f"cssutils.css.{self.__class__.__name__}(mediaText={self._media.mediaText!r}, variables={self.variables.cssText!r})" def __str__(self): - return ( - "" - % ( - self.__class__.__name__, - self._media.mediaText, - self.variables.cssText, - self.valid, - id(self), - ) + return "" % ( + self.__class__.__name__, + self._media.mediaText, + self.variables.cssText, + self.valid, + id(self), ) def _getCssText(self): @@ -184,7 +180,7 @@ def _setCssText(self, cssText): cssText = property( _getCssText, _setCssText, - doc="(DOM) The parsable textual representation of this " "rule.", + doc="(DOM) The parsable textual representation of this rule.", ) media = property( @@ -215,7 +211,7 @@ def _setVariables(self, variables): type = property( lambda self: self.VARIABLES_RULE, - doc="The type of this rule, as defined by a CSSRule " "type constant.", + doc="The type of this rule, as defined by a CSSRule type constant.", ) valid = property(lambda self: True, doc='NOT IMPLEMTED REALLY (TODO)') diff --git a/cssutils/css/marginrule.py b/cssutils/css/marginrule.py index 2f6a556b..8c18d635 100644 --- a/cssutils/css/marginrule.py +++ b/cssutils/css/marginrule.py @@ -124,7 +124,7 @@ def __repr__(self): return f"cssutils.css.{self.__class__.__name__}(margin={self.margin!r}, style={self.style.cssText!r})" def __str__(self): - return "" % ( + return "" % ( self.__class__.__name__, self.margin, self.style.cssText, @@ -227,7 +227,7 @@ def _setStyle(self, style): type = property( lambda self: self.MARGIN_RULE, - doc="The type of this rule, as defined by a CSSRule " "type constant.", + doc="The type of this rule, as defined by a CSSRule type constant.", ) wellformed = property(lambda self: bool(self.atkeyword)) diff --git a/cssutils/css/property.py b/cssutils/css/property.py index 5d4d3eae..293587ac 100644 --- a/cssutils/css/property.py +++ b/cssutils/css/property.py @@ -238,7 +238,7 @@ def _ident(expected, seq, token, tokenizer=None): literalname = property( lambda self: self._literalname, - doc="Readonly literal (not normalized) name " "of this property", + doc="Readonly literal (not normalized) name of this property", ) def _setPropertyValue(self, cssText): @@ -314,7 +314,7 @@ def priority(self, priority): # noqa: C901 self._priority = '' self._literalpriority = '' if priority: - self._log.error('Property: No priority in a MediaQuery - ' 'ignored.') + self._log.error('Property: No priority in a MediaQuery - ignored.') return if isinstance(priority, str) and 'important' == self._normalize(priority): @@ -513,7 +513,7 @@ def validate(self): # noqa: C901 valid = property( validate, - doc="Check if value of this property is valid " "in the properties context.", + doc="Check if value of this property is valid in the properties context.", ) @Deprecated('Use ``property.propertyValue`` instead.') diff --git a/cssutils/css/selector.py b/cssutils/css/selector.py index 054bc5c4..8264117e 100644 --- a/cssutils/css/selector.py +++ b/cssutils/css/selector.py @@ -26,7 +26,7 @@ class Constants: S = ' ' simple_selector_sequence = ( - 'type_selector universal HASH class ' 'attrib pseudo negation ' + 'type_selector universal HASH class attrib pseudo negation ' ) simple_selector_sequence2 = 'HASH class attrib pseudo negation ' @@ -119,7 +119,7 @@ def append(self, seq, val, typ=None, token=None): # noqa: C901 if namespaceURI is None: self.wellformed = False self._log.error( - 'Selector: No namespaceURI found ' 'for prefix %r' % prefix, + 'Selector: No namespaceURI found for prefix %r' % prefix, token=token, error=xml.dom.NamespaceErr, ) @@ -856,7 +856,7 @@ def _prepare_tokens(self, tokenizer): # noqa: C901 selectorText = property( _getSelectorText, _setSelectorText, - doc="(DOM) The parsable textual representation of " "the selector.", + doc="(DOM) The parsable textual representation of the selector.", ) specificity = property( diff --git a/cssutils/css/selectorlist.py b/cssutils/css/selectorlist.py index 43111e3d..6b3ac283 100644 --- a/cssutils/css/selectorlist.py +++ b/cssutils/css/selectorlist.py @@ -52,7 +52,7 @@ def __repr__(self): return f"cssutils.css.{self.__class__.__name__}(selectorText={st!r})" def __str__(self): - return "" % ( + return "" % ( self.__class__.__name__, self.selectorText, self._namespaces, @@ -225,12 +225,12 @@ def _setSelectorText(self, selectorText): selectorText = property( _getSelectorText, _setSelectorText, - doc="(cssutils) The textual representation of the " "selector for a rule set.", + doc="(cssutils) The textual representation of the selector for a rule set.", ) length = property( lambda self: len(self), - doc="The number of :class:`~cssutils.css.Selector` " "objects in the list.", + doc="The number of :class:`~cssutils.css.Selector` objects in the list.", ) parentRule = property( diff --git a/cssutils/css/value.py b/cssutils/css/value.py index 438b0f2b..4888dab3 100644 --- a/cssutils/css/value.py +++ b/cssutils/css/value.py @@ -76,7 +76,7 @@ def __repr__(self): return f"cssutils.css.{self.__class__.__name__}({self.cssText!r})" def __str__(self): - return "" % ( + return "" % ( self.__class__.__name__, self.length, self.cssText, @@ -301,7 +301,7 @@ def _setValue(self, value): value = property( lambda self: self._value, _setValue, - doc="Actual value if possible: An int or float or else " " a string", + doc="Actual value if possible: An int or float or else a string", ) @@ -504,7 +504,7 @@ def _getName(self): ) name = property( - _getName, doc='Name of the color if known (in ColorValue.COLORS) ' 'else None' + _getName, doc='Name of the color if known (in ColorValue.COLORS) else None' ) red = property(lambda self: self._red, doc='red part as integer between 0 and 255') @@ -589,7 +589,7 @@ def _setCssText(self, cssText): dimension = property( lambda self: self._dimension, # _setValue, - doc="Dimension if a DIMENSION or PERCENTAGE value, " "else None", + doc="Dimension if a DIMENSION or PERCENTAGE value, else None", ) diff --git a/cssutils/sac.py b/cssutils/sac.py index e3f944a0..9ef0b127 100644 --- a/cssutils/sac.py +++ b/cssutils/sac.py @@ -287,7 +287,7 @@ def simple(t): self._handler.importStyle(uri, media, name) else: self._errorHandler.error( - 'Invalid @import' ' declaration at %r' % (start,) + 'Invalid @import declaration at %r' % (start,) ) elif 'NAMESPACE_SYM' == type_: @@ -307,7 +307,7 @@ def simple(t): self._handler.namespaceDeclaration(prefix, uri, *start) else: self._errorHandler.error( - 'Invalid @namespace' ' declaration at %r' % (start,) + 'Invalid @namespace declaration at %r' % (start,) ) else: diff --git a/cssutils/stylesheets/medialist.py b/cssutils/stylesheets/medialist.py index 6c14725b..8c6d10f3 100644 --- a/cssutils/stylesheets/medialist.py +++ b/cssutils/stylesheets/medialist.py @@ -268,8 +268,7 @@ def item(self, index): parentRule = property( lambda self: self._parentRule, - doc="The CSSRule (e.g. an @media or @import rule " - "this list is part of or None", + doc="The CSSRule (e.g. an @media or @import rule this list is part of or None", ) wellformed = property(lambda self: self._wellformed) diff --git a/cssutils/tests/test_cssrule.py b/cssutils/tests/test_cssrule.py index a7eab72b..5d8e741e 100644 --- a/cssutils/tests/test_cssrule.py +++ b/cssutils/tests/test_cssrule.py @@ -223,7 +223,7 @@ def _test_InvalidModificationErr(self, startwithspace): '@font-face {}', '@import url(x);', '@media all {}', - '@namespace "x";' '@page {}', + '@namespace "x";@page {}', '@unknown;', '@variables;', # TODO: diff --git a/cssutils/tests/test_properties.py b/cssutils/tests/test_properties.py index caf6118b..cbc42e7b 100644 --- a/cssutils/tests/test_properties.py +++ b/cssutils/tests/test_properties.py @@ -131,7 +131,7 @@ def test_properties(self): '"a", b', r'a\{b', r'a\ b', - 'a b' 'a b, c d , e', + 'a ba b, c d , e', ], ), # 'src': ('STRING',),