You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2011/06/09 18:57:39 UTC
svn commit: r1133999 - /cassandra/drivers/py/cqlsh
Author: jbellis
Date: Thu Jun 9 16:57:39 2011
New Revision: 1133999
URL: http://svn.apache.org/viewvc?rev=1133999&view=rev
Log:
minor cleanup of printerr
Modified:
cassandra/drivers/py/cqlsh
Modified: cassandra/drivers/py/cqlsh
URL: http://svn.apache.org/viewvc/cassandra/drivers/py/cqlsh?rev=1133999&r1=1133998&r2=1133999&view=diff
==============================================================================
--- cassandra/drivers/py/cqlsh (original)
+++ cassandra/drivers/py/cqlsh Thu Jun 9 16:57:39 2011
@@ -135,7 +135,7 @@ class Shell(cmd.Cmd):
self.cursor.execute(statement)
break
except cql.IntegrityError, err:
- self.printerr("Attempt #%d: %s" % (i, str(err)), color=RED)
+ self.printerr("Attempt #%d: %s" % (i, str(err)))
time.sleep(1*i)
if self.cursor.description is _COUNT_DESCRIPTION:
@@ -229,7 +229,7 @@ class Shell(cmd.Cmd):
if newline:
out.write("\n");
- def printerr(self, text, color=None, newline=True):
+ def printerr(self, text, color=RED, newline=True):
self.printout(text, color, newline, sys.stderr)
if __name__ == '__main__':
@@ -260,17 +260,17 @@ if __name__ == '__main__':
color=options.color,
username=options.username,
password=options.password)
- while(True):
+ while True:
try:
shell.cmdloop()
except SystemExit:
readline.write_history_file(HISTORY)
break
except cql.Error, cqlerr:
- shell.printerr(str(cqlerr), color=RED)
+ shell.printerr(str(cqlerr))
except KeyboardInterrupt:
shell.reset_statement()
print
except Exception, err:
- shell.printerr("Exception: %s" % err, color=RED)
+ shell.printerr("Exception: %s" % err)