/+junk/Dataanalys

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/Dataanalys

« back to all changes in this revision

Viewing changes to sqlCmd.py

  • Committer: Gustav Hartvigsson
  • Date: 2010-12-22 22:12:50 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20101222221250-1uxyoae0bc3ky5i8
just added some TODO:s ....

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
                """ Shows the query where
24
24
                IE: select * from <table> where <Command>
25
25
                example:
26
 
                show test2 = 1 and test = 1"""
 
26
                        show test2 = 1 and test = 1"""
27
27
                query = commandPromt.startQueryShow + line + commandPromt.endQuery
28
28
                try:
29
29
                        result = commandPromt.db.execute(query)
35
35
        
36
36
        def do_count(self,line):
37
37
                """ counts the query where
38
 
        IE: select count(*) from <table> where <Command>
39
 
        example:
40
 
        count test2 = 1 and test = 1"""
 
38
                IE: select count(*) from <table> where <Command>
 
39
                example:
 
40
                        count test2 = 1 and test = 1"""
41
41
                query = commandPromt.startQueryCount + line + commandPromt.endQuery
42
42
                try:
43
43
                        result = commandPromt.db.execute(query)
46
46
                else:
47
47
                        for row in result:
48
48
                                print(row[0])
49
 
        
 
49
        #TODO: Add a countAll command, it will show the numbor of each true value in the DB.
 
50
        #IE:
 
51
        #gud: 13
 
52
        #vegan: 4
 
53
        #etc etc.
50
54
 
51
55
        def do_exit(self,line):
52
56
                import awnsers_and_db_edit
53
 
                print("====== returning to man menu ======")
 
57
                print("====== returning to main menu ======")##FIXME: why is this not printed before going into the main menu?
54
58
                awnsers_and_db_edit.menu()
55
59
 
56
60
        def de_EOF(self, line):