diff options
author | Vincent 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) |
commit | b0274f9a824d8ef82cbe66398d5afaa6ca75d9dc (patch) | |
tree | 714c57e35d42eca11de0ba375070622a7c9f718c /tutorius | |
parent | 2aef185e57f6c6c38670a5eea74f7889b3d56944 (diff) |
add the readfile action, hack the constraints to make it work
Diffstat (limited to 'tutorius')
-rw-r--r-- | tutorius/constraints.py | 5 |
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 |