Temporarily restore 3.6.0 support
This commit is contained in:
@@ -11,9 +11,10 @@ repos:
|
||||
- id: name-tests-test
|
||||
- id: requirements-txt-fixer
|
||||
- repo: https://gitlab.com/pycqa/flake8
|
||||
rev: 3.7.8
|
||||
rev: 3.7.9
|
||||
hooks:
|
||||
- id: flake8
|
||||
additional_dependencies: [flake8-typing-imports==1.7.0]
|
||||
- repo: https://github.com/pre-commit/mirrors-autopep8
|
||||
rev: v1.4.4
|
||||
hooks:
|
||||
@@ -33,7 +34,3 @@ repos:
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: [--py36-plus]
|
||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
rev: v0.730
|
||||
hooks:
|
||||
- id: mypy
|
||||
|
||||
12
babi.py
12
babi.py
@@ -137,10 +137,15 @@ class Margin(NamedTuple):
|
||||
header: bool
|
||||
footer: bool
|
||||
|
||||
|
||||
@property
|
||||
def body_lines(self) -> int:
|
||||
return curses.LINES - self.header - self.footer
|
||||
|
||||
|
||||
Margin.body_lines = body_lines
|
||||
|
||||
|
||||
@property
|
||||
def page_size(self) -> int:
|
||||
if self.body_lines <= 2:
|
||||
@@ -148,6 +153,10 @@ class Margin(NamedTuple):
|
||||
else:
|
||||
return self.body_lines - 2
|
||||
|
||||
|
||||
Margin.page_size = page_size
|
||||
|
||||
|
||||
@classmethod
|
||||
def from_screen(cls, screen: 'curses._CursesWindow') -> 'Margin':
|
||||
if curses.LINES == 1:
|
||||
@@ -158,6 +167,9 @@ class Margin(NamedTuple):
|
||||
return cls(header=True, footer=True)
|
||||
|
||||
|
||||
Margin.from_screen = from_screen
|
||||
|
||||
|
||||
def _get_color_pair_mapping() -> Dict[Tuple[int, int], int]:
|
||||
ret = {}
|
||||
i = 0
|
||||
|
||||
Reference in New Issue
Block a user