Use "super" when calling parent class // Issue #895

This commit is contained in:
Ivan Kravets
2018-10-27 15:24:10 +03:00
parent 2007491be9
commit 5c278b54f7
5 changed files with 11 additions and 10 deletions

View File

@@ -39,11 +39,12 @@ PIOPLUS_AUTO_UPDATES_MAX = 100
class CorePackageManager(PackageManager):
def __init__(self):
PackageManager.__init__(self, join(util.get_home_dir(), "packages"), [
"https://dl.bintray.com/platformio/dl-packages/manifest.json",
"http%s://dl.platformio.org/packages/manifest.json" %
("" if sys.version_info < (2, 7, 9) else "s")
])
super(CorePackageManager, self).__init__(
join(util.get_home_dir(), "packages"), [
"https://dl.bintray.com/platformio/dl-packages/manifest.json",
"http%s://dl.platformio.org/packages/manifest.json" %
("" if sys.version_info < (2, 7, 9) else "s")
])
def install( # pylint: disable=keyword-arg-before-vararg
self,

View File

@@ -32,7 +32,7 @@ class LibraryManager(BasePkgManager):
def __init__(self, package_dir=None):
if not package_dir:
package_dir = join(util.get_home_dir(), "lib")
BasePkgManager.__init__(self, package_dir)
super(LibraryManager, self).__init__(package_dir)
@property
def manifest_names(self):

View File

@@ -61,7 +61,7 @@ class MeasurementProtocol(TelemetryBase):
}
def __init__(self):
TelemetryBase.__init__(self)
super(MeasurementProtocol, self).__init__()
self['v'] = 1
self['tid'] = self.TID
self['cid'] = app.get_cid()

View File

@@ -48,7 +48,7 @@ class ArchiveBase(object):
class TARArchive(ArchiveBase):
def __init__(self, archpath):
ArchiveBase.__init__(self, tarfile_open(archpath))
super(TARArchive, self).__init__(tarfile_open(archpath))
def get_items(self):
return self._afo.getmembers()
@@ -60,7 +60,7 @@ class TARArchive(ArchiveBase):
class ZIPArchive(ArchiveBase):
def __init__(self, archpath):
ArchiveBase.__init__(self, ZipFile(archpath))
super(ZIPArchive, self).__init__(ZipFile(archpath))
@staticmethod
def preserve_permissions(item, dest_dir):

View File

@@ -78,7 +78,7 @@ class ProjectConfig(ConfigParser.ConfigParser):
class AsyncPipe(Thread):
def __init__(self, outcallback=None):
Thread.__init__(self)
super(AsyncPipe, self).__init__()
self.outcallback = outcallback
self._fd_read, self._fd_write = os.pipe()