当前位置: 首页>>代码示例>>Python>>正文


Python Plasma.ptAgeVault方法代码示例

本文整理汇总了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"
开发者ID:Aurebesh,项目名称:moul-scripts,代码行数:30,代码来源:xCheat.py

示例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
开发者ID:AtlantisShard,项目名称:moul-scripts,代码行数:57,代码来源:xCheat.py

示例3: GetAgeChronicle

# 需要导入模块: import Plasma [as 别名]
# 或者: from Plasma import ptAgeVault [as 别名]
def GetAgeChronicle(varname):
    print "GetAgeChronicle name=" + `varname`
    ageVault = Plasma.ptAgeVault()
    return _GetChronicle(varname,ageVault)
开发者ID:Jrius,项目名称:Drizzle,代码行数:6,代码来源:uam.py

示例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)
开发者ID:Jrius,项目名称:Drizzle,代码行数:6,代码来源:uam.py


注:本文中的Plasma.ptAgeVault方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。