예제 #1
0
파일: database.py 프로젝트: sginne/simAS
def ListPackages(Where=''):
    out = []
    DbConnection = sqlite3.connect('main.db')
    DbCursor = DbConnection.cursor()
    for row in DbCursor.execute("SELECT * FROM PACKAGES " + Where).fetchall():
        Obj = Wire()
        Obj.Id = row[0]
        Obj.Position = row[1]
        Obj.Destination = row[14]
        out.append(Obj)
    DbConnection.close()
    return out
예제 #2
0
파일: database.py 프로젝트: sginne/simAS
def ListWires(Where=''):
    out = []
    DbConnection = sqlite3.connect('main.db')
    DbCursor = DbConnection.cursor()
    for row in DbCursor.execute("SELECT * FROM WIRES " + Where).fetchall():
        Obj = Wire()
        Obj.Id = row[0]
        Obj.Port1Id = row[1]
        Obj.Port2Id = row[2]
        out.append(Obj)
    DbConnection.close()
    return out