New Param: changed naming convention for class rules to '_rule_%s' as these methods aren't part of the public interface

This commit is contained in:
Jason Gerard DeRose 2008-12-17 23:30:29 -07:00
parent 285fa3d330
commit b26894c166

View File

@ -263,7 +263,7 @@ class Param(ReadOnly):
key, self.__class__.__name__) key, self.__class__.__name__)
) )
setattr(self, key, value) setattr(self, key, value)
rule_name = 'rule_%s' % key rule_name = '_rule_%s' % key
if value is not None and hasattr(self, rule_name): if value is not None and hasattr(self, rule_name):
class_rules.append(getattr(self, rule_name)) class_rules.append(getattr(self, rule_name))
check_name(self.cli_name) check_name(self.cli_name)
@ -417,7 +417,7 @@ class Bytes(Param):
self.nice, self.minlength) self.nice, self.minlength)
) )
def rule_minlength(self, value): def _rule_minlength(self, value):
""" """
Check minlength constraint. Check minlength constraint.
""" """
@ -426,7 +426,7 @@ class Bytes(Param):
minlength=self.minlength, minlength=self.minlength,
) )
def rule_maxlength(self, value): def _rule_maxlength(self, value):
""" """
Check maxlength constraint. Check maxlength constraint.
""" """
@ -435,7 +435,7 @@ class Bytes(Param):
maxlength=self.maxlength, maxlength=self.maxlength,
) )
def rule_length(self, value): def _rule_length(self, value):
""" """
Check length constraint. Check length constraint.
""" """