本文整理匯總了Python中DBManager.DBManager.printNodes方法的典型用法代碼示例。如果您正苦於以下問題:Python DBManager.printNodes方法的具體用法?Python DBManager.printNodes怎麽用?Python DBManager.printNodes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DBManager.DBManager
的用法示例。
在下文中一共展示了DBManager.printNodes方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: TESTS
# 需要導入模塊: from DBManager import DBManager [as 別名]
# 或者: from DBManager.DBManager import printNodes [as 別名]
#---------------------------------------------------------------------------------------------------------#
print "(========)NODE FUNCTION TESTS(========)"
#---------------------------------------------------------------------------------------------------------#
print "(=) Creating nodes"
d1 = db.createNode(dev1)
d2 = db.createNode(dev2)
d3 = db.createNode(dev3);
if d1 == -1 or d2 == -1 or d3 == -1:
print "\t(-) Node Creation failed."
else:
print "\t(+) Nodes created."
#---------------------------------------------------------------------------------------------------------#
print "(=) Testing displayNodes function"
print "(=) List of all nodes"
db.printNodes()
#---------------------------------------------------------------------------------------------------------#
print "(=) Testing creation of existing node"
try:
dx = db.createNode(dev1)
print "\t(-) Existing Node Creation Test Failed."
except:
print "\t(+) Existing Node Creation Test Passed."
#---------------------------------------------------------------------------------------------------------#
print "(=) activateNode Test"
print "(=) activating device=%s" % dev2
db.activateNode(dev2, ses)
print "\t(+) Activated, printing all nodes in %s" % ses
nodes = db.getNodes(ses)
for node in nodes:
print node