From f2a867ab550612e6539a7515f2a11d3a9daae7b9 Mon Sep 17 00:00:00 2001 From: Jan Pokorný Date: Wed, 18 Jun 2014 18:37:03 +0200 Subject: format: turn needless per-module constant to per-class one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan Pokorný --- format.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'format.py') diff --git a/format.py b/format.py index afd2209..7cb7427 100644 --- a/format.py +++ b/format.py @@ -30,7 +30,6 @@ from .utils import arg2wrapped, args2tuple, args2unwrapped, \ from .utils_xml import rng_get_start, rng_pivot log = getLogger(__name__) -MAX_DEPTH = 1000 DEFAULT_ROOT_DIR = join(dirname(__file__), 'formats') @@ -364,6 +363,9 @@ class CompositeFormat(Format, MetaPlugin): class XML(SimpleFormat): """"Base for XML-based configuration formats""" + + MAX_DEPTH = 1000 + @classproperty def root(self): """Root tag of the XML document""" @@ -476,7 +478,7 @@ class XML(SimpleFormat): continue # files are terminals anyway current_tracking[name] = (swag, {}) - for i in xrange(MAX_DEPTH): + for i in xrange(cls.MAX_DEPTH): if cls._walk_schema_step_up(tree_stack) is result: return result else: -- cgit