Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
poezio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
178
Issues
178
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poezio
poezio
Commits
47bd3ab8
Commit
47bd3ab8
authored
Aug 17, 2018
by
Link Mauve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows.misc: Type everything in this module.
parent
176b4ee9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
poezio/windows/misc.py
poezio/windows/misc.py
+10
-8
No files found.
poezio/windows/misc.py
View file @
47bd3ab8
...
...
@@ -3,13 +3,15 @@ Wins that don’t fit any category
"""
import
logging
log
=
logging
.
getLogger
(
__name__
)
import
curses
from
typing
import
List
from
poezio.windows.base_wins
import
Win
from
poezio.theming
import
get_theme
,
to_curses_attr
log
=
logging
.
getLogger
(
__name__
)
class
VerticalSeparator
(
Win
):
"""
...
...
@@ -17,23 +19,23 @@ class VerticalSeparator(Win):
refreshed only on resize, but never on refresh, for efficiency
"""
def
rewrite_line
(
self
):
def
rewrite_line
(
self
)
->
None
:
self
.
_win
.
vline
(
0
,
0
,
curses
.
ACS_VLINE
,
self
.
height
,
to_curses_attr
(
get_theme
().
COLOR_VERTICAL_SEPARATOR
))
self
.
_refresh
()
def
refresh
(
self
):
def
refresh
(
self
)
->
None
:
log
.
debug
(
'Refresh: %s'
,
self
.
__class__
.
__name__
)
self
.
rewrite_line
()
class
SimpleTextWin
(
Win
):
def
__init__
(
self
,
text
):
def
__init__
(
self
,
text
)
->
None
:
Win
.
__init__
(
self
)
self
.
_text
=
text
self
.
built_lines
=
[]
self
.
built_lines
=
[]
# type: List[str]
def
rebuild_text
(
self
):
def
rebuild_text
(
self
)
->
None
:
"""
Transform the text in lines than can then be
displayed without any calculation or anything
...
...
@@ -50,7 +52,7 @@ class SimpleTextWin(Win):
line
=
line
[
limit
:]
self
.
built_lines
.
append
(
line
)
def
refresh
(
self
):
def
refresh
(
self
)
->
None
:
log
.
debug
(
'Refresh: %s'
,
self
.
__class__
.
__name__
)
self
.
_win
.
erase
()
for
y
,
line
in
enumerate
(
self
.
built_lines
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment