Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pyromaths
pyromaths
Commits
91a55d26
Commit
91a55d26
authored
Jun 06, 2013
by
Olivier Cornu
Browse files
un Exercice sans description est ignoré.
parent
3d56c561
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/pyromaths/ex/__init__.py
View file @
91a55d26
...
...
@@ -9,10 +9,6 @@ levels = {}
class
Exercise
(
object
):
''' Base class for all exercise types. '''
description
=
u
'Description'
level
=
u
'Academic level'
thumb
=
'path/to/thumbnail.png'
def
__str__
(
self
):
return
self
.
description
...
...
@@ -73,7 +69,7 @@ def __islegacy(obj):
def
__isexercise
(
obj
):
''' Is target object an exercise (in new format)? '''
return
inspect
.
isclass
(
obj
)
and
issubclass
(
obj
,
Exercise
)
return
inspect
.
isclass
(
obj
)
and
issubclass
(
obj
,
Exercise
)
and
__hasdescription
(
obj
)
def
__level
(
level
):
''' Format academic level(s). '''
...
...
Write
Preview
Supports
Markdown
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