Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tutorius
diff options
context:
space:
mode:
authorVincent Vinet <vince.vinet@gmail.com>2009-10-14 18:35:26 (GMT)
committer Vincent Vinet <vince.vinet@gmail.com>2009-10-14 18:35:26 (GMT)
commitb0274f9a824d8ef82cbe66398d5afaa6ca75d9dc (patch)
tree714c57e35d42eca11de0ba375070622a7c9f718c /tutorius
parent2aef185e57f6c6c38670a5eea74f7889b3d56944 (diff)
add the readfile action, hack the constraints to make it work
Diffstat (limited to 'tutorius')
-rw-r--r--tutorius/constraints.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tutorius/constraints.py b/tutorius/constraints.py
index 36abdfb..e91f23a 100644
--- a/tutorius/constraints.py
+++ b/tutorius/constraints.py
@@ -200,7 +200,10 @@ class FileConstraint(Constraint):
def validate(self, value):
# TODO : Decide on the architecture for file retrieval on disk
# Relative paths? From where? Support macros?
- #
+ # FIXME This is a hack to make cases where a default file is not valid
+ # work. It allows None values to be validated, though
+ if value is None:
+ return
if not os.path.isfile(value):
raise FileConstraintError("Non-existing file : %s"%value)
return