From b0274f9a824d8ef82cbe66398d5afaa6ca75d9dc Mon Sep 17 00:00:00 2001 From: Vincent Vinet Date: Wed, 14 Oct 2009 18:35:26 +0000 Subject: add the readfile action, hack the constraints to make it work --- (limited to 'tutorius') 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 -- cgit v0.9.1