def test_select_from_file_to_file(self): to_file = 'to_file.csv' args = [ '--select=*', '--from=tests/sample-comma.csv', '--to=tests/' + to_file ] args_exp = ['--select=*', '--from=tests/' + to_file] run(args) assert run(args_exp) == self.all_rows
def start_basic(): """ Start an interactive interpreter session. """ import interface import interpreter try: with interpreter.SessionLauncher(): try: interface.run() except interface.InitFailed: logging.error('Failed to initialise interface.') except error.RunError as e: # only runtime errors that occur on interpreter launch are caught here # e.g. "File not Found" for --load parameter logging.error(e.message) except Exception: logging.error('Unhandled exception\n%s' % traceback.format_exc())
def test_select_from_file_sorted_by_more_than_one_column(self): args = [ '--select=*', '--from=tests/sample-semicolon.csv', '--delimiter=;', '--sortedby=c1,c2,c3' ] assert run(args) == self.all_sorted_c1_rows
def test_select_from_file_with_different_delimiter(self): args = [ '--select=*', '--from=tests/sample-semicolon.csv', "--delimiter=;" ] assert run(args) == self.all_rows
def test_select_one_column_from_file(self): args = ['--select=c1', '--from=tests/sample-comma.csv'] assert run(args) == self.rows_c1
def test_select_more_than_one_column_from_file(self): args = ['--select=c1,c2,c3', '--from=tests/sample-comma.csv'] assert run(args) == self.all_rows
''' @author: dibyendu das The main module. Everything else has been called from here. ''' from path import HOME_PATH import os if not os.path.exists(HOME_PATH + '/.plexicon/data/'): os.makedirs(HOME_PATH + '/.plexicon/data/') import random THEME_INDEX = random.randint(0, 3) from interface import run run(THEME_INDEX) for dataFile in os.listdir(HOME_PATH + '/.plexicon/data/'): os.remove(HOME_PATH + '/.plexicon/data/' + dataFile)
def test_select_all_from_file(self): args = ['--select=*', '--from=tests/sample-comma.csv'] assert run(args) == self.all_rows
import interface interface.run()
def main(): interface.run()
def main(): try: c.execute(sql) run() except: run()
import sys from interface import run run(sys.argv[1:])
def interface_function(q): root = tk.Tk() root.geometry("800x600") interface.run(root, q) return root