diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2019-05-27 18:31:47 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2019-05-27 18:31:47 +0100 |
commit | dff018e7cb6c885433e1e91fe0e5162e1e329301 (patch) | |
tree | 134e5229f87ae6e813368057260c404d93e4e6aa /alot | |
parent | 7f800370151466fb07db1eba4b3b343cbd03561c (diff) |
remove old new-style classes syntax
Python3 only supports "new-style" classes (those extending object),
and we don't need to explicitly inherit from this root class any more.
See http://pylint-messages.wikidot.com/messages:c1001
Diffstat (limited to 'alot')
-rw-r--r-- | alot/account.py | 4 | ||||
-rw-r--r-- | alot/addressbook/__init__.py | 2 | ||||
-rw-r--r-- | alot/buffers/buffer.py | 2 | ||||
-rw-r--r-- | alot/commands/__init__.py | 5 | ||||
-rw-r--r-- | alot/completion.py | 2 | ||||
-rw-r--r-- | alot/db/attachment.py | 3 | ||||
-rw-r--r-- | alot/db/envelope.py | 5 | ||||
-rw-r--r-- | alot/db/manager.py | 3 | ||||
-rw-r--r-- | alot/db/message.py | 3 | ||||
-rw-r--r-- | alot/db/thread.py | 2 | ||||
-rw-r--r-- | alot/errors.py | 2 | ||||
-rw-r--r-- | alot/settings/manager.py | 2 | ||||
-rw-r--r-- | alot/settings/theme.py | 2 | ||||
-rw-r--r-- | alot/ui.py | 2 | ||||
-rw-r--r-- | alot/utils/cached_property.py | 4 |
15 files changed, 20 insertions, 23 deletions
diff --git a/alot/account.py b/alot/account.py index f4a360a4..8a32a85c 100644 --- a/alot/account.py +++ b/alot/account.py @@ -15,7 +15,7 @@ from .helper import call_cmd_async from .helper import split_commandstring -class Address(object): +class Address: """A class that represents an email address. @@ -160,7 +160,7 @@ class StoreMailError(Exception): pass -class Account(object): +class Account: """ Datastructure that represents an email account. It manages this account's settings, can send and store mails to maildirs (drafts/send). diff --git a/alot/addressbook/__init__.py b/alot/addressbook/__init__.py index cd302218..4e733efd 100644 --- a/alot/addressbook/__init__.py +++ b/alot/addressbook/__init__.py @@ -9,7 +9,7 @@ class AddressbookError(Exception): pass -class AddressBook(object): +class AddressBook: """can look up email addresses and realnames for contacts. .. note:: diff --git a/alot/buffers/buffer.py b/alot/buffers/buffer.py index fc0e7af7..38aff329 100644 --- a/alot/buffers/buffer.py +++ b/alot/buffers/buffer.py @@ -3,7 +3,7 @@ # For further details see the COPYING file -class Buffer(object): +class Buffer: """Abstract base class for buffers.""" modename = None # mode identifier for subclasses diff --git a/alot/commands/__init__.py b/alot/commands/__init__.py index c1662073..1e16b4d4 100644 --- a/alot/commands/__init__.py +++ b/alot/commands/__init__.py @@ -11,7 +11,7 @@ from ..settings.const import settings from ..helper import split_commandstring, string_decode -class Command(object): +class Command: """base class for commands""" repeatable = False @@ -90,8 +90,7 @@ class CommandArgumentParser(argparse.ArgumentParser): raise CommandParseError(message) -class registerCommand(object): - +class registerCommand: """ Decorator used to register a :class:`Command` as handler for command `name` in `mode` so that it diff --git a/alot/completion.py b/alot/completion.py index 8eb46448..83eab6a5 100644 --- a/alot/completion.py +++ b/alot/completion.py @@ -20,7 +20,7 @@ from .errors import CompletionError from .utils.cached_property import cached_property -class Completer(object): +class Completer: """base class for completers""" __metaclass__ = abc.ABCMeta diff --git a/alot/db/attachment.py b/alot/db/attachment.py index 73fbf093..d8651116 100644 --- a/alot/db/attachment.py +++ b/alot/db/attachment.py @@ -13,8 +13,7 @@ from .utils import decode_header charset.add_charset('utf-8', charset.QP, charset.QP, 'utf-8') -class Attachment(object): - +class Attachment: """represents a mail attachment""" def __init__(self, emailpart): diff --git a/alot/db/envelope.py b/alot/db/envelope.py index b68e683f..35aa0fee 100644 --- a/alot/db/envelope.py +++ b/alot/db/envelope.py @@ -24,9 +24,10 @@ from ..errors import GPGProblem, GPGCode charset.add_charset('utf-8', charset.QP, charset.QP, 'utf-8') -class Envelope(object): +class Envelope: + """ + a message that is not yet sent and still editable. - """a message that is not yet sent and still editable. It holds references to unencoded! body text and mail headers among other things. Envelope implements the python container API for easy access of header values. So `e['To']`, `e['To'] = 'foo@bar.baz'` and diff --git a/alot/db/manager.py b/alot/db/manager.py index 941d5c62..ed1a8d00 100644 --- a/alot/db/manager.py +++ b/alot/db/manager.py @@ -65,8 +65,7 @@ class FillPipeProcess(multiprocessing.Process): self.pipe.close() -class DBManager(object): - +class DBManager: """ Keeps track of your index parameters, maintains a write-queue and lets you look up threads and messages directly to the persistent wrapper diff --git a/alot/db/message.py b/alot/db/message.py index b9a474d7..76bb9dd0 100644 --- a/alot/db/message.py +++ b/alot/db/message.py @@ -25,8 +25,7 @@ MISSING_HTML_MSG = ("This message contains a text/html part that was not " @functools.total_ordering -class Message(object): - +class Message: """ a persistent notmuch message object. It it uses a :class:`~alot.db.DBManager` for cached manipulation diff --git a/alot/db/thread.py b/alot/db/thread.py index 0943d815..1dd78622 100644 --- a/alot/db/thread.py +++ b/alot/db/thread.py @@ -7,7 +7,7 @@ from .message import Message from ..settings.const import settings -class Thread(object): +class Thread: """ A wrapper around a notmuch mailthread (:class:`notmuch.database.Thread`) that ensures persistence of the thread: It can be safely read multiple diff --git a/alot/errors.py b/alot/errors.py index b9763192..0df10adc 100644 --- a/alot/errors.py +++ b/alot/errors.py @@ -3,7 +3,7 @@ # For further details see the COPYING file -class GPGCode(object): +class GPGCode: AMBIGUOUS_NAME = 1 NOT_FOUND = 2 BAD_PASSPHRASE = 3 diff --git a/alot/settings/manager.py b/alot/settings/manager.py index c88d7d85..64167c37 100644 --- a/alot/settings/manager.py +++ b/alot/settings/manager.py @@ -27,7 +27,7 @@ DATA_DIRS = get_xdg_env('XDG_DATA_DIRS', '/usr/local/share:/usr/share').split(':') -class SettingsManager(object): +class SettingsManager: """Organizes user settings""" def __init__(self): self.hooks = None diff --git a/alot/settings/theme.py b/alot/settings/theme.py index e6d6eae8..2794be2c 100644 --- a/alot/settings/theme.py +++ b/alot/settings/theme.py @@ -11,7 +11,7 @@ DEFAULTSPATH = os.path.join(os.path.dirname(__file__), '..', 'defaults') DUMMYDEFAULT = ('default',) * 6 -class Theme(object): +class Theme: """Colour theme""" def __init__(self, path): """ @@ -34,7 +34,7 @@ async def periodic(callable_, period, *args, **kwargs): await asyncio.sleep(period) -class UI(object): +class UI: """ This class integrates all components of alot and offers methods for user interaction like :meth:`prompt`, :meth:`notify` etc. diff --git a/alot/utils/cached_property.py b/alot/utils/cached_property.py index 680cd6f4..3ad66413 100644 --- a/alot/utils/cached_property.py +++ b/alot/utils/cached_property.py @@ -34,13 +34,13 @@ _missing = object() -class cached_property(object): +class cached_property: """A decorator that converts a function into a lazy property. The function wrapped is called the first time to retrieve the result and then that calculated result is used the next time you access the value:: - class Foo(object): + class Foo: @cached_property def foo(self): |