def cutcode(code): index = code.rfind(' ') completed = code[:index+1] partial = code[index+1:] print 'completed: "%s"' % completed print 'partial: "%s"' % partial completions = CqlRuleSet.cql_complete(completed, partial, cassandra_conn=cqlkernel, startsymbol='cqlshCommand') print completions
print 'completed: "%s"' % completed print 'partial: "%s"' % partial completions = CqlRuleSet.cql_complete(completed, partial, cassandra_conn=cqlkernel, startsymbol='cqlshCommand') print completions cutcode("create") cutcode("create ") cutcode("create t") # foo = cqlkernel.do_execute("select * from system.local xxx;", False) foo = CqlRuleSet.cql_complete("CREATE", "", cassandra_conn=cqlkernel, startsymbol='cqlshCommand') print foo foo = CqlRuleSet.cql_complete("CREATE ", "T", cassandra_conn=cqlkernel, startsymbol='cqlshCommand') print foo foo = CqlRuleSet.cql_complete( "USE", "", cassandra_conn=cqlkernel, startsymbol='cqlshCommand') print foo foo = CqlRuleSet.cql_complete( "", "CREATE", cassandra_conn=cqlkernel, startsymbol='cqlshCommand')