diff --git a/src/octoprint/access/groups.py b/src/octoprint/access/groups.py index e7d5e1bd4..c5626de0f 100644 --- a/src/octoprint/access/groups.py +++ b/src/octoprint/access/groups.py @@ -28,7 +28,7 @@ class GroupPermission(Permission): super(GroupPermission, self).__init__(need) -class GroupManager(object): +class GroupManager: @classmethod def default_permissions_for_group(cls, group): result = [] @@ -158,7 +158,7 @@ class GroupManager(object): except Exception: self._logger.exception("Error notifying listener {!r} via {}".format(listener, method)) -class GroupChangeListener(object): +class GroupChangeListener: def on_group_added(self, group): pass @@ -428,7 +428,7 @@ class GroupCantBeChanged(Exception): Exception.__init__(self, "Group can't be changed: %s" % key) -class Group(object): +class Group: def __init__(self, key, name, description="", permissions=None, subgroups=None, default=False, removable=True, changeable=True, toggleable=True): self._key = key self._name = name diff --git a/src/octoprint/access/permissions.py b/src/octoprint/access/permissions.py index 39b5d236e..71c89877f 100644 --- a/src/octoprint/access/permissions.py +++ b/src/octoprint/access/permissions.py @@ -136,7 +136,7 @@ class PluginOctoPrintPermission(OctoPrintPermission): return result -class PluginIdentityContext(object): +class PluginIdentityContext: """Identity context for not initialized Permissions Needed to support @Permissions.PLUGIN_X_Y.require() diff --git a/src/octoprint/access/users.py b/src/octoprint/access/users.py index 84e09a978..826b72b28 100644 --- a/src/octoprint/access/users.py +++ b/src/octoprint/access/users.py @@ -26,7 +26,7 @@ from octoprint.access.groups import GroupChangeListener, Group from past.builtins import basestring -class UserManager(GroupChangeListener, object): +class UserManager(GroupChangeListener): def __init__(self, group_manager, settings=None): self._group_manager = group_manager self._group_manager.register_listener(self) @@ -439,7 +439,7 @@ class UserManager(GroupChangeListener, object): since="1.4.0")(has_been_customized) -class LoginStatusListener(object): +class LoginStatusListener: def on_user_logged_in(self, user): pass @@ -905,7 +905,7 @@ class UnknownRole(Exception): ##~~ Refactoring helpers -class MethodReplacedByBooleanProperty(object): +class MethodReplacedByBooleanProperty: def __init__(self, name, message, getter): self._name = name diff --git a/src/octoprint/cli/__init__.py b/src/octoprint/cli/__init__.py index e152aa5de..e09936ea3 100644 --- a/src/octoprint/cli/__init__.py +++ b/src/octoprint/cli/__init__.py @@ -9,7 +9,7 @@ import sys #~~ click context -class OctoPrintContext(object): +class OctoPrintContext: """Custom context wrapping the standard options.""" def __init__(self, configfile=None, basedir=None, verbosity=0, safe_mode=False): diff --git a/src/octoprint/environment.py b/src/octoprint/environment.py index 1db71995c..b5ce695f7 100644 --- a/src/octoprint/environment.py +++ b/src/octoprint/environment.py @@ -14,7 +14,7 @@ from octoprint.plugin import EnvironmentDetectionPlugin from octoprint.util.platform import get_os from octoprint.util.version import get_python_version_string -class EnvironmentDetector(object): +class EnvironmentDetector: def __init__(self, plugin_manager): self._plugin_manager = plugin_manager diff --git a/src/octoprint/events.py b/src/octoprint/events.py index fd455a4e0..dc629b371 100644 --- a/src/octoprint/events.py +++ b/src/octoprint/events.py @@ -24,7 +24,7 @@ def all_events(): return [getattr(Events, name) for name in Events.__dict__ if not name.startswith("_") and not name in ("register_event",)] -class Events(object): +class Events: # server STARTUP = "Startup" SHUTDOWN = "Shutdown" @@ -148,7 +148,7 @@ def eventManager(): return _instance -class EventManager(object): +class EventManager: """ Handles receiving events and dispatching them to subscribers """ @@ -258,7 +258,7 @@ class EventManager(object): return self._worker.is_alive() -class GenericEventListener(object): +class GenericEventListener: """ The GenericEventListener can be subclassed to easily create custom event listeners. """ diff --git a/src/octoprint/filemanager/__init__.py b/src/octoprint/filemanager/__init__.py index 1e7348392..abc93ca10 100644 --- a/src/octoprint/filemanager/__init__.py +++ b/src/octoprint/filemanager/__init__.py @@ -197,7 +197,7 @@ class NoSuchStorage(Exception): pass -class FileManager(object): +class FileManager: def __init__(self, analysis_queue, slicing_manager, printer_profile_manager, initial_storage_managers=None): self._logger = logging.getLogger(__name__) self._analysis_queue = analysis_queue diff --git a/src/octoprint/filemanager/analysis.py b/src/octoprint/filemanager/analysis.py index edd37ca7a..3cf2d7c68 100644 --- a/src/octoprint/filemanager/analysis.py +++ b/src/octoprint/filemanager/analysis.py @@ -46,7 +46,7 @@ class AnalysisAborted(Exception): self.reenqueue = reenqueue -class AnalysisQueue(object): +class AnalysisQueue: """ OctoPrint's :class:`AnalysisQueue` can manage various :class:`AbstractAnalysisQueue` implementations, mapped by their machine code type. @@ -118,7 +118,7 @@ class AnalysisQueue(object): "origin": entry.location, "result": result}) -class AbstractAnalysisQueue(object): +class AbstractAnalysisQueue: """ The :class:`AbstractAnalysisQueue` is the parent class of all specific analysis queues such as the :class:`GcodeAnalysisQueue`. It offers methods to enqueue new entries to analyze and pausing and resuming analysis diff --git a/src/octoprint/filemanager/destinations.py b/src/octoprint/filemanager/destinations.py index ae63868b2..a04f753ee 100644 --- a/src/octoprint/filemanager/destinations.py +++ b/src/octoprint/filemanager/destinations.py @@ -1,6 +1,6 @@ __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' -class FileDestinations(object): +class FileDestinations: SDCARD = "sdcard" LOCAL = "local" diff --git a/src/octoprint/filemanager/storage.py b/src/octoprint/filemanager/storage.py index e3a0404e5..66dfcf5ad 100644 --- a/src/octoprint/filemanager/storage.py +++ b/src/octoprint/filemanager/storage.py @@ -27,7 +27,7 @@ import octoprint.filemanager from octoprint.util import is_hidden_path, to_unicode, to_bytes -class StorageInterface(object): +class StorageInterface: """ Interface of storage adapters for OctoPrint. """ diff --git a/src/octoprint/filemanager/util.py b/src/octoprint/filemanager/util.py index 430b1346d..6d14e5ab8 100644 --- a/src/octoprint/filemanager/util.py +++ b/src/octoprint/filemanager/util.py @@ -8,7 +8,7 @@ import os from octoprint import UMASK from octoprint.util import atomic_write -class AbstractFileWrapper(object): +class AbstractFileWrapper: """ Wrapper for file representations to save to storages. diff --git a/src/octoprint/plugin/__init__.py b/src/octoprint/plugin/__init__.py index d1eb64132..c11c7d7ef 100644 --- a/src/octoprint/plugin/__init__.py +++ b/src/octoprint/plugin/__init__.py @@ -233,7 +233,7 @@ def call_plugin(types, method, args=None, kwargs=None, callback=None, error_call error_callback(plugin._identifier, plugin, exc) -class PluginSettings(object): +class PluginSettings: """ The :class:`PluginSettings` class is the interface for plugins to their own or globally defined settings. diff --git a/src/octoprint/plugin/core.py b/src/octoprint/plugin/core.py index e793188b2..6465d4e10 100644 --- a/src/octoprint/plugin/core.py +++ b/src/octoprint/plugin/core.py @@ -72,7 +72,7 @@ EntryPointOrigin = namedtuple("EntryPointOrigin", "type, entry_point, module_nam FolderOrigin = namedtuple("FolderOrigin", "type, folder") ModuleOrigin = namedtuple("PackageOrigin", "type, module_name, folder") -class PluginInfo(object): +class PluginInfo: """ The :class:`PluginInfo` class wraps all available information about a registered plugin. @@ -636,7 +636,7 @@ class PluginInfo(object): return result -class PluginManager(object): +class PluginManager: """ The :class:`PluginManager` is the central component for finding, loading and accessing plugins provided to the system. @@ -1791,7 +1791,7 @@ class EntryPointMetadata(pkginfo.Distribution): warnings.warn('No package metadata found for package {}'.format(self.entry_point.module_name)) -class Plugin(object): +class Plugin: """ The parent class of all plugin implementations. diff --git a/src/octoprint/plugins/action_command_prompt/__init__.py b/src/octoprint/plugins/action_command_prompt/__init__.py index 16d1ffdf3..5bcc5f8ef 100644 --- a/src/octoprint/plugins/action_command_prompt/__init__.py +++ b/src/octoprint/plugins/action_command_prompt/__init__.py @@ -11,7 +11,7 @@ from octoprint.events import Events import flask from flask_babel import gettext -class Prompt(object): +class Prompt: def __init__(self, text): self.text = text diff --git a/src/octoprint/plugins/appkeys/__init__.py b/src/octoprint/plugins/appkeys/__init__.py index 44718865d..c98d45f6c 100644 --- a/src/octoprint/plugins/appkeys/__init__.py +++ b/src/octoprint/plugins/appkeys/__init__.py @@ -24,7 +24,7 @@ class AppAlreadyExists(Exception): pass -class PendingDecision(object): +class PendingDecision: def __init__(self, app_id, app_token, user_id, user_token, timeout_callback=None): self.app_id = app_id self.app_token = app_token @@ -48,7 +48,7 @@ class PendingDecision(object): self.user_token) -class ReadyDecision(object): +class ReadyDecision: def __init__(self, app_id, app_token, user_id): self.app_id = app_id self.app_token = app_token @@ -64,7 +64,7 @@ class ReadyDecision(object): self.user_id) -class ActiveKey(object): +class ActiveKey: def __init__(self, app_id, api_key, user_id): self.app_id = app_id self.api_key = api_key diff --git a/src/octoprint/plugins/corewizard/subwizards.py b/src/octoprint/plugins/corewizard/subwizards.py index fc91c7684..995887cf5 100644 --- a/src/octoprint/plugins/corewizard/subwizards.py +++ b/src/octoprint/plugins/corewizard/subwizards.py @@ -10,7 +10,7 @@ from octoprint.access import ADMIN_GROUP, USER_GROUP from octoprint.util import to_native_str # noinspection PyUnresolvedReferences,PyMethodMayBeStatic -class ServerCommandsSubwizard(object): +class ServerCommandsSubwizard: def _is_servercommands_wizard_firstrunonly(self): return True @@ -29,7 +29,7 @@ class ServerCommandsSubwizard(object): # noinspection PyUnresolvedReferences,PyMethodMayBeStatic -class WebcamSubwizard(object): +class WebcamSubwizard: def _is_webcam_wizard_firstrunonly(self): return True @@ -48,7 +48,7 @@ class WebcamSubwizard(object): # noinspection PyUnresolvedReferences,PyMethodMayBeStatic -class AclSubwizard(object): +class AclSubwizard: def _is_acl_wizard_firstrunonly(self): return True @@ -93,7 +93,7 @@ class AclSubwizard(object): # noinspection PyUnresolvedReferences,PyMethodMayBeStatic -class OnlineCheckSubwizard(object): +class OnlineCheckSubwizard: def _is_onlinecheck_wizard_firstrunonly(self): return False @@ -111,7 +111,7 @@ class OnlineCheckSubwizard(object): # noinspection PyUnresolvedReferences,PyMethodMayBeStatic -class PluginBlacklistSubwizard(object): +class PluginBlacklistSubwizard: def _is_pluginblacklist_wizard_firstrunonly(self): return False @@ -129,7 +129,7 @@ class PluginBlacklistSubwizard(object): # noinspection PyUnresolvedReferences,PyMethodMayBeStatic -class PrinterProfileSubwizard(object): +class PrinterProfileSubwizard: def _is_printerprofile_wizard_firstrunonly(self): return True diff --git a/src/octoprint/plugins/discovery/__init__.py b/src/octoprint/plugins/discovery/__init__.py index 95f9b9686..ffe346fdc 100644 --- a/src/octoprint/plugins/discovery/__init__.py +++ b/src/octoprint/plugins/discovery/__init__.py @@ -288,7 +288,7 @@ class DiscoveryPlugin(octoprint.plugin.StartupPlugin, result_available = threading.Event() result_available.clear() - class ZeroconfListener(object): + class ZeroconfListener: def __init__(self, logger): self._logger = logger diff --git a/src/octoprint/plugins/pi_support/__init__.py b/src/octoprint/plugins/pi_support/__init__.py index b3bd28ed7..a8b8c31a3 100644 --- a/src/octoprint/plugins/pi_support/__init__.py +++ b/src/octoprint/plugins/pi_support/__init__.py @@ -48,7 +48,7 @@ _FLAG_PAST_UNDERVOLTAGE = 1 << 16 _FLAG_PAST_FREQ_CAPPED = 1 << 17 _FLAG_PAST_THROTTLED = 1 << 18 -class ThrottleState(object): +class ThrottleState: @classmethod def from_value(cls, value=0): if value == 0: diff --git a/src/octoprint/plugins/virtual_printer/virtual.py b/src/octoprint/plugins/virtual_printer/virtual.py index 086c4b132..c54a2f2f0 100644 --- a/src/octoprint/plugins/virtual_printer/virtual.py +++ b/src/octoprint/plugins/virtual_printer/virtual.py @@ -31,7 +31,7 @@ from typing import Any # noinspection PyBroadException -class VirtualPrinter(object): +class VirtualPrinter: command_regex = re.compile(r"^([GMTF])(\d+)") sleep_regex = re.compile(r"sleep (\d+)") sleep_after_regex = re.compile(r"sleep_after ([GMTF]\d+) (\d+)") diff --git a/src/octoprint/printer/__init__.py b/src/octoprint/printer/__init__.py index cd32b3521..73833cee4 100644 --- a/src/octoprint/printer/__init__.py +++ b/src/octoprint/printer/__init__.py @@ -32,7 +32,7 @@ def get_connection_options(): return PrinterInterface.get_connection_options() -class PrinterInterface(object): +class PrinterInterface: """ The :class:`PrinterInterface` represents the developer interface to the :class:`~octoprint.printer.standard.Printer` instance. @@ -590,7 +590,7 @@ class PrinterInterface(object): raise NotImplementedError() -class PrinterCallback(object): +class PrinterCallback: def on_printer_add_log(self, data): """ Called when the :class:`PrinterInterface` receives a new communication log entry from the communication layer. diff --git a/src/octoprint/printer/estimation.py b/src/octoprint/printer/estimation.py index a30932c69..412ffbe68 100644 --- a/src/octoprint/printer/estimation.py +++ b/src/octoprint/printer/estimation.py @@ -6,7 +6,7 @@ __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms from octoprint.settings import settings -class PrintTimeEstimator(object): +class PrintTimeEstimator: """ Estimator implementation. @@ -165,7 +165,7 @@ class PrintTimeEstimator(object): return self._data.update(printTime / progress) -class TimeEstimationHelper(object): +class TimeEstimationHelper: STABLE_THRESHOLD = 0.1 STABLE_COUNTDOWN = 250 diff --git a/src/octoprint/printer/profile.py b/src/octoprint/printer/profile.py index 9e0f18342..61382e945 100644 --- a/src/octoprint/printer/profile.py +++ b/src/octoprint/printer/profile.py @@ -170,7 +170,7 @@ class InvalidProfileError(Exception): """Profile invalid""" pass -class BedFormFactor(object): +class BedFormFactor: """Valid values for bed form factor""" RECTANGULAR = "rectangular" @@ -186,7 +186,7 @@ class BedFormFactor(object): BedTypes = BedFormFactor """Deprecated name of :class:`BedFormFactors`""" -class BedOrigin(object): +class BedOrigin: """Valid values for bed origin""" LOWERLEFT = "lowerleft" @@ -199,7 +199,7 @@ class BedOrigin(object): def values(cls): return [getattr(cls, name) for name in cls.__dict__ if not (name.startswith("__") or name == "values")] -class PrinterProfileManager(object): +class PrinterProfileManager: """ Manager for printer profiles. Offers methods to select the globally used printer profile and to list, add, remove, load and save printer profiles. diff --git a/src/octoprint/printer/standard.py b/src/octoprint/printer/standard.py index 155c74ea2..d952cdc03 100644 --- a/src/octoprint/printer/standard.py +++ b/src/octoprint/printer/standard.py @@ -1448,7 +1448,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback): return result -class StateMonitor(object): +class StateMonitor: def __init__(self, interval=0.5, on_update=None, on_add_temperature=None, on_add_log=None, on_add_message=None, on_get_progress=None): self._interval = interval self._update_callback = on_update diff --git a/src/octoprint/server/__init__.py b/src/octoprint/server/__init__.py index a921e39e1..2374a8944 100644 --- a/src/octoprint/server/__init__.py +++ b/src/octoprint/server/__init__.py @@ -183,7 +183,7 @@ def unauthorized_user(): #~~ startup code -class Server(object): +class Server: def __init__(self, settings=None, plugin_manager=None, connectivity_checker=None, environment_detector=None, event_manager=None, host=None, port=None, v6_only=False, debug=False, safe_mode=False, allow_root=False, octoprint_daemon=None): @@ -2027,7 +2027,7 @@ class Server(object): pass_number += 1 -class LifecycleManager(object): +class LifecycleManager: def __init__(self, plugin_manager): self._plugin_manager = plugin_manager diff --git a/src/octoprint/server/api/__init__.py b/src/octoprint/server/api/__init__.py index 700425422..080d611df 100644 --- a/src/octoprint/server/api/__init__.py +++ b/src/octoprint/server/api/__init__.py @@ -401,7 +401,7 @@ def _test_url(data): import requests from octoprint import util as util - class StatusCodeRange(object): + class StatusCodeRange: def __init__(self, start=None, end=None): self.start = start self.end = end diff --git a/src/octoprint/server/util/flask.py b/src/octoprint/server/util/flask.py index c1030acbc..dfd537b6b 100644 --- a/src/octoprint/server/util/flask.py +++ b/src/octoprint/server/util/flask.py @@ -268,7 +268,7 @@ def fix_flask_jsonify(): #~~ WSGI environment wrapper for reverse proxying -class ReverseProxiedEnvironment(object): +class ReverseProxiedEnvironment: @staticmethod def to_header_candidates(values): @@ -813,7 +813,7 @@ def cache_check_status_code(response, valid): else: return response.status_code not in valid -class PreemptiveCache(object): +class PreemptiveCache: def __init__(self, cachefile): self.cachefile = cachefile diff --git a/src/octoprint/server/util/tornado.py b/src/octoprint/server/util/tornado.py index b1ce65a52..31dfd8b22 100644 --- a/src/octoprint/server/util/tornado.py +++ b/src/octoprint/server/util/tornado.py @@ -594,7 +594,7 @@ def _extended_header_value(value): return octoprint.util.to_unicode(_strip_value_quotes(value), encoding="utf-8") -class WsgiInputContainer(object): +class WsgiInputContainer: """ A WSGI container for use with Tornado that allows supplying the request body to be used for ``wsgi.input`` in the generated WSGI environment upon call. diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index 7f769e3d1..a31b8a13d 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -537,7 +537,7 @@ class HierarchicalChainMap(ChainMap): return cls._hierarchy_for_key(key, node) -class Settings(object): +class Settings: """ The :class:`Settings` class allows managing all of OctoPrint's settings. It takes care of initializing the settings directory, loading the configuration from ``config.yaml``, persisting changes to disk etc and provides access diff --git a/src/octoprint/slicing/__init__.py b/src/octoprint/slicing/__init__.py index 6967d931a..936c89791 100644 --- a/src/octoprint/slicing/__init__.py +++ b/src/octoprint/slicing/__init__.py @@ -34,7 +34,7 @@ from .exceptions import UnknownSlicer, SlicerNotConfigured, SlicingCancelled, \ ProfileAlreadyExists, ProfileException, CouldNotDeleteProfile, UnknownProfile -class SlicingProfile(object): +class SlicingProfile: """ A wrapper for slicing profiles, both meta data and actual profile data. @@ -56,7 +56,7 @@ class SlicingProfile(object): self.default = default -class TemporaryProfile(object): +class TemporaryProfile: """ A wrapper for a temporary slicing profile to be used for a slicing job, based on a :class:`SlicingProfile` with optional ``overrides`` applied through the supplied ``save_profile`` method. @@ -100,7 +100,7 @@ class TemporaryProfile(object): pass -class SlicingManager(object): +class SlicingManager: """ The :class:`SlicingManager` is responsible for managing available slicers and slicing profiles. diff --git a/src/octoprint/timelapse.py b/src/octoprint/timelapse.py index 64aea7417..597bbb317 100644 --- a/src/octoprint/timelapse.py +++ b/src/octoprint/timelapse.py @@ -388,7 +388,7 @@ def configure_timelapse(config=None, persist=False): settings().save() -class Timelapse(object): +class Timelapse: QUEUE_ENTRY_TYPE_CAPTURE = "capture" QUEUE_ENTRY_TYPE_CALLBACK = "callback" @@ -803,7 +803,7 @@ class TimedTimelapse(Timelapse): self._timer = None -class TimelapseRenderJob(object): +class TimelapseRenderJob: render_job_lock = threading.RLock() diff --git a/src/octoprint/util/__init__.py b/src/octoprint/util/__init__.py index c8c041783..77b6373ef 100644 --- a/src/octoprint/util/__init__.py +++ b/src/octoprint/util/__init__.py @@ -1016,7 +1016,7 @@ class DefaultOrderedDict(collections.OrderedDict): collections.OrderedDict.__repr__(self)) -class Object(object): +class Object: pass @@ -1121,7 +1121,7 @@ if hasattr(tempfile, "TemporaryDirectory"): TemporaryDirectory = tempfile.TemporaryDirectory else: # Python 2 - class TemporaryDirectory(object): + class TemporaryDirectory: def __init__(self, suffix='', prefix="tmp", dir=None): self._path = tempfile.mkdtemp(suffix=suffix, prefix=prefix, dir=dir) @@ -1492,7 +1492,7 @@ class ResettableTimer(threading.Thread): self.on_reset() -class CountedEvent(object): +class CountedEvent: def __init__(self, value=0, minimum=0, maximum=None, **kwargs): self._counter = 0 @@ -1550,7 +1550,7 @@ class CountedEvent(object): self._event.set() -class InvariantContainer(object): +class InvariantContainer: def __init__(self, initial_data=None, guarantee_invariant=None): try: from collections import Iterable diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 38c661964..dc01026d7 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -265,7 +265,7 @@ gcodeToEvent = { "M81": Events.POWER_OFF, } -class PositionRecord(object): +class PositionRecord: _standard_attrs = {"x", "y", "z", "e", "f", "t"} @classmethod @@ -300,7 +300,7 @@ class PositionRecord(object): attrs = self._standard_attrs | set(key for key in dir(self) if self.valid_e(key)) return dict((attr, getattr(self, attr)) for attr in attrs) -class TemperatureRecord(object): +class TemperatureRecord: RESERVED_IDENTIFIER_REGEX = re.compile("[0-9]+|[bc]") def __init__(self): @@ -387,7 +387,7 @@ class TemperatureRecord(object): else: return actual, target -class MachineCom(object): +class MachineCom: STATE_NONE = 0 STATE_OPEN_SERIAL = 1 STATE_DETECT_SERIAL = 2 @@ -4030,7 +4030,7 @@ class MachineCom(object): ### MachineCom callback ################################################################################################ -class MachineComPrintCallback(object): +class MachineComPrintCallback: def on_comm_log(self, message): pass @@ -4099,7 +4099,7 @@ class MachineComPrintCallback(object): ### Printing file information classes ################################################################################## -class PrintingFileInformation(object): +class PrintingFileInformation: """ Encapsulates information regarding the current file being printed: file name, current position, total size and time the print started. @@ -5081,7 +5081,7 @@ def _normalize_command_handler_result(command, command_type, gcode, subcode, tag return result -class QueueMarker(object): +class QueueMarker: def __init__(self, callback): self.callback = callback diff --git a/src/octoprint/util/commandline.py b/src/octoprint/util/commandline.py index 9b7b4d3e2..29e5b1471 100644 --- a/src/octoprint/util/commandline.py +++ b/src/octoprint/util/commandline.py @@ -69,7 +69,7 @@ class CommandlineError(Exception): self.stderr = stderr -class CommandlineCaller(object): +class CommandlineCaller: """ The CommandlineCaller is a utility class that allows running command line commands while logging their stdout and stderr via configurable callback functions. diff --git a/src/octoprint/util/connectivity.py b/src/octoprint/util/connectivity.py index 9694ba9a6..f1712971f 100644 --- a/src/octoprint/util/connectivity.py +++ b/src/octoprint/util/connectivity.py @@ -8,7 +8,7 @@ import time from octoprint.util.net import server_reachable, resolve_host -class ConnectivityChecker(object): +class ConnectivityChecker: """ Regularly checks for online connectivity. diff --git a/src/octoprint/util/gcodeInterpreter.py b/src/octoprint/util/gcodeInterpreter.py index 7dadc65c3..99affc911 100644 --- a/src/octoprint/util/gcodeInterpreter.py +++ b/src/octoprint/util/gcodeInterpreter.py @@ -12,7 +12,7 @@ import logging import codecs -class Vector3D(object): +class Vector3D: """ 3D vector value @@ -126,7 +126,7 @@ class Vector3D(object): return "Vector3D(x={}, y={}, z={}, length={})".format(self.x, self.y, self.z, self.length) -class MinMax3D(object): +class MinMax3D: """ Tracks minimum and maximum of recorded values @@ -183,7 +183,7 @@ class AnalysisAborted(Exception): Exception.__init__(self, *args, **kwargs) -class gcode(object): +class gcode: def __init__(self, progress_callback=None): self._logger = logging.getLogger(__name__) self.layerList = None diff --git a/src/octoprint/util/jinja.py b/src/octoprint/util/jinja.py index a9681f38f..bd5847648 100644 --- a/src/octoprint/util/jinja.py +++ b/src/octoprint/util/jinja.py @@ -223,7 +223,7 @@ class ExceptionHandlerExtension(Extension): trycatch = ExceptionHandlerExtension -class MarkdownFilter(object): +class MarkdownFilter: def __init__(self, app, **markdown_options): self._markdown_options = markdown_options diff --git a/src/octoprint/util/json/__init__.py b/src/octoprint/util/json/__init__.py index 2293d5ef0..44ee83d0e 100644 --- a/src/octoprint/util/json/__init__.py +++ b/src/octoprint/util/json/__init__.py @@ -7,7 +7,7 @@ import frozendict from octoprint.util import to_unicode -class JsonEncoding(object): +class JsonEncoding: encoders = collections.OrderedDict()