本文整理汇总了Python中Plasma.ptAgeVault方法的典型用法代码示例。如果您正苦于以下问题:Python Plasma.ptAgeVault方法的具体用法?Python Plasma.ptAgeVault怎么用?Python Plasma.ptAgeVault使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plasma
的用法示例。
在下文中一共展示了Plasma.ptAgeVault方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GetChildInfo
# 需要导入模块: import Plasma [as 别名]
# 或者: from Plasma import ptAgeVault [as 别名]
def GetChildInfo(args):
import Plasma
vault = Plasma.ptVault()
hoodGUID = vault.getLinkToMyNeighborhood().getAgeInfo().getAgeInstanceGuid()
print "hoodGUID: ",hoodGUID
parentname = None
agevault = Plasma.ptAgeVault()
ageinfo = agevault.getAgeInfo()
#agerules = agevault.getLinkingRules()
parent = ageinfo.getParentAgeLink()
if parent == None:
agename = ageinfo.getAgeFilename()
print "not a child age. age = ",agename
#print "with linking rules: ",agerules
return
parentinfo = parent.getAgeInfo()
parentname = parentinfo.getAgeFilename()
parentGUID = parentinfo.getAgeInstanceGuid()
print "parentGUID: ",parentGUID
if parentname == "Neighborhood":
if hoodGUID == parentGUID:
print "child of hood: yes"
else:
print "child of hood: different"
else:
print "child of hood: no"
示例2: GetSDL
# 需要导入模块: import Plasma [as 别名]
# 或者: from Plasma import ptAgeVault [as 别名]
def GetSDL(varName):
"""
GetSDL is used to get the value of an Age SDL variable by name.
Expects one argument:
(string) VariableName
"""
import Plasma
if not varName:
print("xCheat.GetSDL(): GetSDL takes one argument: SDL variable name is required.\n Use 'all' to list all variables for the current Age.")
return
ageName = Plasma.PtGetAgeName()
try:
ageSDL = Plasma.PtGetAgeSDL()
except:
print("xCheat.GetSDL(): Unable to retrieve SDL for '{}'.".format(ageName))
return
varList = []
if varName == "all":
if ageName == "Personal":
varRecord = Plasma.ptVault().getPsnlAgeSDL()
if varRecord:
varList = varRecord.getVarList()
else:
vault = Plasma.ptAgeVault()
if vault:
varRecord = vault.getAgeSDL()
if varRecord:
varList = varRecord.getVarList()
if not varList:
print("xCheat.GetSDL(): Couldn't retrieve SDL list.")
return
maxlen = len(max(varList, key=len))
for var in varList:
try:
if len(ageSDL[var]) == 0:
val = ""
else:
val = ageSDL[var][0]
print("xCheat.GetSDL(): {:>{width}} = {}".format(var, val, width=maxlen))
except:
print("xCheat.GetSDL(): Error retrieving value for '{}'.".format(var))
else:
try:
if len(ageSDL[varName]) == 0:
print("xCheat.GetSDL(): SDL variable '{}' is not set.".format(varName))
else:
print("xCheat.GetSDL(): {} = {}".format(varName, ageSDL[varName][0]))
except:
print("xCheat.GetSDL(): SDL variable '{}' not found.".format(varName))
return
示例3: GetAgeChronicle
# 需要导入模块: import Plasma [as 别名]
# 或者: from Plasma import ptAgeVault [as 别名]
def GetAgeChronicle(varname):
print "GetAgeChronicle name=" + `varname`
ageVault = Plasma.ptAgeVault()
return _GetChronicle(varname,ageVault)
示例4: SetAgeChronicle
# 需要导入模块: import Plasma [as 别名]
# 或者: from Plasma import ptAgeVault [as 别名]
def SetAgeChronicle(varname, value):
print "SetAgeChronicle name=" + `varname` + " value="+`value`
ageVault = Plasma.ptAgeVault()
_SetChronicle(varname,value,ageVault)