Download:
child 25:2dd502d4e9df
parent 23:48c2c7e345ca
24:9c7f41fa62d1
Anton Shestakov <av6@dwimlabs.net>, Sat, 16 Jul 2016 15:12:21 +0800
rollbot: inline "if hasattr(args, 'config')" block Helps with keeping arguments and their defaults closer to each other.

1 файлов изменено, 1 вставок(+), 4 удалений(-) [+]
rollbot.py file | annotate | diff | comparison | revisions
--- a/rollbot.py Wed Jul 06 17:23:23 2016 +0800
+++ b/rollbot.py Sat Jul 16 15:12:21 2016 +0800
@@ -244,10 +244,7 @@
logging.basicConfig(level=args.loglevel, format='%(asctime)s %(levelname)-8s %(message)s')
- if hasattr(args, 'config'):
- config = yaml.safe_load(args.config)
- else:
- config = {}
+ config = yaml.safe_load(args.config) if hasattr(args, 'config') else {}
jid = lookup('jid', args, config)
password = lookup('password', args, config)