def _setLayerRule(layer, rule=None):
 layer.ClearField('include')
 layer.ClearField('exclude')
 if (rule is not None):
  layer.include.add().CopyFrom(rule)

def _setLayerRule ( layer , rule = None ) : layer . ClearField ( 'include' ) layer . ClearField ( 'exclude' ) if ( rule is not None ) : layer . include . add ( ) . CopyFrom ( rule )
set a new include rule for this layer if rule is none .