def make_eventrule(date_rule, time_rule, cal, half_days=True):
 date_rule.cal = cal
 time_rule.cal = cal
 if half_days:
  inner_rule = (date_rule & time_rule)
 else:
  nhd_rule = NotHalfDay()
  nhd_rule.cal = cal
  inner_rule = ((date_rule & time_rule) & nhd_rule)
 return OncePerDay(rule=inner_rule)

def make_eventrule ( date_rule , time_rule , cal , half_days = True ) : date_rule . cal = cal time_rule . cal = cal if half_days : inner_rule = ( date_rule & time_rule ) else : nhd_rule = NotHalfDay ( ) nhd_rule . cal = cal inner_rule = ( ( date_rule & time_rule ) & nhd_rule ) return OncePerDay ( rule = inner_rule )
constructs an event rule from the factory api .