Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
trs
Commits
09820ea8
Commit
09820ea8
authored
May 02, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the possibility to use a function to create a hint message.
parent
6a78440d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
src/possibilities.py
src/possibilities.py
+6
-1
src/rules/lineq.py
src/rules/lineq.py
+10
-1
No files found.
src/possibilities.py
View file @
09820ea8
...
@@ -16,7 +16,12 @@ class Possibility(object):
...
@@ -16,7 +16,12 @@ class Possibility(object):
def
__str__
(
self
):
def
__str__
(
self
):
if
self
.
handler
in
MESSAGES
:
if
self
.
handler
in
MESSAGES
:
return
MESSAGES
[
self
.
handler
].
format
(
self
.
root
,
*
self
.
args
)
msg
=
MESSAGES
[
self
.
handler
]
if
callable
(
msg
):
msg
=
msg
(
self
.
root
,
self
.
args
)
return
msg
.
format
(
self
.
root
,
*
self
.
args
)
return
repr
(
self
)
return
repr
(
self
)
...
...
src/rules/lineq.py
View file @
09820ea8
...
@@ -98,7 +98,16 @@ def subtract_term(root, args):
...
@@ -98,7 +98,16 @@ def subtract_term(root, args):
return
eq
(
left
-
term
,
right
-
term
)
return
eq
(
left
-
term
,
right
-
term
)
MESSAGES
[
subtract_term
]
=
_
(
'Subtract {1} from both sides of the equation.'
)
def
subtract_term_msg
(
root
,
args
):
term
=
args
[
0
]
if
term
.
negated
==
1
:
return
_
(
'Add %s to both sides of the equation.'
%
+
term
)
return
_
(
'Subtract {1} from both sides of the equation.'
)
MESSAGES
[
subtract_term
]
=
subtract_term_msg
def
divide_term
(
root
,
args
):
def
divide_term
(
root
,
args
):
...
...
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