示例#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