Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
clive
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
clive
Commits
c742a344
Commit
c742a344
authored
1 month ago
by
Mateusz Żebrak
Browse files
Options
Downloads
Patches
Plain Diff
Reorder methods in Form
parent
d08d0b51
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!600
v1.27.5.21 Release
,
!558
Remove welcome profile from TUIWorld, set TUIWorld profile during CreateProfile wizard instead
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
clive/__private/ui/forms/form.py
+14
-14
14 additions, 14 deletions
clive/__private/ui/forms/form.py
with
14 additions
and
14 deletions
clive/__private/ui/forms/form.py
+
14
−
14
View file @
c742a344
...
...
@@ -28,6 +28,14 @@ class Form(Contextual[ContextT], CliveScreen[None]):
super
().
__init__
()
@abstractmethod
def
compose_form
(
self
)
->
Iterator
[
type
[
FormScreenBase
[
ContextT
]]]:
"""
Yield screens types in the order they should be displayed.
"""
@abstractmethod
def
_rebuild_context
(
self
)
->
None
:
"""
Create brand new fresh context.
"""
@property
def
screens_types
(
self
)
->
list
[
type
[
FormScreenBase
[
ContextT
]]]:
return
self
.
_screen_types
...
...
@@ -57,20 +65,6 @@ class Form(Contextual[ContextT], CliveScreen[None]):
# self.dismiss() won't work here because self is Form and not FormScreen
self
.
app
.
pop_screen
()
def
_push_current_screen
(
self
)
->
None
:
self
.
app
.
push_screen
(
self
.
current_screen_type
(
self
))
def
_check_valid_range
(
self
,
proposed_idx
:
int
)
->
bool
:
return
(
proposed_idx
>=
0
)
and
(
proposed_idx
<
len
(
self
.
_screen_types
))
@abstractmethod
def
_rebuild_context
(
self
)
->
None
:
"""
Create brand new fresh context.
"""
@abstractmethod
def
compose_form
(
self
)
->
Iterator
[
type
[
FormScreenBase
[
ContextT
]]]:
"""
Yield screens types in the order they should be displayed.
"""
def
add_post_action
(
self
,
*
actions
:
PostAction
)
->
None
:
for
action
in
actions
:
self
.
_post_actions
.
put_nowait
(
action
)
...
...
@@ -88,3 +82,9 @@ class Form(Contextual[ContextT], CliveScreen[None]):
await
action
()
else
:
action
()
def
_push_current_screen
(
self
)
->
None
:
self
.
app
.
push_screen
(
self
.
current_screen_type
(
self
))
def
_check_valid_range
(
self
,
proposed_idx
:
int
)
->
bool
:
return
(
proposed_idx
>=
0
)
and
(
proposed_idx
<
len
(
self
.
_screen_types
))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment