Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use super() when calling base class

  • Loading branch information...
commit 2a7c50ee5f05a152f20e5f48c2492df45930b108 1 parent 70ac6ec
@erijo authored
Showing with 16 additions and 12 deletions.
  1. +4 −4 svndump/dumpfile.py
  2. +11 −7 svndump/record.py
  3. +1 −1  svndump/section.py
View
8 svndump/dumpfile.py
@@ -21,7 +21,7 @@
class DumpFileError(Exception):
def __init__(self, offset, last_line, message):
- Exception.__init__(self)
+ super(DumpFileError, self).__init__()
self._offset = offset
self._last_line = last_line
self._message = message
@@ -32,13 +32,13 @@ def __str__(self):
class DumpFile(object):
def __init__(self, file, mode, codec):
- object.__init__(self)
+ super(DumpFile, self).__init__()
self._buffer = io.open(file, mode=mode, closefd=False)
self._codec = codec
class DumpFileReader(DumpFile):
def __init__(self, file, codec='ascii'):
- DumpFile.__init__(self, file, 'rb', codec=codec)
+ super(DumpFileReader, self).__init__(file, 'rb', codec=codec)
self._record = None
self._offset = 0
self._last_line = ""
@@ -99,7 +99,7 @@ def read(self, length, caller=None):
class DumpFileWriter(DumpFile):
def __init__(self, file, codec='ascii'):
- DumpFile.__init__(self, file, 'wb', codec=codec)
+ super(DumpFileWriter, self).__init__(file, 'wb', codec=codec)
def writeline(self, line=""):
data = "%s\n" % line
View
18 svndump/record.py
@@ -19,7 +19,7 @@
class Record(object):
def __init__(self, headers):
- object.__init__(self)
+ super(Record, self).__init__()
self.headers = headers
def discard(self):
@@ -45,11 +45,12 @@ def read(stream):
stream.error("unknown record");
+
class VersionStampRecord(Record):
VERSION_HEADER = "SVN-fs-dump-format-version"
def __init__(self, headers):
- Record.__init__(self, headers)
+ super(VersionStampRecord, self).__init__(headers)
version = self.headers[self.VERSION_HEADER]
if int(version) < 2:
raise ValueError("unknown version '%s'" % version)
@@ -58,23 +59,25 @@ def __init__(self, headers):
def read(headers, stream):
return VersionStampRecord(headers)
+
class UuidRecord(Record):
UUID_HEADER = "UUID"
def __init__(self, headers):
- Record.__init__(self, headers)
+ super(UuidRecord, self).__init__(headers)
@staticmethod
def read(headers, stream):
return UuidRecord(headers)
+
class RevisionRecord(Record):
REVISION_NUMBER_HEADER = "Revision-number"
PROP_CONTENT_LENGTH = "Prop-content-length"
CONTENT_LENGTH = "Content-length"
def __init__(self, headers, properties):
- Record.__init__(self, headers)
+ super(RevisionRecord, self).__init__(headers)
self.properties = properties
def write(self, stream):
@@ -82,7 +85,7 @@ def write(self, stream):
self.headers[self.PROP_CONTENT_LENGTH] = prop_length
self.headers[self.CONTENT_LENGTH] = prop_length
- Record.write(self, stream)
+ super(RevisionRecord, self).write(stream)
self.properties.write(stream)
stream.writeline()
@@ -91,6 +94,7 @@ def read(headers, stream):
properties = PropertySection.read(stream)
return RevisionRecord(headers, properties)
+
class NodeRecord(Record):
NODE_PATH_HEADER = "Node-path"
NODE_KIND = "Node-kind"
@@ -112,7 +116,7 @@ class NodeRecord(Record):
TEXT_CONTENT_SHA1 = "Text-content-sha1"
def __init__(self, headers, properties, content):
- Record.__init__(self, headers)
+ super(NodeRecord, self).__init__(headers)
self.properties = properties
self.content = content
@@ -134,7 +138,7 @@ def write(self, stream):
if self.properties is not None or self.content is not None:
self.headers[self.CONTENT_LENGTH] = prop_length + text_length
- Record.write(self, stream)
+ super(NodeRecord, self).write(stream)
if self.properties is not None:
self.properties.write(stream)
View
2  svndump/section.py
@@ -111,7 +111,7 @@ class Content(object):
CHUNK_SIZE = 2048
def __init__(self, stream, length):
- object.__init__(self)
+ super(Content, self).__init__()
self.stream = stream
self.length = int(length)
self.stream.block(self)
Please sign in to comment.
Something went wrong with that request. Please try again.