Skip to content

Commit

Permalink
Removed useless inheritance from object superseded in Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
lgiordani authored and jeremydw committed Apr 19, 2022
1 parent 6e22736 commit 9078398
Show file tree
Hide file tree
Showing 70 changed files with 100 additions and 100 deletions.
2 changes: 1 addition & 1 deletion grow/cache/collection_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from grow.collections import collection


class CollectionCache(object):
class CollectionCache:

def __init__(self):
self.reset()
Expand Down
2 changes: 1 addition & 1 deletion grow/cache/document_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
be shared between locales with the same pod_path.
"""

class DocumentCache(object):
class DocumentCache:

def __init__(self):
self.reset()
Expand Down
2 changes: 1 addition & 1 deletion grow/cache/file_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
The contents of the cache can be parsed and are stored based on locale.
"""

class FileCache(object):
class FileCache:
"""Simple cache for file contents."""

def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion grow/cache/object_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
FILE_OBJECT_SUB_CACHE = 'objectcache.{}.json'


class ObjectCache(object):
class ObjectCache:
"""Object cache for caching arbitrary data in a pod."""

def __contains__(self, key):
Expand Down
2 changes: 1 addition & 1 deletion grow/cache/podcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class PodCacheParseError(Error):
pass


class PodCache(object):
class PodCache:
"""Caching container for the pod."""

KEY_GLOBAL = '__global__'
Expand Down
2 changes: 1 addition & 1 deletion grow/cache/routes_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
FILE_ROUTES_CACHE = 'routescache.json'


class RoutesCache(object):
class RoutesCache:
"""Routes cache for caching routing data in a pod."""

KEY_CONCRETE = 'concrete'
Expand Down
2 changes: 1 addition & 1 deletion grow/collections/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class NoLocalesError(Error):
pass


class Collection(object):
class Collection:
CONTENT_PATH = '/content'
BLUEPRINT_PATH = '_blueprint.yaml'
FEATURE_SEPARATE_ROUTING = 'separate_routing'
Expand Down
2 changes: 1 addition & 1 deletion grow/collections/collection_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os


class CollectionRoutes(object):
class CollectionRoutes:
"""Collection level routing information."""

ROUTES_PATH = '_routes.yaml'
Expand Down
2 changes: 1 addition & 1 deletion grow/commands/deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


# pylint: disable=too-few-public-methods
class DeprecatedItem(object):
class DeprecatedItem:
"""Configuration for an alias item."""

def __init__(self, old_name, new_name, cmd=None):
Expand Down
4 changes: 2 additions & 2 deletions grow/common/base_config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Base Config control class."""


class BaseConfig(object):
class BaseConfig:
"""Base class for identifier based configuration management."""

def __init__(self, config=None):
Expand Down Expand Up @@ -41,7 +41,7 @@ def set(self, identifier, value):
item[key] = value


class BaseConfigPrefixed(object):
class BaseConfigPrefixed:
"""Utility class for shortcutting common prefixes in identifiers."""

def __init__(self, config, prefix):
Expand Down
4 changes: 2 additions & 2 deletions grow/common/deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging

# pylint: disable=too-few-public-methods
class DeprecationHelper(object):
class DeprecationHelper:
"""Deprecation helper class for deprecating a class."""

def __init__(self, new_target, message, warn=logging.warn):
Expand All @@ -27,7 +27,7 @@ def __getattr__(self, attr):
return getattr(self.new_target, attr)

# pylint: disable=too-few-public-methods
class DeprecationManager(object):
class DeprecationManager:
"""Deprecation manager class for deprecation messages without repeating."""

def __init__(self, warn=logging.warn):
Expand Down
2 changes: 1 addition & 1 deletion grow/common/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from grow.common import base_config

class Features(object):
class Features:
"""Control features."""

def __call__(self, feature):
Expand Down
6 changes: 3 additions & 3 deletions grow/common/patched_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def setquit():
else:
eof = 'Ctrl-D (i.e. EOF)'

class Quitter(object):
class Quitter:
def __init__(self, name):
self.name = name
def __repr__(self):
Expand All @@ -365,7 +365,7 @@ def __call__(self, code=None):
builtins.exit = Quitter('exit')


class _Printer(object):
class _Printer:
"""interactive prompt objects for printing the license text, a list of
contributors and the copyright notice."""

Expand Down Expand Up @@ -444,7 +444,7 @@ def setcopyright():
[os.path.join(here, os.pardir), here, os.curdir])


class _Helper(object):
class _Helper:
"""Define the builtin 'help'.
This is a wrapper around pydoc.help (with a twist).
Expand Down
2 changes: 1 addition & 1 deletion grow/common/progressbar_non.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import progressbar


class NonInteractiveProgressBar(object):
class NonInteractiveProgressBar:
"""Non-interactive stub version of progress bar."""

def __init__(self, message, max_value=None, poll_interval=5, widgets=None, *_args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion grow/common/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __missing__(self, key):
return '{' + key + '}'


class SortedCollection(object):
class SortedCollection:
"""Sequence sorted by a key function.
SortedCollection() is much easier to work with than using bisect() directly.
Expand Down
2 changes: 1 addition & 1 deletion grow/common/timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import time

class Timer(object):
class Timer:
def __init__(self, verbose=False):
self.verbose = verbose

Expand Down
8 changes: 4 additions & 4 deletions grow/common/untag.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
LOCALIZED_KEY_REGEX = re.compile(r'(.*)@([^@]+)$')


class Untag(object):
class Untag:
"""Untagging utility for locale and environment based untagging."""

@staticmethod
Expand Down Expand Up @@ -115,14 +115,14 @@ def _remap_exit(path, key, old_parent, new_parent, new_items):
return iterutils.remap(data, visit=_visit, exit=_remap_exit)


class UntagParam(object):
class UntagParam:
"""Untagging param for complex untagging."""

def __call__(self, data, untagged_key, param_key, param_value, value, locale_identifier=None):
raise NotImplementedError()


class UntagParamRegex(object):
class UntagParamRegex:
"""Param using the value of the param value as a regex to match."""

def __init__(self, value):
Expand All @@ -137,7 +137,7 @@ def __call__(self, data, untagged_key, param_key, param_value, value, locale_ide
return untagged_key, value


class UntagParamLocaleRegex(object):
class UntagParamLocaleRegex:
"""Param using a document field as a regex group to match locale.
Attempts to use the value of one of the other data fields as a locale regex.
Expand Down
2 changes: 1 addition & 1 deletion grow/common/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os


class Url(object):
class Url:
"""Url utility class."""

def __init__(self, path, host=None, port=None, scheme=None):
Expand Down
6 changes: 3 additions & 3 deletions grow/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def validate_name(name):
'backslashes, and dashes. Found: "{}"'.format(name))


class memoize(object):
class memoize:

def __init__(self, func):
self.func = func
Expand Down Expand Up @@ -164,7 +164,7 @@ class cached_property(property):
and then that calculated result is used the next time you access
the value::
class Foo(object):
class Foo:
@cached_property
def foo(self):
# calculate something important here
Expand Down Expand Up @@ -519,7 +519,7 @@ def slugify(text, delim='-'):
return slug


class DummyDict(object):
class DummyDict:

def __getattr__(self, name):
return ''
Expand Down
6 changes: 3 additions & 3 deletions grow/conversion/collection_routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self, message):
self.message = message


class RoutesData(object):
class RoutesData:
"""Store and format the routes information pulled from the documents."""

def __init__(self, collection_path, blueprint):
Expand Down Expand Up @@ -109,7 +109,7 @@ def write_routes(self, pod, collection):
print('')


class ConversionCollection(object):
class ConversionCollection:
"""Temporary collection class for doing a conversion for a collection."""

def __init__(self, pod, collection):
Expand All @@ -129,7 +129,7 @@ def convert(self):
self.routes_data.write_routes(self.pod, self.collection)


class Converter(object):
class Converter:

@staticmethod
def convert(pod):
Expand Down
6 changes: 3 additions & 3 deletions grow/conversion/content_locale_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _update_deep(orig_dict, new_dict):
orig_dict[k] = new_dict[k]


class PlainText(object):
class PlainText:

def __init__(self, tag, value):
self.tag = tag
Expand Down Expand Up @@ -110,7 +110,7 @@ def plain_text_representer(dumper, data):
'!g.yaml', PlainTextYamlLoader.construct_plaintext)


class ConversionDocument(object):
class ConversionDocument:

def __init__(self, pod, file_name, default_locale):
self.default_locale = default_locale
Expand Down Expand Up @@ -407,7 +407,7 @@ def split(self):
yield front_matter, content


class Converter(object):
class Converter:

@staticmethod
def convert(pod):
Expand Down
4 changes: 2 additions & 2 deletions grow/deployments/destinations/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class CommandError(Error):
pass


class DestinationTestCase(object):
class DestinationTestCase:

def __init__(self, deployment):
self.deployment = deployment
Expand All @@ -120,7 +120,7 @@ def __iter__(self):
yield func


class BaseDestination(object):
class BaseDestination:
"""Base destination for building and deploying."""

TestCase = DestinationTestCase
Expand Down
4 changes: 2 additions & 2 deletions grow/deployments/indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, message, errors):
self.errors = errors


class Diff(object):
class Diff:
POOL_SIZE = 10 # Thread pool size for applying a diff.
GIT_LOG_MAX = 25

Expand Down Expand Up @@ -368,7 +368,7 @@ def stream(cls, theirs, content_generator, repo=None, is_partial=False):
return diff, index, paths_to_rendered_doc


class Index(object):
class Index:

@classmethod
def create(cls, paths_to_rendered_doc=None):
Expand Down
2 changes: 1 addition & 1 deletion grow/deployments/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from . import messages


class Stats(object):
class Stats:

def __init__(self, pod, paths=None, full=True):
self.full = full
Expand Down
2 changes: 1 addition & 1 deletion grow/documents/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class PathFormatError(Error, ValueError):
pass


class Document(object):
class Document:
"""Grow content document."""

def __eq__(self, other):
Expand Down
2 changes: 1 addition & 1 deletion grow/documents/document_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
LOCALIZED_KEY_REGEX = re.compile(r'(.*)@([^@]+)$')


class DocumentFields(object):
class DocumentFields:

def __contains__(self, item):
return item in self._data
Expand Down
2 changes: 1 addition & 1 deletion grow/documents/document_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class BadLocalesError(BadFormatError):
pass


class DocumentFormat(object):
class DocumentFormat:
"""
Document formatting specifics for parsing and working with documents.
Expand Down
2 changes: 1 addition & 1 deletion grow/documents/document_front_matter.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class BadFormatError(Error, ValueError):
pass


class DocumentFrontMatter(object):
class DocumentFrontMatter:
"""Document front matter."""

def __init__(self, doc, raw_front_matter=None):
Expand Down
2 changes: 1 addition & 1 deletion grow/documents/static_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
r'(.*)(-[a-f0-9]{64})((\.min|)[\.][a-z0-9]{1,5})$', re.IGNORECASE)


class StaticDocument(object):
class StaticDocument:
"""Static document."""

def __eq__(self, other):
Expand Down

0 comments on commit 9078398

Please sign in to comment.