• Home
  • Raw
  • Download

Lines Matching +full:pretty +full:- +full:format

7 #  tuples with fairly non-descriptive content.  This is modeled very much
8 # after Lisp/Scheme - style pretty-printing of lists. If you find it
11 """Support to pretty-print lists, tuples, & dictionaries recursively.
16 -------
19 Handle pretty-printing operations onto a stream using a configured
23 ---------
26 Format a Python object into a pretty-printed representation.
29 Pretty-print a Python object to a stream [default is sys.stdout].
32 Generate a 'standard' repr()-like value, but protect against recursive
50 """Pretty-print a Python object to a stream [default is sys.stdout]."""
59 """Format a Python object into a pretty-printed representation."""
65 """Pretty-print a Python object"""
83 The wrapped-object will fallback to a Py2.x style comparison for
103 "Helper function for comparing 2-tuples"
109 """Handle pretty printing operations onto a stream using a set of
162 return self.format(object, {}, 0, 0)[2]
165 s, readable, recursive = self.format(object, {}, 0, 0)
176 max_width = self._width - indent - allowance
210 write((self._indent_per_level - 1) * ' ')
283 max_width1 = max_width = self._width - indent
286 if i == len(lines) - 1:
287 max_width1 -= allowance
291 # A list of alternating (non-space, space) strings
294 assert not parts[-1]
300 if j == len(parts) - 1 and i == len(lines) - 1:
301 max_width2 -= allowance
335 for rep in _wrap_bytes_repr(object, self._width - indent, allowance):
382 last_index = len(items) - 1
397 last_index = len(items) - 1
403 # Special-case representation of recursion to match standard
417 write((self._indent_per_level - 1) * ' ')
420 width = max_width = self._width - indent + 1
433 max_width -= allowance
434 width -= allowance
443 width -= w
455 repr, readable, recursive = self.format(object, context.copy(),
463 def format(self, object, context, maxlevels, level): member in PrettyPrinter
464 """Format object for a specific context, returning a string
490 stream.write((self._indent_per_level - 1) * ' ')
507 if i == len(object.maps) - 1:
537 self._format(object.data, stream, indent, allowance, context, level - 1)
542 self._format(object.data, stream, indent, allowance, context, level - 1)
547 self._format(object.data, stream, indent, allowance, context, level - 1)
584 krepr, kreadable, krecur = self.format(
586 vrepr, vreadable, vrecur = self.format(
600 format = "[%s]"
602 format = "(%s,)"
606 format = "(%s)"
609 return format % "...", False, objid in context
619 orepr, oreadable, orecur = self.format(
627 return format % ", ".join(components), readable, recursive
650 print("_safe_repr:", t2 - t1)
651 print("pformat:", t3 - t2)
660 width -= allowance