本文整理匯總了Python中DBManager.DBManager.createNode方法的典型用法代碼示例。如果您正苦於以下問題:Python DBManager.createNode方法的具體用法?Python DBManager.createNode怎麽用?Python DBManager.createNode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DBManager.DBManager
的用法示例。
在下文中一共展示了DBManager.createNode方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: DBManager
# 需要導入模塊: from DBManager import DBManager [as 別名]
# 或者: from DBManager.DBManager import createNode [as 別名]
db = DBManager()
if args.session != None:
#create a new session
db.createSession(args.session[0], int(args.session[1]))
print "Created session with passphrase: " + args.session[0] + " for " + args.session[1] + " days"
elif args.archive != None:
#archive session
db.deleteSession(args.archive)
print "Deleted session with passphrase: " + args.archive
elif args.node != None:
#create a new node
db.createNode(args.node)
print "Created node with device ID: " + args.node
elif args.delete != None:
#delete a node
db.deleteNode(args.delete)
print "Deleted node with device ID: " + args.delete
elif args.activate != None:
#activate a node
db.activateNode(args.activate[0], args.activate[1])
print "Added node with device ID: " + args.activate[0] + " to session with passphrase: " + args.activate[1]
elif args.free != None:
#free a node