diff options
author | Stuart Rackham <srackham@methods.co.nz> | 2012-12-31 16:43:18 +1300 |
---|---|---|
committer | Stuart Rackham <srackham@methods.co.nz> | 2012-12-31 16:43:18 +1300 |
commit | ad88370bececb1b26be0c42d8836248c42f4dbb9 (patch) | |
tree | 853c4b5fa2e68fefc54fc3edca20d8b32f49d330 | |
parent | 3f7694e72fb18ea2c34b107ac5b704a502856c63 (diff) | |
download | asciidoc-ad88370bececb1b26be0c42d8836248c42f4dbb9.tar.gz |
Allow tabsize=0 in configuration file. See
https://groups.google.com/group/asciidoc/browse_thread/thread/c88457020288ce1d
-rwxr-xr-x | asciidoc.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/asciidoc.py b/asciidoc.py index 1efa0ca..6128173 100755 --- a/asciidoc.py +++ b/asciidoc.py @@ -4809,18 +4809,17 @@ class Config: def load_miscellaneous(self,d): """Set miscellaneous configuration entries from dictionary 'd'.""" - def set_if_int_gt_zero(name, d): + def set_if_int_ge(name, d, min_value): if name in d: try: val = int(d[name]) - if not val > 0: - raise ValueError, "not > 0" - if val > 0: - setattr(self, name, val) + if not val >= min_value: + raise ValueError, "not >= " + str(min_value) + setattr(self, name, val) except ValueError: raise EAsciiDoc, 'illegal [miscellaneous] %s entry' % name - set_if_int_gt_zero('tabsize', d) - set_if_int_gt_zero('textwidth', d) # DEPRECATED: Old tables only. + set_if_int_ge('tabsize', d, 0) + set_if_int_ge('textwidth', d, 1) # DEPRECATED: Old tables only. if 'pagewidth' in d: try: |