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

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

Issue 2391823006: [Findit] Add iterator and crash_iterator for delta test (Closed)
Patch Set: Change wording in README. 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/print_crash.py
diff --git a/appengine/findit/util_scripts/crash_queries/crash_printer/print_crash.py b/appengine/findit/util_scripts/crash_queries/crash_printer/print_crash.py
new file mode 100644
index 0000000000000000000000000000000000000000..63baddc8b296ab28731aa934917c20660f2cdade
--- /dev/null
+++ b/appengine/findit/util_scripts/crash_queries/crash_printer/print_crash.py
@@ -0,0 +1,45 @@
+# 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.
+
+import argparse
+from datetime import date
+from datetime import timedelta
+import os
+
+from crash_queries.crash_printer import crash_printer
+
+_DATETIME_FORMAT = '%Y-%m-%d'
+_TODAY = date.today().strftime(_DATETIME_FORMAT)
+_A_YEAR_AGO = (date.today() - timedelta(days=365)).strftime(_DATETIME_FORMAT)
+
+
+if __name__ == '__main__':
+ argparser = argparse.ArgumentParser(
+ description='Print crashes.')
+
+ argparser.add_argument(
+ '--since',
+ default=_A_YEAR_AGO,
+ help=('Query data since this date (including this date). '
+ 'Should be in YYYY-MM-DD format. E.g. 2015-09-31. '
+ 'Defaults to a year ago.'))
+
+ argparser.add_argument(
+ '--until',
+ default=_TODAY,
lijeffrey 2016/10/20 15:35:46 nit: is there a reason you include the -c shortcut
Sharu Jiang 2016/10/20 20:38:21 Done.
+ help=('Query data until this date (not including this date). '
+ 'Should be in YYYY-MM-DD format. E.g. 2015-09-31. '
+ 'Defaults to today.'))
+
+ argparser.add_argument(
+ '--client',
+ '-c',
+ default='fracas',
+ help=('Possible values are: fracas, cracas, clusterfuzz. Right now, only '
+ 'fracas is supported.'))
+
+ args = argparser.parse_args()
+
+ crash_printer.CrashPrinter(args.client, os.getenv('APP_ID'),
+ start_date=args.since, end_date=args.until)
« no previous file with comments | « appengine/findit/util_scripts/crash_queries/crash_printer/crash_printer.py ('k') | appengine/findit/util_scripts/iterator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698