source: people/peter.buschman/backup_monitoring/dal/builtins/lookup_table.py

Last change on this file was 976, checked in by peter, on Dec 6, 2011 at 10:19:33 AM

Raw checkin of current NetBackup / TSM parsing code.

File size: 318 bytes
RevLine 
[976]1##
2## lookup_table - convert first two columns of an SQL query to a lookup table
3##
4def lookup_table(curs, query):
5
6 lookup = ExtendedDict()
7
8 curs.execute(query)
9
10 for row in curs.fetchall():
11
12 key = row[0]
13 value = row[1]
14
15 lookup[key] = value
16
17 return lookup
Note: See TracBrowser for help on using the repository browser.