Skip to content

Commit

Permalink
Changed device naming in the script
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanRuzavin committed Sep 25, 2024
1 parent 88ada96 commit fb1c219
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions scripts/reupload_databases.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,31 +658,31 @@ def updateBoardsFromSdk(dbs, queries):
return

def updateDevicesFromSdk(dbs, queries):
allBoardDirs = os.listdir(queries)
for eachBoardDir in allBoardDirs:
currentBoardDir = os.path.join(queries, eachBoardDir)
currentBoardFiles = os.listdir(currentBoardDir)
allDevicesDirs = os.listdir(queries)
for eachDeviceDir in allDevicesDirs:
currentDeviceDir = os.path.join(queries, eachDeviceDir)
currentDeviceFiles = os.listdir(currentDeviceDir)

for eachDb in dbs:
if eachDb:
if 'Devices.json' in currentBoardFiles:
with open(os.path.join(currentBoardDir, 'Devices.json'), 'r') as file:
board = json.load(file)
if 'Devices.json' in currentDeviceFiles:
with open(os.path.join(currentDeviceDir, 'Devices.json'), 'r') as file:
device = json.load(file)
file.close()
values = []
collumns = []
for eachKey in board.keys():
for eachKey in device.keys():
collumns.append(eachKey)
values.append(board[eachKey])
values.append(device[eachKey])
insertIntoTable(
eachDb,
'Devices',
values,
','.join(collumns)
)

if 'LinkerTables.json' in currentBoardFiles:
with open(os.path.join(currentBoardDir, 'LinkerTables.json'), 'r') as file:
if 'LinkerTables.json' in currentDeviceFiles:
with open(os.path.join(currentDeviceDir, 'LinkerTables.json'), 'r') as file:
linkerTables = json.load(file)
file.close()
table_keys = [list(table.keys())[0] for table in linkerTables['tables']]
Expand Down

0 comments on commit fb1c219

Please sign in to comment.