summaryrefslogtreecommitdiff
path: root/core/database/view-table.py
blob: 615b40819b3443a93979fd3cf728391887e6216f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import os
import sqlite3
import sys

try:
    BASE_DIR = directory_name=sys.argv[1]
except:
    BASE_DIR = os.path.dirname(os.path.abspath(__file__))
db_location = os.path.join(BASE_DIR, 'opendc.db')

conn = sqlite3.connect(db_location)
c = conn.cursor()

rows = c.execute('SELECT * FROM ' + sys.argv[2])

for row in rows:
    print row