本文整理匯總了Python中domogik.common.database.DbHelper.upgrade_list_old方法的典型用法代碼示例。如果您正苦於以下問題:Python DbHelper.upgrade_list_old方法的具體用法?Python DbHelper.upgrade_list_old怎麽用?Python DbHelper.upgrade_list_old使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類domogik.common.database.DbHelper
的用法示例。
在下文中一共展示了DbHelper.upgrade_list_old方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: DbHelper
# 需要導入模塊: from domogik.common.database import DbHelper [as 別名]
# 或者: from domogik.common.database.DbHelper import upgrade_list_old [as 別名]
ret[d[0]]['name'] = d[1]
ret[d[0]]['keys'] = []
ret[d[0]]['keys'].append( d[2] )
else:
ret[d[0]]['keys'].append( d[2] )
return ret
if __name__ == "__main__":
# 0- connect to the DB
db = DbHelper()
db.open_session()
# 1- list current devices (odl ones)
do = True
old_devs = corellateOld(db.upgrade_list_old())
while do:
print old_devs
# show dev menu
i = 1
for dev in old_devs:
print("{0}. {1}".format(i, old_devs[dev]['name']))
i = i + 1
print("0. Exit")
sel = i + 1
while sel > i:
try:
sel = int(raw_input('Select Action: '))
except:
print('ERROR: select a number between 0 and {0}. Try again'.format(i))
sel = i + 1