Use split_query function

Instead of having it duplicated there
This commit is contained in:
Salvo 'LtWorf' Tomaselli 2016-01-02 15:27:51 +01:00
parent e3877a4682
commit fd1e4610fa

View File

@ -25,6 +25,7 @@ import os
import sys import sys
from relational import relation, parser, rtypes from relational import relation, parser, rtypes
from relational import maintenance
from xtermcolor import colorize from xtermcolor import colorize
PROMPT_COLOR = 0xffff00 PROMPT_COLOR = 0xffff00
@ -139,7 +140,6 @@ def load_relation(filename, defname=None):
def survey(): def survey():
'''performs a survey''' '''performs a survey'''
from relational import maintenance
post = {'software': 'Relational algebra (cli)', 'version': version} post = {'software': 'Relational algebra (cli)', 'version': version}
@ -283,13 +283,7 @@ def exec_query(command):
# Finds the name in where to save the query # Finds the name in where to save the query
parts = command.split('=', 1) parts = command.split('=', 1)
relname,query = maintenance.UserInterface.split_query(command)
if len(parts) > 1 and rtypes.is_valid_relation_name(parts[0]):
relname = parts[0]
query = parts[1]
else:
relname = 'last_'
query = command
# Execute query # Execute query
try: try: