Skip to content

Commit 940af84

Browse files
committed
[pprint] max_depth=-1 is now default
1 parent 10d48b4 commit 940af84

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

nixio/property.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ def extend_values(self, data):
290290
dataset = self._h5dataset
291291
src_len = len(self.values)
292292
dlen = len(arr)
293-
dataset.shape = (src_len+dlen,)
294-
dataset.write_data(arr, slc=np.s_[src_len: src_len+dlen])
293+
dataset.shape = (src_len + dlen,)
294+
dataset.write_data(arr, slc=np.s_[src_len: src_len + dlen])
295295

296296
def _check_new_value_types(self, data):
297297
if isinstance(data, (Sequence, Iterable)) and not isinstance(data, string_types):
@@ -369,8 +369,8 @@ def pprint(self, indent=2, max_length=80, current_depth=-1):
369369
value_string = "{}{}".format(self.values, self.unit)
370370
p_len = len(property_spaces) + len(self.name) + len(value_string)
371371
if p_len >= max_length - 4:
372-
split_len = int((max_length - len(property_spaces)
373-
+ len(self.name) - len(prefix))/2)
372+
split_len = int((max_length - len(property_spaces) +
373+
len(self.name) - len(prefix)) / 2)
374374
str1 = value_string[0: split_len]
375375
str2 = value_string[-split_len:]
376376
print(("{}{} {}: {} ... {}".format(property_spaces, prefix,

nixio/section.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,13 +491,13 @@ def props(self):
491491
self, Property)
492492
return self._properties
493493

494-
def pprint(self, indent=2, max_depth=1, max_length=80, current_depth=0):
494+
def pprint(self, indent=2, max_depth=-1, max_length=80, current_depth=0):
495495
"""
496496
Pretty print method.
497497
498498
:param indent: The number of indentation spaces per recursion
499499
:type indent: int
500-
:param max_depth: The maximum times of recursion
500+
:param max_depth: The maximum times of recursion, -1 for the full depth
501501
:type max_depth: int
502502
:param max_length: The maximum length of each line of output
503503
:type max_length: int
@@ -512,7 +512,7 @@ def pprint(self, indent=2, max_depth=1, max_length=80, current_depth=0):
512512
prop.pprint(current_depth=current_depth, indent=indent, max_length=max_length)
513513
if max_depth == -1 or current_depth < max_depth:
514514
for sec in self.sections:
515-
sec.pprint(current_depth=current_depth+1, max_depth=max_depth, indent=indent, max_length=max_length)
515+
sec.pprint(current_depth=current_depth + 1, max_depth=max_depth, indent=indent, max_length=max_length)
516516
elif max_depth == current_depth:
517517
child_sec_indent = spaces + " " * indent
518518
more_indent = spaces + " " * (current_depth + 2 * indent)

0 commit comments

Comments
 (0)