Pi: formatting cleanup, show database error
This commit is contained in:
parent
dbcd367d66
commit
b5d732cfd6
@ -104,10 +104,15 @@ class Pi(Module):
|
||||
db.rollback()
|
||||
self.log.error("database error doing pi stuff")
|
||||
self.log.exception(e)
|
||||
return self.reply(connection, event, "database error doing pi stuff")
|
||||
return self.reply(connection, event,
|
||||
"database error while estimating pi: {0:s}".format(str(e)))
|
||||
finally: cur.close()
|
||||
|
||||
return self.reply(connection, event, "({0:.10f}, {1:.10f}) is {2}within the circle. pi is {5:.10f}. (i:{3:d} p:{4:d})".format(x, y, "" if inside else "not ", count_inside, count, pi))
|
||||
return self.reply(connection, event,
|
||||
"({0:.10f}, {1:.10f}) is {2}within the circle. "\
|
||||
"pi is {5:.10f}. (i:{3:d} p:{4:d})".format(x, y,
|
||||
"" if inside else "not ",
|
||||
count_inside, count, pi))
|
||||
|
||||
# vi:tabstop=4:expandtab:autoindent
|
||||
# kate: indent-mode python;indent-width 4;replace-tabs on;
|
||||
|
Loading…
Reference in New Issue
Block a user