bpo-30178: Indent methods and attributes of MimeType class (GH-1306) · python/cpython@c711680 (original) (raw)

`@@ -186,78 +186,78 @@ than one MIME-type database; it provides an interface similar to the one of the

`

186

186

` loaded "on top" of the default database.

`

187

187

``

188

188

``

189

``

`-

.. attribute:: MimeTypes.suffix_map

`

``

189

`+

.. attribute:: MimeTypes.suffix_map

`

190

190

``

191

``

`-

Dictionary mapping suffixes to suffixes. This is used to allow recognition of

`

192

``

`-

encoded files for which the encoding and the type are indicated by the same

`

193

``

`` -

extension. For example, the :file:.tgz extension is mapped to :file:.tar.gz

``

194

``

`-

to allow the encoding and type to be recognized separately. This is initially a

`

195

``

`` -

copy of the global :data:suffix_map defined in the module.

``

``

191

`+

Dictionary mapping suffixes to suffixes. This is used to allow recognition of

`

``

192

`+

encoded files for which the encoding and the type are indicated by the same

`

``

193

`` +

extension. For example, the :file:.tgz extension is mapped to :file:.tar.gz

``

``

194

`+

to allow the encoding and type to be recognized separately. This is initially a

`

``

195

`` +

copy of the global :data:suffix_map defined in the module.

``

196

196

``

197

197

``

198

``

`-

.. attribute:: MimeTypes.encodings_map

`

``

198

`+

.. attribute:: MimeTypes.encodings_map

`

199

199

``

200

``

`-

Dictionary mapping filename extensions to encoding types. This is initially a

`

201

``

`` -

copy of the global :data:encodings_map defined in the module.

``

``

200

`+

Dictionary mapping filename extensions to encoding types. This is initially a

`

``

201

`` +

copy of the global :data:encodings_map defined in the module.

``

202

202

``

203

203

``

204

``

`-

.. attribute:: MimeTypes.types_map

`

``

204

`+

.. attribute:: MimeTypes.types_map

`

205

205

``

206

``

`-

Tuple containing two dictionaries, mapping filename extensions to MIME types:

`

207

``

`-

the first dictionary is for the non-standards types and the second one is for

`

208

``

`` -

the standard types. They are initialized by :data:common_types and

``

209

``

`` -

:data:types_map.

``

``

206

`+

Tuple containing two dictionaries, mapping filename extensions to MIME types:

`

``

207

`+

the first dictionary is for the non-standards types and the second one is for

`

``

208

`` +

the standard types. They are initialized by :data:common_types and

``

``

209

`` +

:data:types_map.

``

210

210

``

211

211

``

212

``

`-

.. attribute:: MimeTypes.types_map_inv

`

``

212

`+

.. attribute:: MimeTypes.types_map_inv

`

213

213

``

214

``

`-

Tuple containing two dictionaries, mapping MIME types to a list of filename

`

215

``

`-

extensions: the first dictionary is for the non-standards types and the

`

216

``

`-

second one is for the standard types. They are initialized by

`

217

``

`` -

:data:common_types and :data:types_map.

``

``

214

`+

Tuple containing two dictionaries, mapping MIME types to a list of filename

`

``

215

`+

extensions: the first dictionary is for the non-standards types and the

`

``

216

`+

second one is for the standard types. They are initialized by

`

``

217

`` +

:data:common_types and :data:types_map.

``

218

218

``

219

219

``

220

``

`-

.. method:: MimeTypes.guess_extension(type, strict=True)

`

``

220

`+

.. method:: MimeTypes.guess_extension(type, strict=True)

`

221

221

``

222

``

`` -

Similar to the :func:guess_extension function, using the tables stored as part

``

223

``

`-

of the object.

`

``

222

`` +

Similar to the :func:guess_extension function, using the tables stored as part

``

``

223

`+

of the object.

`

224

224

``

225

225

``

226

``

`-

.. method:: MimeTypes.guess_type(url, strict=True)

`

``

226

`+

.. method:: MimeTypes.guess_type(url, strict=True)

`

227

227

``

228

``

`` -

Similar to the :func:guess_type function, using the tables stored as part of

``

229

``

`-

the object.

`

``

228

`` +

Similar to the :func:guess_type function, using the tables stored as part of

``

``

229

`+

the object.

`

230

230

``

231

231

``

232

``

`-

.. method:: MimeTypes.guess_all_extensions(type, strict=True)

`

``

232

`+

.. method:: MimeTypes.guess_all_extensions(type, strict=True)

`

233

233

``

234

``

`` -

Similar to the :func:guess_all_extensions function, using the tables stored

``

235

``

`-

as part of the object.

`

``

234

`` +

Similar to the :func:guess_all_extensions function, using the tables stored

``

``

235

`+

as part of the object.

`

236

236

``

237

237

``

238

``

`-

.. method:: MimeTypes.read(filename, strict=True)

`

``

238

`+

.. method:: MimeTypes.read(filename, strict=True)

`

239

239

``

240

``

`` -

Load MIME information from a file named filename. This uses :meth:readfp to

``

241

``

`-

parse the file.

`

``

240

`` +

Load MIME information from a file named filename. This uses :meth:readfp to

``

``

241

`+

parse the file.

`

242

242

``

243

``


 If *strict* is ``True``, information will be added to list of standard types,

244

``

`-

else to the list of non-standard types.

`

``

243


If *strict* is ``True``, information will be added to list of standard types,

``

244

`+

else to the list of non-standard types.

`

245

245

``

246

246

``

247

``

`-

.. method:: MimeTypes.readfp(fp, strict=True)

`

``

247

`+

.. method:: MimeTypes.readfp(fp, strict=True)

`

248

248

``

249

``

`-

Load MIME type information from an open file fp. The file must have the format of

`

250

``

`` -

the standard :file:mime.types files.

``

``

249

`+

Load MIME type information from an open file fp. The file must have the format of

`

``

250

`` +

the standard :file:mime.types files.

``

251

251

``

252

``


 If *strict* is ``True``, information will be added to the list of standard

253

``

`-

types, else to the list of non-standard types.

`

``

252


If *strict* is ``True``, information will be added to the list of standard

``

253

`+

types, else to the list of non-standard types.

`

254

254

``

255

255

``

256

``

`-

.. method:: MimeTypes.read_windows_registry(strict=True)

`

``

256

`+

.. method:: MimeTypes.read_windows_registry(strict=True)

`

257

257

``

258

``

`-

Load MIME type information from the Windows registry. Availability: Windows.

`

``

258

`+

Load MIME type information from the Windows registry. Availability: Windows.

`

259

259

``

260

``


 If *strict* is ``True``, information will be added to the list of standard

261

``

`-

types, else to the list of non-standard types.

`

``

260


If *strict* is ``True``, information will be added to the list of standard

``

261

`+

types, else to the list of non-standard types.

`

262

262

``

263

``

`-

.. versionadded:: 3.2

`

``

263

`+

.. versionadded:: 3.2

`