Skip to content

Commit

Permalink
Remove object base class.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jun 8, 2022
1 parent 09c2599 commit 7a76733
Show file tree
Hide file tree
Showing 18 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion cssutils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
_ANYNS = -1


class DOMImplementationCSS(object):
class DOMImplementationCSS:
"""This interface allows the DOM user to create a CSSStyleSheet
outside the context of a document. There is no way to associate
the new CSSStyleSheet with a document in DOM Level 2.
Expand Down
2 changes: 1 addition & 1 deletion cssutils/css/cssproperties.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
import re


class CSS2Properties(object):
class CSS2Properties:
"""The CSS2Properties interface represents a convenience mechanism
for retrieving and setting properties within a CSSStyleDeclaration.
The attributes of this interface correspond to all the properties
Expand Down
2 changes: 1 addition & 1 deletion cssutils/css2productions.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
]


class CSSProductions(object):
class CSSProductions:
pass


Expand Down
2 changes: 1 addition & 1 deletion cssutils/cssproductions.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
]


class CSSProductions(object):
class CSSProductions:
"""
most attributes are set later
"""
Expand Down
2 changes: 1 addition & 1 deletion cssutils/errorhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import xml.dom


class _ErrorHandler(object):
class _ErrorHandler:
"""
handles all errors and log messages
"""
Expand Down
2 changes: 1 addition & 1 deletion cssutils/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import urllib.parse


class Deprecated(object):
class Deprecated:
"""This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emitted
when the function is used.
Expand Down
2 changes: 1 addition & 1 deletion cssutils/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from cssutils import css


class CSSParser(object):
class CSSParser:
"""Parse a CSS StyleSheet from URL, string or file and return a DOM Level 2
CSS StyleSheet object.
Expand Down
10 changes: 5 additions & 5 deletions cssutils/prodparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class NoMatch(ParseError):
pass


class Choice(object):
class Choice:
"""A Choice of productions (Sequence or single Prod)."""

def __init__(self, *prods, **options):
Expand Down Expand Up @@ -129,7 +129,7 @@ def __str__(self):
return 'Choice(%s)' % ', '.join([str(x) for x in self._prods])


class Sequence(object):
class Sequence:
"""A Sequence of productions (Choice or single Prod)."""

def __init__(self, *prods, **options):
Expand Down Expand Up @@ -250,7 +250,7 @@ def __str__(self):
return 'Sequence(%s)' % ', '.join([str(x) for x in self._prods])


class Prod(object):
class Prod:
"""Single Prod in Sequence or Choice."""

def __init__(
Expand Down Expand Up @@ -373,7 +373,7 @@ def __repr__(self):
savedTokens = []


class ProdParser(object):
class ProdParser:
"""Productions parser."""

def __init__(self, clear=True):
Expand Down Expand Up @@ -695,7 +695,7 @@ def parse( # noqa: C901
return wellformed, seq, store, tokens


class PreDef(object):
class PreDef:
"""Predefined Prod definition for use in productions definition
for ProdParser instances.
"""
Expand Down
2 changes: 1 addition & 1 deletion cssutils/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class NoSuchProfileException(Exception):
pass


class Profiles(object):
class Profiles:
"""
All profiles used for validation. ``cssutils.profile`` is a
preset object of this class and used by all properties for validation.
Expand Down
6 changes: 3 additions & 3 deletions cssutils/sac.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from . import tokenize2


class ErrorHandler(object):
class ErrorHandler:
"""Basic class for CSS error handlers.
This class class provides a default implementation ignoring warnings and
Expand Down Expand Up @@ -40,7 +40,7 @@ def warn(self, exception, token=None):
self._log.warn(exception, token, neverraise=True)


class DocumentHandler(object):
class DocumentHandler:
"""
void endFontFace()
Receive notification of the end of a font face statement.
Expand Down Expand Up @@ -160,7 +160,7 @@ def property(self, name, value, important=False, line=None, col=None):
)


class Parser(object):
class Parser:
"""
java.lang.String getParserVersion()
Returns a string about which CSS language is supported by this parser.
Expand Down
2 changes: 1 addition & 1 deletion cssutils/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def handle_endtag(self, tag):
self.curtag = ''


class CSSCapture(object):
class CSSCapture:
"""
Retrieve all CSS stylesheets including embedded for a given URL.
Optional setting of User-Agent used for retrieval possible
Expand Down
6 changes: 3 additions & 3 deletions cssutils/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def _escapecss(e):
codecs.register_error('escapecss', _escapecss)


class Preferences(object):
class Preferences:
r"""Control output of CSSSerializer.
defaultAtKeyword = True
Expand Down Expand Up @@ -182,7 +182,7 @@ def useMinified(self):
self.validOnly = False


class Out(object):
class Out:
"""A simple class which makes appended items available as a combined string"""

def __init__(self, ser):
Expand Down Expand Up @@ -303,7 +303,7 @@ def value(self, delim='', end=None, keepS=False):
return delim.join(self.out)


class CSSSerializer(object):
class CSSSerializer:
"""Serialize a CSSStylesheet and its parts.
To use your own serializing method the easiest is to subclass CSS
Expand Down
2 changes: 1 addition & 1 deletion cssutils/tests/test_codec.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
iostream = io.BytesIO


class Queue(object):
class Queue:
"""
queue: write bytes at one end, read bytes from the other end
"""
Expand Down
4 changes: 2 additions & 2 deletions cssutils/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def test_defaultFetcher(self): # noqa: C901
"""util._defaultFetcher"""
if mock:

class Response(object):
class Response:
"""urllib2.Reponse mock"""

def __init__(
Expand All @@ -406,7 +406,7 @@ def geturl(self):
def info(self):
mimetype, charset = self.mimetype, self.charset

class Info(object):
class Info:

# py2x
def gettype(self):
Expand Down
2 changes: 1 addition & 1 deletion cssutils/tokenize2.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
_TOKENIZER_CACHE = {}


class Tokenizer(object):
class Tokenizer:
"""
generates a list of Token tuples:
(Tokenname, value, startline, startcolumn)
Expand Down
12 changes: 6 additions & 6 deletions cssutils/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
log = errorhandler.ErrorHandler()


class _BaseClass(object):
class _BaseClass:
"""
Base class for Base, Base2 and _NewBase.
Expand Down Expand Up @@ -557,7 +557,7 @@ def EOF(expected=None, seq=None, token=None, tokenizer=None):
return defaultproductions


class Seq(object):
class Seq:
"""
property seq of Base2 inheriting classes, holds a list of Item objects.
Expand Down Expand Up @@ -669,7 +669,7 @@ def appendToVal(self, val=None, index=-1):
self._seq[index] = Item(old.value + val, old.type, old.line, old.col)


class Item(object):
class Item:
"""
an item in the seq list of classes (successor to tuple items in old seq)
Expand Down Expand Up @@ -706,7 +706,7 @@ def __repr__(self):
)


class ListSeq(object):
class ListSeq:
"""
(EXPERIMENTAL)
A base class used for list classes like cssutils.css.SelectorList or
Expand Down Expand Up @@ -754,7 +754,7 @@ def append(self, item):
raise NotImplementedError


class _Namespaces(object):
class _Namespaces:
"""
A dictionary like wrapper for @namespace rules used in a CSSStyleSheet.
Works on effective namespaces, so e.g. if::
Expand Down Expand Up @@ -1000,7 +1000,7 @@ def _readUrl( # noqa: C901
return None, None, None


class LazyRegex(object):
class LazyRegex:
"""A class to represent a lazily compiled regular expression.
The interface is kept similar to a `re.compile`ed object from the standard
Expand Down
2 changes: 1 addition & 1 deletion encutils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def handle_starttag(self, tag, attrs):
_OTHER_TYPE = 4


class EncodingInfo(object):
class EncodingInfo:
"""
All encoding related information, returned by :func:`getEncodingInfo`.
Expand Down
4 changes: 2 additions & 2 deletions examples/testutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import cssutils


class OutReplacement(object):
class OutReplacement:
"io.StringIO does not work somehow?!"

def __init__(self):
Expand All @@ -33,7 +33,7 @@ def getvalue(self):
return self.t


class TestUtil(object):
class TestUtil:
def __init__(self):
"init out and err to catch both"
self._out = OutReplacement() # StringIO()
Expand Down

0 comments on commit 7a76733

Please sign in to comment.