Skip to content

Commit 12a6bb8

Browse files
committed
rfctr: remove obsolete inherit-from-object
1 parent 44f9ede commit 12a6bb8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+178
-178
lines changed

src/docx/enum/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Enumerations used in python-docx."""
22

33

4-
class Enumeration(object):
4+
class Enumeration:
55
@classmethod
66
def from_xml(cls, xml_val):
77
return cls._xml_to_idx[xml_val]

src/docx/image/constants.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Constants specific the the image sub-package."""
22

33

4-
class JPEG_MARKER_CODE(object):
4+
class JPEG_MARKER_CODE:
55
"""JPEG marker codes."""
66

77
TEM = b"\x01"
@@ -97,7 +97,7 @@ def is_standalone(cls, marker_code):
9797
return marker_code in cls.STANDALONE_MARKERS
9898

9999

100-
class MIME_TYPE(object):
100+
class MIME_TYPE:
101101
"""Image content types."""
102102

103103
BMP = "image/bmp"
@@ -107,15 +107,15 @@ class MIME_TYPE(object):
107107
TIFF = "image/tiff"
108108

109109

110-
class PNG_CHUNK_TYPE(object):
110+
class PNG_CHUNK_TYPE:
111111
"""PNG chunk type names."""
112112

113113
IHDR = "IHDR"
114114
pHYs = "pHYs"
115115
IEND = "IEND"
116116

117117

118-
class TIFF_FLD_TYPE(object):
118+
class TIFF_FLD_TYPE:
119119
"""Tag codes for TIFF Image File Directory (IFD) entries."""
120120

121121
BYTE = 1
@@ -136,7 +136,7 @@ class TIFF_FLD_TYPE(object):
136136
TIFF_FLD = TIFF_FLD_TYPE
137137

138138

139-
class TIFF_TAG(object):
139+
class TIFF_TAG:
140140
"""Tag codes for TIFF Image File Directory (IFD) entries."""
141141

142142
IMAGE_WIDTH = 0x0100

src/docx/image/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
LITTLE_ENDIAN = "<"
77

88

9-
class StreamReader(object):
9+
class StreamReader:
1010
"""Wraps a file-like object to provide access to structured data from a binary file.
1111
1212
Byte-order is configurable. `base_offset` is added to any base value provided to

src/docx/image/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def read_32(stream):
185185
raise UnrecognizedImageError
186186

187187

188-
class BaseImageHeader(object):
188+
class BaseImageHeader:
189189
"""Base class for image header subclasses like |Jpeg| and |Tiff|."""
190190

191191
def __init__(self, px_width, px_height, horz_dpi, vert_dpi):

src/docx/image/jpeg.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def from_stream(cls, stream):
6161
return cls(px_width, px_height, horz_dpi, vert_dpi)
6262

6363

64-
class _JfifMarkers(object):
64+
class _JfifMarkers:
6565
"""Sequence of markers in a JPEG file, perhaps truncated at first SOS marker for
6666
performance reasons."""
6767

@@ -125,7 +125,7 @@ def sof(self):
125125
raise KeyError("no start of frame (SOFn) marker in image")
126126

127127

128-
class _MarkerParser(object):
128+
class _MarkerParser:
129129
"""Service class that knows how to parse a JFIF stream and iterate over its
130130
markers."""
131131

@@ -152,7 +152,7 @@ def iter_markers(self):
152152
start = segment_offset + marker.segment_length
153153

154154

155-
class _MarkerFinder(object):
155+
class _MarkerFinder:
156156
"""Service class that knows how to find the next JFIF marker in a stream."""
157157

158158
def __init__(self, stream):
@@ -239,7 +239,7 @@ def _MarkerFactory(marker_code, stream, offset):
239239
return marker_cls.from_stream(stream, marker_code, offset)
240240

241241

242-
class _Marker(object):
242+
class _Marker:
243243
"""Base class for JFIF marker classes.
244244
245245
Represents a marker and its segment occuring in a JPEG byte stream.

src/docx/image/png.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def from_stream(cls, stream):
3232
return cls(px_width, px_height, horz_dpi, vert_dpi)
3333

3434

35-
class _PngParser(object):
35+
class _PngParser:
3636
"""Parses a PNG image stream to extract the image properties found in its chunks."""
3737

3838
def __init__(self, chunks):
@@ -89,7 +89,7 @@ def _dpi(units_specifier, px_per_unit):
8989
return 72
9090

9191

92-
class _Chunks(object):
92+
class _Chunks:
9393
"""Collection of the chunks parsed from a PNG image stream."""
9494

9595
def __init__(self, chunk_iterable):
@@ -126,7 +126,7 @@ def _find_first(self, match):
126126
return None
127127

128128

129-
class _ChunkParser(object):
129+
class _ChunkParser:
130130
"""Extracts chunks from a PNG image stream."""
131131

132132
def __init__(self, stream_rdr):
@@ -176,7 +176,7 @@ def _ChunkFactory(chunk_type, stream_rdr, offset):
176176
return chunk_cls.from_offset(chunk_type, stream_rdr, offset)
177177

178178

179-
class _Chunk(object):
179+
class _Chunk:
180180
"""Base class for specific chunk types.
181181
182182
Also serves as the default chunk type.

src/docx/image/tiff.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def from_stream(cls, stream):
3434
return cls(px_width, px_height, horz_dpi, vert_dpi)
3535

3636

37-
class _TiffParser(object):
37+
class _TiffParser:
3838
"""Parses a TIFF image stream to extract the image properties found in its main
3939
image file directory (IFD)"""
4040

@@ -119,7 +119,7 @@ def _make_stream_reader(cls, stream):
119119
return StreamReader(stream, endian)
120120

121121

122-
class _IfdEntries(object):
122+
class _IfdEntries:
123123
"""Image File Directory for a TIFF image, having mapping (dict) semantics allowing
124124
"tag" values to be retrieved by tag code."""
125125

@@ -149,7 +149,7 @@ def get(self, tag_code, default=None):
149149
return self._entries.get(tag_code, default)
150150

151151

152-
class _IfdParser(object):
152+
class _IfdParser:
153153
"""Service object that knows how to extract directory entries from an Image File
154154
Directory (IFD)"""
155155

@@ -186,7 +186,7 @@ def _IfdEntryFactory(stream_rdr, offset):
186186
return EntryCls.from_stream(stream_rdr, offset)
187187

188188

189-
class _IfdEntry(object):
189+
class _IfdEntry:
190190
"""Base class for IFD entry classes.
191191
192192
Subclasses are differentiated by value type, e.g. ASCII, long int, etc.

src/docx/opc/constants.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55

66

7-
class CONTENT_TYPE(object):
7+
class CONTENT_TYPE:
88
"""Content type URIs (like MIME-types) that specify a part's format."""
99

1010
BMP = "image/bmp"
@@ -251,7 +251,7 @@ class CONTENT_TYPE(object):
251251
X_WMF = "image/x-wmf"
252252

253253

254-
class NAMESPACE(object):
254+
class NAMESPACE:
255255
"""Constant values for OPC XML namespaces."""
256256

257257
DML_WORDPROCESSING_DRAWING = (
@@ -265,14 +265,14 @@ class NAMESPACE(object):
265265
WML_MAIN = "http://schemas.openxmlformats.org/wordprocessingml/2006/main"
266266

267267

268-
class RELATIONSHIP_TARGET_MODE(object):
268+
class RELATIONSHIP_TARGET_MODE:
269269
"""Open XML relationship target modes."""
270270

271271
EXTERNAL = "External"
272272
INTERNAL = "Internal"
273273

274274

275-
class RELATIONSHIP_TYPE(object):
275+
class RELATIONSHIP_TYPE:
276276
AUDIO = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio"
277277
A_F_CHUNK = (
278278
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk"

src/docx/opc/coreprops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55

66

7-
class CoreProperties(object):
7+
class CoreProperties:
88
"""Corresponds to part named ``/docProps/core.xml``, containing the core document
99
properties for this document package."""
1010

src/docx/opc/package.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from docx.opc.shared import lazyproperty
1111

1212

13-
class OpcPackage(object):
13+
class OpcPackage:
1414
"""Main API class for |python-opc|.
1515
1616
A new instance is constructed by calling the :meth:`open` class method with a path
@@ -164,7 +164,7 @@ def _core_properties_part(self):
164164
return core_properties_part
165165

166166

167-
class Unmarshaller(object):
167+
class Unmarshaller:
168168
"""Hosts static methods for unmarshalling a package from a |PackageReader|."""
169169

170170
@staticmethod

0 commit comments

Comments
 (0)