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


Python DCC.change_owner方法代码示例

本文整理汇总了Python中DCC.change_owner方法的典型用法代码示例。如果您正苦于以下问题:Python DCC.change_owner方法的具体用法?Python DCC.change_owner怎么用?Python DCC.change_owner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DCC的用法示例。


在下文中一共展示了DCC.change_owner方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: fix_objact

# 需要导入模块: import DCC [as 别名]
# 或者: from DCC import change_owner [as 别名]
def fix_objact(s, fd, handle, set, **kwargs):
    ask_flag = kwargs.get('Ask',True)
    
    if not check_fd_sel(fd, set):
        return
        
    for obj_act in set['ObjAct']:
        if not obj_act['Action']:
            pass

        if Match.parse(obj_act['Criteria'], fd):
            if obj_act['Action']['Action'] == 'SetOwner':
                nu = DCC.prop_get(s, obj_act['Action']['Owner'], InfoSet = 'User')
                print('??? Change Owner from [', fd['owner-userid'], ',', fd['owner-username'], '] to [', 
                                        nu['owner-userid'], ',', nu['owner-username'], ']', sep = '', end = '') 
                if ask_flag == False or MyUtil.get_yn(': (Y/N)? '):
                    DCC.change_owner(s, handle, obj_act['Action']['Owner'])
                    
            elif obj_act['Action']['Action'] == 'AddKeyword':
                print('??? Add Keyword "', obj_act['Action']['Keyword'], '" to "', fd['keywords'].strip(), '"', sep = '', end = '') 
                if ask_flag == False or MyUtil.get_yn(': (Y/N)? '):
                    kw = obj_act['Action']['Keyword'] + fd['keywords'].strip(' ')
                    DCC.set_metadata(s, handle, Keywords = kw)

            elif obj_act['Action']['Action'] == 'DelKeyword':
                print('??? Remove Keyword "', obj_act['Action']['Keyword'], '" from "', fd['keywords'], '"', sep = '', end = '') 
                if ask_flag == False or MyUtil.get_yn(': (Y/N)? '):
                    kw = fd['keywords'].strip(' ').replace(obj_act['Action']['Keyword'], '')
                    DCC.set_metadata(s, handle, Keywords = kw)
                
            elif obj_act['Action']['Action'] == 'RepTitle':
                print('??? Change Title to "', obj_act['Action']['Title'], '" from "', fd['title'], '"', sep = '', end = '') 
                if ask_flag == False or MyUtil.get_yn(': (Y/N)? '):
                    DCC.set_metadata(s, handle, Title = obj_act['Action']['Title'])

            elif obj_act['Action']['Action'] == 'RepTmtNum':
                print('??? Change TmtNum to "', obj_act['Action']['TmtNum'], '" from "', fd['tmtnum'], '"', sep = '', end = '') 
                if ask_flag == False or MyUtil.get_yn(': (Y/N)? '):
                    DCC.set_metadata(s, handle, Summary = obj_act['Action']['TmtNum'])
                pass
                
            elif obj_act['Action']['Action'] == 'Message':
                print(obj_act['Action']['Message'])
                
            else:
                print('Error in PERM.fix_objact: ObjAct Action not recognized:', obj_act['Action']['Action'])
开发者ID:TMTSystemsEngineering,项目名称:Library,代码行数:48,代码来源:PERM.py


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