Do not make object inheritance
This patch removes these lintian warnings: Warning R0205: Class 'X' inherits from object, can be safely removed from bases in python3 (useless-object-inheritance)
This commit is contained in:
parent
ddfc2a766c
commit
e77440552c
@ -39,7 +39,7 @@ def goTo(path):
|
||||
return False
|
||||
|
||||
|
||||
class Author(object):
|
||||
class Author():
|
||||
def __init__(self, name, count, email):
|
||||
self.name = name
|
||||
self.count = count
|
||||
@ -55,7 +55,7 @@ class Author(object):
|
||||
return self.email
|
||||
|
||||
|
||||
class Git(object):
|
||||
class Git():
|
||||
@staticmethod
|
||||
def getShortlog(ref):
|
||||
shortlog = ""
|
||||
@ -199,7 +199,7 @@ class Git(object):
|
||||
chdir(topLevel)
|
||||
|
||||
|
||||
class OfflineimapInfo(object):
|
||||
class OfflineimapInfo():
|
||||
def getVersion(self):
|
||||
cmd = shlex.split("./offlineimap.py --version")
|
||||
return run(cmd).rstrip().decode(FS_ENCODING)
|
||||
@ -209,7 +209,7 @@ class OfflineimapInfo(object):
|
||||
|
||||
|
||||
|
||||
class User(object):
|
||||
class User():
|
||||
"""Interact with the user."""
|
||||
|
||||
@staticmethod
|
||||
@ -235,7 +235,7 @@ class User(object):
|
||||
return False
|
||||
|
||||
|
||||
class Tester(object):
|
||||
class Tester():
|
||||
def __init__(self, name, email, feedback):
|
||||
self.name = name
|
||||
self.email = email
|
||||
@ -264,7 +264,7 @@ class Tester(object):
|
||||
self.feedback = not self.feedback
|
||||
|
||||
|
||||
class Testers(object):
|
||||
class Testers():
|
||||
def __init__(self):
|
||||
self.testers = None
|
||||
self._read()
|
||||
|
@ -89,7 +89,7 @@ Have fun! ,-)
|
||||
"""
|
||||
|
||||
|
||||
class State(object):
|
||||
class State():
|
||||
def __init__(self):
|
||||
self.master = None
|
||||
self.next = None
|
||||
@ -129,7 +129,7 @@ class State(object):
|
||||
goTo('..')
|
||||
|
||||
|
||||
class Changelog(object):
|
||||
class Changelog():
|
||||
def __init__(self):
|
||||
self.shouldUsePrevious = False
|
||||
|
||||
@ -214,7 +214,7 @@ class Changelog(object):
|
||||
return dict_Content
|
||||
|
||||
|
||||
class Announce(object):
|
||||
class Announce():
|
||||
def __init__(self, version):
|
||||
self.fd = open(ANNOUNCE_FILE, 'w')
|
||||
self.version = version
|
||||
@ -258,7 +258,7 @@ Pip:
|
||||
self.fd.close()
|
||||
|
||||
|
||||
class Website(object):
|
||||
class Website():
|
||||
def updateUploads(self):
|
||||
req = ("add new archive to uploads/ on the website? "
|
||||
"(warning: checksums will change if it already exists)")
|
||||
@ -333,7 +333,7 @@ Then, commit and push changes of the website.""".format(SPHINXBUILD, DOCSDIR)))
|
||||
return branchName
|
||||
|
||||
|
||||
class Release(object):
|
||||
class Release():
|
||||
def __init__(self):
|
||||
self.state = State()
|
||||
self.offlineimapInfo = OfflineimapInfo()
|
||||
|
@ -14,7 +14,7 @@ import argparse
|
||||
from helpers import CACHEDIR, EDITOR, Testers, User, Git
|
||||
|
||||
|
||||
class App(object):
|
||||
class App():
|
||||
def __init__(self):
|
||||
self.args = None
|
||||
self.testers = Testers()
|
||||
|
@ -157,7 +157,7 @@ def CustomConfigDefault():
|
||||
pass
|
||||
|
||||
|
||||
class ConfigHelperMixin(object):
|
||||
class ConfigHelperMixin():
|
||||
"""Allow comfortable retrieving of config values pertaining
|
||||
to a section.
|
||||
|
||||
|
@ -26,7 +26,7 @@ from offlineimap.error import OfflineImapError
|
||||
import offlineimap.accounts
|
||||
|
||||
|
||||
class BaseFolder(object):
|
||||
class BaseFolder():
|
||||
__hash__ = None
|
||||
|
||||
def __init__(self, name, repository):
|
||||
|
@ -25,7 +25,7 @@ import six
|
||||
from .Base import BaseFolder
|
||||
|
||||
|
||||
class DatabaseFileLock(object):
|
||||
class DatabaseFileLock():
|
||||
"""Lock at database file level."""
|
||||
|
||||
def __init__(self):
|
||||
|
@ -32,7 +32,7 @@ from offlineimap.ui import getglobalui
|
||||
from offlineimap.virtual_imaplib2 import IMAP4, IMAP4_SSL, InternalDate
|
||||
|
||||
|
||||
class UsefulIMAPMixIn(object):
|
||||
class UsefulIMAPMixIn():
|
||||
def __getselectedfolder(self):
|
||||
if self.state == 'SELECTED':
|
||||
return self.mailbox
|
||||
|
@ -42,7 +42,7 @@ except ImportError:
|
||||
have_gss = False
|
||||
|
||||
|
||||
class IMAPServer(object):
|
||||
class IMAPServer():
|
||||
"""Initializes all variables from an IMAPRepository() instance
|
||||
|
||||
Various functions, such as acquireconnection() return an IMAP4
|
||||
@ -770,7 +770,7 @@ class IMAPServer(object):
|
||||
self.semaphore.release()
|
||||
|
||||
|
||||
class IdleThread(object):
|
||||
class IdleThread():
|
||||
def __init__(self, parent, folder=None):
|
||||
"""If invoked without 'folder', perform a NOOP and wait for
|
||||
self.stop() to be called. If invoked with folder, switch to IDLE
|
||||
|
@ -62,7 +62,7 @@ def syncitall(list_accounts, config):
|
||||
threads.wait() # Blocks until all accounts are processed.
|
||||
|
||||
|
||||
class OfflineImap(object):
|
||||
class OfflineImap():
|
||||
"""The main class that encapsulates the high level use of OfflineImap.
|
||||
|
||||
To invoke OfflineImap you would call it with::
|
||||
|
@ -19,7 +19,7 @@
|
||||
import imp
|
||||
|
||||
|
||||
class LocalEval(object):
|
||||
class LocalEval():
|
||||
"""Here is a powerfull but very dangerous option, of course."""
|
||||
|
||||
def __init__(self, path=None):
|
||||
|
@ -78,7 +78,7 @@ def writeIntermediateFile(accountname):
|
||||
_mbnames.write()
|
||||
|
||||
|
||||
class _IntermediateMbnames(object):
|
||||
class _IntermediateMbnames():
|
||||
"""mbnames data for one account."""
|
||||
|
||||
def __init__(self, accountname, folder_root, mbnamesdir, folderfilter,
|
||||
@ -120,7 +120,7 @@ class _IntermediateMbnames(object):
|
||||
json.dump(itemlist, intermediateFD)
|
||||
|
||||
|
||||
class _Mbnames(object):
|
||||
class _Mbnames():
|
||||
def __init__(self, config, ui, dry_run):
|
||||
|
||||
self._config = config
|
||||
|
@ -510,7 +510,7 @@ class IMAPRepository(BaseRepository):
|
||||
"""Converts a cmp= function into a key= function
|
||||
We need to keep cmp functions for backward compatibility"""
|
||||
|
||||
class K(object):
|
||||
class K():
|
||||
def __init__(self, obj, *args):
|
||||
self.obj = obj
|
||||
|
||||
|
@ -30,7 +30,7 @@ from offlineimap.repository.LocalStatus import LocalStatusRepository
|
||||
from offlineimap.error import OfflineImapError
|
||||
|
||||
|
||||
class Repository(object):
|
||||
class Repository():
|
||||
"""Abstract class that returns the correct Repository type
|
||||
instance based on 'account' and 'reqtype', e.g. a
|
||||
class:`ImapRepository` instance."""
|
||||
|
@ -37,7 +37,7 @@ def semaphorereset(semaphore, originalstate):
|
||||
semaphore.release()
|
||||
|
||||
|
||||
class accountThreads(object):
|
||||
class accountThreads():
|
||||
"""Store the list of all threads in the software so it can be used to find out
|
||||
what's running and what's not."""
|
||||
|
||||
|
@ -50,7 +50,7 @@ def getglobalui():
|
||||
return globalui
|
||||
|
||||
|
||||
class UIBase(object):
|
||||
class UIBase():
|
||||
def __init__(self, config, loglevel=logging.INFO):
|
||||
self.config = config
|
||||
# Is this a 'dryrun'?
|
||||
|
@ -6,7 +6,7 @@
|
||||
import copy
|
||||
|
||||
|
||||
class ConstProxy(object):
|
||||
class ConstProxy():
|
||||
"""Implements read-only access to a given object
|
||||
that can be attached to each instance only once."""
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user