Download:
child 21:4470846e7c0c
parent 19:fade59cdf584
20:8bd991e9b7ff
Anton Shestakov <av6@dwimlabs.net>, Fri, 24 Jun 2016 07:36:35 +0800
rollbot: shorten lines of log verbosity arguments creation

1 файлов изменено, 3 вставок(+), 2 удалений(-) [+]
rollbot.py file | annotate | diff | comparison | revisions
--- a/rollbot.py Fri Jun 03 11:36:03 2016 +0800
+++ b/rollbot.py Fri Jun 24 07:36:35 2016 +0800
@@ -205,8 +205,9 @@
group.add_argument('--prefix', help='command prefix (default: !)')
group = parser.add_mutually_exclusive_group()
- group.add_argument('-q', '--quiet', help='set logging to ERROR', action='store_const', dest='loglevel', const=logging.ERROR, default=logging.INFO)
- group.add_argument('-d', '--debug', help='set logging to DEBUG', action='store_const', dest='loglevel', const=logging.DEBUG, default=logging.INFO)
+ extra = dict(action='store_const', dest='loglevel', default=logging.INFO)
+ group.add_argument('-q', '--quiet', help='set logging to ERROR', const=logging.ERROR, **extra)
+ group.add_argument('-d', '--debug', help='set logging to DEBUG', const=logging.DEBUG, **extra)
args = parser.parse_args()