Commit 20ebea1c authored by Link Mauve's avatar Link Mauve

Stop making classes inherit from object.

parent 3acfd83c
......@@ -39,7 +39,7 @@ from poezio.config import config
log = logging.getLogger(__name__)
class Bookmark(object):
class Bookmark:
def __init__(self,
jid,
name=None,
......@@ -127,7 +127,7 @@ class Bookmark(object):
return Bookmark(jid, name, autojoin, nick, password, method='remote')
class BookmarkList(object):
class BookmarkList:
def __init__(self):
self.bookmarks = []
preferred = config.get('use_bookmarks_method').lower()
......
......@@ -16,7 +16,7 @@ from poezio.common import safeJID
from collections import defaultdict
class Resource(object):
class Resource:
"""
Defines a roster item.
It's a precise resource.
......@@ -54,7 +54,7 @@ class Resource(object):
return self.jid == value.jid and self._data == value._data
class Contact(object):
class Contact:
"""
This a way to gather multiple resources from the same bare JID.
This class contains zero or more Resource object and useful methods
......
......@@ -50,7 +50,7 @@ from poezio.core.structs import POSSIBLE_SHOW, DEPRECATED_ERRORS, \
ERROR_AND_STATUS_CODES, Command, Status
class Core(object):
class Core:
"""
“Main” class of poezion
"""
......
......@@ -5,7 +5,7 @@ Module containing various decorators
from poezio import common
class RefreshWrapper(object):
class RefreshWrapper:
def __init__(self):
self.core = None
......@@ -53,7 +53,7 @@ class RefreshWrapper(object):
refresh_wrapper = RefreshWrapper()
class CommandArgParser(object):
class CommandArgParser:
"""Modify the string argument of the function into a list of strings
containing the right number of extracted arguments, or None if we don’t
have enough.
......
......@@ -10,7 +10,7 @@ http://poezio.eu/doc/en/plugins.html#_poezio_events
"""
class EventHandler(object):
class EventHandler:
"""
A class keeping a list of possible events that are triggered
by poezio. You (a plugin for example) can add an event handler
......
......@@ -33,7 +33,7 @@ class OpenTrick(threading.Thread):
self.fd = open(self.path, 'r', encoding='utf-8')
class Fifo(object):
class Fifo:
"""
Just a simple file handler, writing and reading in a fifo.
Mode is either 'r' or 'w', just like the mode for the open()
......
......@@ -96,7 +96,7 @@ def get_char_list(s):
ret_list.append(key)
class Keyboard(object):
class Keyboard:
def __init__(self):
self.escape = False
......
......@@ -66,7 +66,7 @@ def parse_log_line(msg):
return None
class Logger(object):
class Logger:
"""
Appends things to files. Error/information/warning logs
and also log the conversations to logfiles
......
......@@ -95,7 +95,7 @@ class SafetyMetaclass(type):
return type.__new__(meta, name, bases, class_dict)
class PluginWrap(object):
class PluginWrap:
"""
A wrapper to implicitly pass the module name to PluginAPI
"""
......@@ -110,7 +110,7 @@ class PluginWrap(object):
return partial(getattr(api, name), module)
class PluginAPI(object):
class PluginAPI:
"""
The public API exposed to the plugins.
Its goal is to limit the use of the raw Core object
......
......@@ -18,7 +18,7 @@ from poezio.config import config
log = logging.getLogger(__name__)
class PluginManager(object):
class PluginManager:
"""
Plugin Manager
Contains all the references to the plugins
......
......@@ -21,7 +21,7 @@ from io import StringIO
__all__ = ["shlex", "split", "quote"]
class shlex(object):
class shlex:
"""
A custom version of the shlex in the stdlib to yield more information
"""
......
......@@ -20,7 +20,7 @@ from poezio.common import safeJID
from slixmpp.exceptions import IqError, IqTimeout
class Roster(object):
class Roster:
"""
The proxy class to get the roster from slixmpp.
Caches Contact and RosterGroup objects.
......@@ -261,7 +261,7 @@ class Roster(object):
return True
class RosterGroup(object):
class RosterGroup:
"""
A RosterGroup is a group containing contacts
It can be Friends/Family etc, but also can be
......
......@@ -13,7 +13,7 @@ FULL_WIDTH_DEGRADE = 66
FULL_HEIGHT_DEGRADE = 10
class SizeManager(object):
class SizeManager:
def __init__(self, core):
self._core = core
......
......@@ -86,7 +86,7 @@ SHOW_NAME = {
}
class Tab(object):
class Tab:
plugin_commands = {}
plugin_keys = {}
......
......@@ -24,7 +24,7 @@ from poezio.decorators import command_args_parser, refresh_wrapper
from poezio.common import safeJID
class MatchJID(object):
class MatchJID:
def __init__(self, jid, dest=''):
self.jid = jid
self.dest = dest
......
......@@ -109,7 +109,7 @@ class AckError(Exception):
pass
class TextBuffer(object):
class TextBuffer:
"""
This class just keep trace of messages, in a list with various
information and attributes.
......
......@@ -82,7 +82,7 @@ from importlib import machinery
finder = machinery.PathFinder()
class Theme(object):
class Theme:
"""
The theme class, from which all themes should inherit.
All of the following values can be replaced in subclasses, in
......
......@@ -15,7 +15,7 @@ Once created, they must be added to the list of checked events with
import datetime
class DelayedEvent(object):
class DelayedEvent:
"""
A TimedEvent, but with the date calculated from now + a delay in seconds.
Use it if you want an event to happen in, e.g. 6 seconds.
......
......@@ -22,7 +22,7 @@ log = logging.getLogger(__name__)
ROLE_DICT = {'': 0, 'none': 0, 'visitor': 1, 'participant': 2, 'moderator': 3}
class User(object):
class User:
"""
keep trace of an user in a Room
"""
......
......@@ -23,7 +23,7 @@ FORMAT_CHAR = '\x19'
format_chars = '\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x1A'
class DummyWin(object):
class DummyWin:
def __getattribute__(self, name):
if name != '__bool__':
return lambda *args, **kwargs: (0, 0)
......@@ -34,7 +34,7 @@ class DummyWin(object):
return False
class Win(object):
class Win:
def __init__(self):
self._win = None
self.height, self.width = 0, 0
......
......@@ -13,7 +13,7 @@ from poezio.windows.inputs import Input
from poezio.theming import to_curses_attr, get_theme
class FieldInput(object):
class FieldInput:
"""
All input types in a data form should inherit this class,
in addition with windows.Input or any relevant class from the
......@@ -345,7 +345,7 @@ class TextPrivateWin(TextSingleWin):
return 'Edit the secret text'
class FormWin(object):
class FormWin:
"""
A window, with some subwins (the various inputs).
On init, create all the subwins.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment