@decorator.decorator
def requires_duration(f, clip, *a, **k):
 if (clip.duration is None):
  raise ValueError("Attribute 'duration' not set")
 else:
  return f(clip, *a, **k)

@ decorator . decorator def requires_duration ( f , clip , * a , ** k ) : if ( clip . duration is None ) : raise ValueError ( "Attribute 'duration' not set" ) else : return f ( clip , * a , ** k )
raise an error if the clip has no duration .