Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: tools/binary_size/libsupersize/console.py

Issue 2888693002: supersize: Add Print(idx). Sort subgroups in canned_queries. (Closed)
Patch Set: supersize: Add Print(idx). Sort subgroups in canned_queries. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/binary_size/libsupersize/canned_queries.py ('k') | tools/binary_size/libsupersize/models.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/binary_size/libsupersize/console.py
diff --git a/tools/binary_size/libsupersize/console.py b/tools/binary_size/libsupersize/console.py
index 2a66311ae013aaa658b7d6f6dd8ee7d986c26d77..a0aab8eb65f46afc34881272751b80a5709b1a68 100644
--- a/tools/binary_size/libsupersize/console.py
+++ b/tools/binary_size/libsupersize/console.py
@@ -110,14 +110,17 @@ class _Session(object):
For convenience, |obj| will be appended to the global "printed" list.
Args:
- obj: The object to be printed. Defaults to size_infos[-1].
+ obj: The object to be printed. Defaults to size_infos[-1]. Also accepts an
+ index into the |printed| array for showing previous results.
verbose: Show more detailed output.
recursive: Print children of nested SymbolGroups.
use_pager: Pipe output through `less`. Ignored when |obj| is a Symbol.
default is to automatically pipe when output is long.
to_file: Rather than print to stdio, write to the given file.
"""
- if not self._printed_variables or self._printed_variables[-1] != obj:
+ if isinstance(obj, int):
+ obj = self._printed_variables[obj]
+ elif not self._printed_variables or self._printed_variables[-1] != obj:
self._printed_variables.append(obj)
obj = obj if obj is not None else self._size_infos[-1]
lines = describe.GenerateLines(obj, verbose=verbose, recursive=recursive)
« no previous file with comments | « tools/binary_size/libsupersize/canned_queries.py ('k') | tools/binary_size/libsupersize/models.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698