On 22 June 2013 16:24, Rick Johnson <rantingrickjohn...@gmail.com> wrote: > On Saturday, June 22, 2013 8:36:43 AM UTC-5, Joshua Landau wrote: >> message = "Item wrote to MongoDB database " >> message += "{0[MONGODB_DB]}/{0[MONGODB_COLLECTION]}".format(settings) >> log.msg(message, level=log.DEBUG, spider=spider) > > If you're going to whore out parts of the string to > variables i would suggest going for the gold and actually > make it readable.
Erm, as you wish. > Plus, your use of the format syntax is > incorrect. Wut? > _arg1 = settings['MONGODB_DB'] > _arg2 = settings['MONGODB_COLLECTION'] > _fmtstr = "Item wrote to MongoDB database {0}, {1}" > msg = _fmtstr.format(_arg1, _arg2) > log.msg(msg, level=log.DEBUG, spider=spider) > > If you want readability, now you got it. If you say so. -- http://mail.python.org/mailman/listinfo/python-list