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

Unified Diff: appengine/findit/util_scripts/crash_queries/crash_printer/crash_printer.py

Issue 2391823006: [Findit] Add iterator and crash_iterator for delta test (Closed)
Patch Set: Seperate --date argument. Created 4 years, 2 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
Index: appengine/findit/util_scripts/crash_queries/crash_printer/crash_printer.py
diff --git a/appengine/findit/util_scripts/crash_queries/crash_printer/crash_printer.py b/appengine/findit/util_scripts/crash_queries/crash_printer/crash_printer.py
new file mode 100644
index 0000000000000000000000000000000000000000..e0e037855ca7c00abe5f7aac6639780e08af95cc
--- /dev/null
+++ b/appengine/findit/util_scripts/crash_queries/crash_printer/crash_printer.py
@@ -0,0 +1,25 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from crash_queries import crash_iterator
+
+CRASH_INFO_FIELDS = ['signature', 'platform']
+
+
+def PrintCrashInfo(crash):
+ print '\nCrash %s' % crash['id']
+ for crash_info_field in CRASH_INFO_FIELDS:
+ print '%s: %s' % (crash_info_field, crash[crash_info_field])
+
+
+def CrashPrinter(client_id,
+ start_date, end_date,
+ print_func=PrintCrashInfo,
+ app_id=None):
+ for crash in crash_iterator.IterateCrashes(client_id,
+ fields=CRASH_INFO_FIELDS,
+ start_date=start_date,
+ end_date=end_date,
+ app_id=app_id):
+ print_func(crash)

Powered by Google App Engine
This is Rietveld 408576698