Skip to content

Commit c10edcc

Browse files
committed
Revert "Consistent Type annotation setup, overall typo fixes"
This reverts commit 318bab4.
1 parent bc64ab7 commit c10edcc

File tree

16 files changed

+24
-54
lines changed

16 files changed

+24
-54
lines changed

qrcode/LUT.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
"""
2-
Store all kinds of lookup table.
3-
"""
1+
# Store all kinds of lookup table.
2+
3+
44
# # generate rsPoly lookup table.
55

66
# from qrcode import base
7-
#
7+
88
# def create_bytes(rs_blocks):
99
# for r in range(len(rs_blocks)):
1010
# dcCount = rs_blocks[r].data_count
@@ -13,7 +13,7 @@
1313
# for i in range(ecCount):
1414
# rsPoly = rsPoly * base.Polynomial([1, base.gexp(i)], 0)
1515
# return ecCount, rsPoly
16-
#
16+
1717
# rsPoly_LUT = {}
1818
# for version in range(1,41):
1919
# for error_correction in range(4):

qrcode/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from qrcode.main import QRCode
42
from qrcode.main import make # noqa
53
from qrcode.constants import ( # noqa

qrcode/base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import NamedTuple
42
from qrcode import constants
53

qrcode/console_scripts.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66
a pipe to a file an image is written. The default image format is PNG.
77
"""
88

9-
from __future__ import annotations
10-
119
import optparse
1210
import os
1311
import sys
14-
from typing import NoReturn
12+
from typing import NoReturn, Optional
1513
from collections.abc import Iterable
1614
from importlib import metadata
1715

@@ -124,7 +122,7 @@ def raise_error(msg: str) -> NoReturn:
124122
return
125123

126124
kwargs = {}
127-
aliases: DrawerAliases | None = getattr(
125+
aliases: Optional[DrawerAliases] = getattr(
128126
qr.image_factory, "drawer_aliases", None
129127
)
130128
if opts.factory_drawer:
@@ -158,7 +156,7 @@ def get_drawer_help() -> str:
158156
image = get_factory(module)
159157
except ImportError: # pragma: no cover
160158
continue
161-
aliases: DrawerAliases | None = getattr(image, "drawer_aliases", None)
159+
aliases: Optional[DrawerAliases] = getattr(image, "drawer_aliases", None)
162160
if not aliases:
163161
continue
164162
factories = help.setdefault(commas(aliases), set())

qrcode/constants.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
from __future__ import annotations
2-
31
# QR error correct levels
4-
ERROR_CORRECT_L: int = 1
5-
ERROR_CORRECT_M: int = 0
6-
ERROR_CORRECT_Q: int = 3
7-
ERROR_CORRECT_H: int = 2
2+
ERROR_CORRECT_L = 1
3+
ERROR_CORRECT_M = 0
4+
ERROR_CORRECT_Q = 3
5+
ERROR_CORRECT_H = 2

qrcode/exceptions.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
from __future__ import annotations
2-
3-
41
class DataOverflowError(Exception):
52
pass

qrcode/image/base.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
from __future__ import annotations
2-
31
import abc
4-
from typing import TYPE_CHECKING, Any, Union
2+
from typing import TYPE_CHECKING, Any, Optional, Union
53

64
from qrcode.image.styles.moduledrawers.base import QRModuleDrawer
75

@@ -17,8 +15,8 @@ class BaseImage(abc.ABC):
1715
Base QRCode image output class.
1816
"""
1917

20-
kind: str | None = None
21-
allowed_kinds: tuple[str, ...] | None = None
18+
kind: Optional[str] = None
19+
allowed_kinds: Optional[tuple[str]] = None
2220
needs_context = False
2321
needs_processing = False
2422
needs_drawrect = True
@@ -142,7 +140,7 @@ def __init__(
142140

143141
def get_drawer(
144142
self, drawer: Union[QRModuleDrawer, str, None]
145-
) -> QRModuleDrawer | None:
143+
) -> Optional[QRModuleDrawer]:
146144
if not isinstance(drawer, str):
147145
return drawer
148146
drawer_cls, kwargs = self.drawer_aliases[drawer]

qrcode/image/pil.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import qrcode.image.base
42
from PIL import Image, ImageDraw
53

qrcode/image/pure.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from itertools import chain
42

53
from qrcode.compat.png import PngWriter

qrcode/image/styles/colormasks.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import math
42

53
from PIL import Image

0 commit comments

Comments
 (0)