Commit d8d18709 authored by Jérémy Bobbio's avatar Jérémy Bobbio

Accept None or 0 in Config setters

We instead set a default in the argument parser using the default in Config.
parent c581a65a
......@@ -53,13 +53,16 @@ def create_parser():
parser.add_argument('--max-report-size', metavar='BYTES',
dest='max_report_size', type=int,
help='maximum bytes written in report (default: %d)' %
Config.general.max_report_size)
Config.general.max_report_size,
default=Config.general.max_report_size)
parser.add_argument('--max-diff-block-lines', dest='max_diff_block_lines', type=int,
help='maximum number of lines per diff block (default: %d)' %
Config.general.max_diff_block_lines)
Config.general.max_diff_block_lines,
default=Config.general.max_diff_input_lines)
parser.add_argument('--max-diff-input-lines', dest='max_diff_input_lines', type=int,
help='maximum number of lines fed to diff (default: %d)' %
Config.general.max_diff_input_lines)
Config.general.max_diff_input_lines,
default=Config.general.max_diff_input_lines)
parser.add_argument('--css', metavar='url', dest='css_url',
help='link to an extra CSS for the HTML report')
parser.add_argument('file1', help='first file to compare')
......
......@@ -43,8 +43,7 @@ class Config(object):
@max_diff_block_lines.setter
def max_diff_block_lines(self, value):
if value:
self._max_diff_block_lines = value
self._max_diff_block_lines = value
@property
def max_diff_input_lines(self):
......@@ -52,8 +51,7 @@ class Config(object):
@max_diff_input_lines.setter
def max_diff_input_lines(self, value):
if value:
self._max_diff_input_lines = value
self._max_diff_input_lines = value
@property
def max_report_size(self):
......@@ -61,6 +59,5 @@ class Config(object):
@max_report_size.setter
def max_report_size(self, value):
if value:
self._max_report_size = value
self._max_report_size = value
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment