Skip to content

Commit

Permalink
make sure recent_dbs is initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
newville committed Nov 22, 2024
1 parent c363897 commit 524b4af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion epicsapps/instruments/InstrumentApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,11 @@ def connect_db(self, dbname=None, server='sqlite',
self.config['dbname'] = dbname
self.config['server'] = server
self.config['connstr'] = db.conndict
if 'recent_dbs' not in self.config:
self.config['recent_dbs'] = []

if server.lower().startswith('sqlite'):
if dbname in self.config['recent_dbs']:
if dbname in self.config.['recent_dbs']:
self.config['recent_dbs'].remove(dbname)
self.config['recent_dbs'].insert(0, dbname)
else:
Expand Down

0 comments on commit 524b4af

Please sign in to comment.