Exemplo n.º 1
0
    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
Exemplo n.º 2
0
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())
Exemplo n.º 3
0
    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
Exemplo n.º 4
0
    def test_select_from_file_with_different_delimiter(self):
        args = [
            '--select=*', '--from=tests/sample-semicolon.csv', "--delimiter=;"
        ]

        assert run(args) == self.all_rows
Exemplo n.º 5
0
    def test_select_one_column_from_file(self):
        args = ['--select=c1', '--from=tests/sample-comma.csv']

        assert run(args) == self.rows_c1
Exemplo n.º 6
0
    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
Exemplo n.º 7
0
'''
@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)
Exemplo n.º 8
0
    def test_select_all_from_file(self):
        args = ['--select=*', '--from=tests/sample-comma.csv']

        assert run(args) == self.all_rows
Exemplo n.º 9
0
import interface
interface.run()
Exemplo n.º 10
0
def main():
    interface.run()
Exemplo n.º 11
0
def main():
    try:
        c.execute(sql)
        run()
    except:
        run()
Exemplo n.º 12
0
import sys
from interface import run

run(sys.argv[1:])
Exemplo n.º 13
0
def interface_function(q):
    root = tk.Tk()
    root.geometry("800x600")
    interface.run(root, q)
    return root