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
7
Merge Requests
7
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
3ed31ed2
Commit
3ed31ed2
authored
Aug 22, 2016
by
mathieui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don’t use camelcase for accessing data forms
(except with getXML that will need more work)
parent
ca682cf2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
poezio/windows/data_forms.py
poezio/windows/data_forms.py
+12
-12
No files found.
poezio/windows/data_forms.py
View file @
3ed31ed2
...
...
@@ -91,7 +91,7 @@ class BooleanWin(FieldInput, Win):
FieldInput
.
__init__
(
self
,
field
)
Win
.
__init__
(
self
)
self
.
last_key
=
'KEY_RIGHT'
self
.
value
=
bool
(
field
.
get
V
alue
())
self
.
value
=
bool
(
field
.
get
_v
alue
())
def
do_command
(
self
,
key
):
if
key
==
'KEY_LEFT'
or
key
==
'KEY_RIGHT'
:
...
...
@@ -115,7 +115,7 @@ class BooleanWin(FieldInput, Win):
def
reply
(
self
):
self
.
_field
[
'label'
]
=
''
self
.
_field
.
set
A
nswer
(
self
.
value
)
self
.
_field
.
set
_a
nswer
(
self
.
value
)
def
get_help_message
(
self
):
return
'← and →: change the value between True and False'
...
...
@@ -124,7 +124,7 @@ class TextMultiWin(FieldInput, Win):
def
__init__
(
self
,
field
):
FieldInput
.
__init__
(
self
,
field
)
Win
.
__init__
(
self
)
self
.
options
=
field
.
get
V
alue
()
self
.
options
=
field
.
get
_v
alue
()
if
not
isinstance
(
self
.
options
,
list
):
self
.
options
=
self
.
options
.
split
(
'
\n
'
)
if
self
.
options
else
[]
self
.
val_pos
=
0
...
...
@@ -182,7 +182,7 @@ class TextMultiWin(FieldInput, Win):
def
reply
(
self
):
values
=
[
val
for
val
in
self
.
options
if
val
]
self
.
_field
.
set
A
nswer
(
values
)
self
.
_field
.
set
_a
nswer
(
values
)
def
get_help_message
(
self
):
if
not
self
.
edition_input
:
...
...
@@ -199,7 +199,7 @@ class ListMultiWin(FieldInput, Win):
def
__init__
(
self
,
field
):
FieldInput
.
__init__
(
self
,
field
)
Win
.
__init__
(
self
)
values
=
field
.
get
V
alue
()
or
[]
values
=
field
.
get
_v
alue
()
or
[]
self
.
options
=
[[
option
,
True
if
option
[
'value'
]
in
values
else
False
]
\
for
option
in
field
.
get_options
()]
self
.
val_pos
=
0
...
...
@@ -236,7 +236,7 @@ class ListMultiWin(FieldInput, Win):
self
.
_field
[
'label'
]
=
''
self
.
_field
.
delOptions
()
values
=
[
option
[
0
][
'value'
]
for
option
in
self
.
options
if
option
[
1
]
is
True
]
self
.
_field
.
set
A
nswer
(
values
)
self
.
_field
.
set
_a
nswer
(
values
)
def
get_help_message
(
self
):
return
'←, →: Switch between the value. Space: select or unselect a value'
...
...
@@ -246,11 +246,11 @@ class ListSingleWin(FieldInput, Win):
FieldInput
.
__init__
(
self
,
field
)
Win
.
__init__
(
self
)
# the option list never changes
self
.
options
=
field
.
get
O
ptions
()
self
.
options
=
field
.
get
_o
ptions
()
# val_pos is the position of the currently selected option
self
.
val_pos
=
0
for
i
,
option
in
enumerate
(
self
.
options
):
if
field
.
get
V
alue
()
==
option
[
'value'
]:
if
field
.
get
_v
alue
()
==
option
[
'value'
]:
self
.
val_pos
=
i
def
do_command
(
self
,
key
):
...
...
@@ -281,7 +281,7 @@ class ListSingleWin(FieldInput, Win):
def
reply
(
self
):
self
.
_field
[
'label'
]
=
''
self
.
_field
.
delOptions
()
self
.
_field
.
set
A
nswer
(
self
.
options
[
self
.
val_pos
][
'value'
])
self
.
_field
.
set
_a
nswer
(
self
.
options
[
self
.
val_pos
][
'value'
])
def
get_help_message
(
self
):
return
'←, →: Select a value amongst the others'
...
...
@@ -290,14 +290,14 @@ class TextSingleWin(FieldInput, Input):
def
__init__
(
self
,
field
):
FieldInput
.
__init__
(
self
,
field
)
Input
.
__init__
(
self
)
self
.
text
=
field
.
get
Value
()
if
isinstance
(
field
.
getV
alue
(),
str
)
\
self
.
text
=
field
.
get
_value
()
if
isinstance
(
field
.
get_v
alue
(),
str
)
\
else
""
self
.
pos
=
len
(
self
.
text
)
self
.
color
=
get_theme
().
COLOR_NORMAL_TEXT
def
reply
(
self
):
self
.
_field
[
'label'
]
=
''
self
.
_field
.
set
A
nswer
(
self
.
get_text
())
self
.
_field
.
set
_a
nswer
(
self
.
get_text
())
def
get_help_message
(
self
):
return
'Edit the text'
...
...
@@ -356,7 +356,7 @@ class FormWin(object):
label
=
field
[
'label'
]
desc
=
field
[
'desc'
]
if
field
[
'type'
]
==
'fixed'
:
label
=
field
.
get
V
alue
()
label
=
field
.
get
_v
alue
()
inp
=
input_class
(
field
)
self
.
inputs
.
append
({
'label'
:
ColoredLabel
(
label
),
'description'
:
desc
,
...
...
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