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


Python DCC.print_doc_basic方法代码示例

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


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

示例1: fix_set

# 需要导入模块: import DCC [as 别名]
# 或者: from DCC import print_doc_basic [as 别名]
def fix_set(s, handle, set, **kwargs):
    # kwargs
    #   ask = True | False, Do/Don't ask if changes should be made (!!! Dangerous !!!)
    #   default is ask

    if 'Document-' in handle:
        fd = DCC.prop_get(s, handle, InfoSet = 'DocBasic')
    elif 'Collection-' in handle:
        fd = DCC.prop_get(s, handle, InfoSet = 'CollData')
    else:
        fd = DCC.prop_get(s, handle, InfoSet = 'Title')    
    permdata = DCC.prop_get(s, handle, InfoSet = 'Perms')
    print(fd['handle'], ':', fd['title']) 
    
    fd['permissions'] = permdata
    [removelist, changelist, addlist] = id_perm_changes(s,handle, fd, permdata, set) 
    ch_flag = False
    if len(removelist) or len(changelist) or len(addlist):
        print('\n##############       ENTRY       ##############')
        if 'Document-' in handle:
            DCC.print_doc_basic(fd)
        elif 'Collection-' in handle:
            DCC.print_coll_data(fd)
        else:
            print('Not Document or Collection:', handle, ':', fd['title'])   
        print('https://docushare.tmt.org/docushare/dsweb/ServicesLib/',handle,'/Permissions',sep='')
        DCC.print_perms(permdata)    
        print('\nSuggested Changes...')
        print_perm_changes(removelist, changelist, addlist)
        make_perm_changes(s, handle, permdata, removelist, changelist, addlist, **kwargs)
开发者ID:pbbarnes,项目名称:Library1,代码行数:32,代码来源:PERM.py

示例2: check_perms

# 需要导入模块: import DCC [as 别名]
# 或者: from DCC import print_doc_basic [as 别名]
def check_perms(s, set, handles, **kwargs):
    ask_flag = kwargs.get('Ask', True)
    if not ask_flag:
        if not MyUtil.get_yn('!!! Warning !!! ask = False: Will not ask to make changes, okay? Enter N to Exit, Y to Continue:'):
            print('exiting...')
            sys.exit(0)
    for handle in handles:
        if 'Document-' in handle:
            fd = DCC.prop_get(s, handle, InfoSet = 'DocBasic')
        elif 'Collection-' in handle:
            fd = DCC.prop_get(s, handle, InfoSet = 'CollData')
        else:
            fd = DCC.prop_get(s, handle, InfoSet = 'Title')    
        fd['permissions'] = DCC.prop_get(s, handle, InfoSet = 'Perms')
#         print(fd['handle'], ':', fd['title'])    
        
        print('\n>>>>>>>>>>>>>>       DCC Information       <<<<<<<<<<<<<<')
        if 'Document-' in handle:
            DCC.print_doc_basic(fd)
        elif 'Collection-' in handle:
            DCC.print_coll_data(fd)
        else:
            print('Not Document or Collection:', handle, ':', fd['title'])   
        print('\n\tDoc Properties URL: ',Tree.url_view(handle))
        print('\tPermissions URL: ',Tree.url_perm(handle))
        print('\tGet Document URL: ',Tree.url_access(handle))

        
        print()
    
        fix_objact(s, fd, handle, set, **kwargs)
        fix_permact(s, fd, handle, set, **kwargs)
开发者ID:TMTSystemsEngineering,项目名称:Library,代码行数:34,代码来源:PERM.py

示例3: gen_ss_cid

# 需要导入模块: import DCC [as 别名]
# 或者: from DCC import print_doc_basic [as 别名]
def gen_ss_cid(s, dl):
    # Spreadsheet dataset will be a list of lists
    ss = []
    for d in dl:
        ssrow = []
        print("trying", d)
        if 'Document-' in d:
            # CID link is to a document Handle
            doc = DCC.prop_get(s,d,InfoSet = 'DocBasic')
            doc['Versions'] = DCC.prop_get(s,d,InfoSet = 'Versions')
            # Now read preferred version
            prefver = DCC.prop_get(s,doc['Versions']['prefver'],InfoSet = 'VerAll')
            # Check how many places the document is located
            doc['locations'] = DCC.prop_get(s,d,InfoSet = 'Parents')
            # Subject Document
            ssrow.append(doc['handle'])
            ssrow.append(doc['title'])
            ssrow.append(doc['tmtnum'])
            ssrow.append(doc['owner-username'])  
            # Evaluation of current reference
            ssrow.append('Doc Ref')             
            # Current reference
            ssrow.append(doc['handle'])
            ssrow.append(doc['title'])
            ssrow.append(doc['owner-username'])   
            ssrow.append(doc['date'])
            # Suggested reference
            ssrow.append(prefver['dccver'])
            ssrow.append(prefver['vercomment'])
            ssrow.append(prefver['owner-username'])
            ssrow.append(prefver['date'])            
            DCC.print_doc_basic(doc)
            DCC.print_ver(prefver)
            DCC.print_locations(doc)
            print(doc['handle'], doc['title'], doc['tmtnum'], doc['owner-username'])
            print("Doc Ref")
            print(prefver['dccver'], prefver['vercomment'], prefver['owner-username'], prefver['date'])
            print('Document has %d locations' % len(doc['locations']))

        elif 'Version-' in d:
            # CID link is to a version handle
            ver = DCC.prop_get(s,d,InfoSet = 'VerAll')
            doc = DCC.prop_get(s,ver['dccdoc'],InfoSet = 'DocBasic')
            # Subject Document
            ssrow.append(doc['handle'])
            ssrow.append(doc['title'])
            ssrow.append(doc['tmtnum'])
            ssrow.append(doc['owner-username'])  
            # find info on the preferred version
            prefver = DCC.prop_get(s,doc['prefver'],InfoSet = 'VerAll')
            # Evaluation of current reference          
            print("CID references Version")
            print(doc['handle'], doc['title'], doc['tmtnum'])
            print("Referenced Version")
            print(ver['dccver'], ver['vercomment'], ver['owner-username'], ver['date'])
            if prefver['dccver'] == ver['dccver']:
                print("Referenced Version IS the Preferred Version")
                # Evaluation of current reference
                ssrow.append('Pref. Ver.') 
                DCC.print_doc_all(doc)
                DCC.print_ver(prefver)
                # Current reference
                ssrow.append(prefver['dccver'])
                ssrow.append(prefver['vercomment'])
                ssrow.append(prefver['owner-username'])
                ssrow.append(prefver['date'])  
            else:
                print("Referenced Version IS NOT the Preferred Version") 
                # Evaluation of current reference
                ssrow.append('Non-Pref. Ver.') 
                print("Non-Preferred Version")
                print(prefver['dccver'], prefver['vercomment'], prefver['owner-username'], prefver['date'])    
                DCC.print_doc_all(doc)
                DCC.print_ver(ver)  
                DCC.print_ver(prefver) 
                # Current reference
                ssrow.append(ver['dccver'])
                ssrow.append(ver['vercomment'])
                ssrow.append(ver['owner-username'])
                ssrow.append(ver['date']) 
            # Suggested reference
            ssrow.append(prefver['dccver'])
            ssrow.append(prefver['vercomment'])
            ssrow.append(prefver['owner-username'])
            ssrow.append(prefver['date'])           
        else:
            print("Don't know how to handle", d)
            sys.exit()  
        ss.append(ssrow)
    return(ss)
开发者ID:gtrancho,项目名称:Library,代码行数:92,代码来源:CID.py

示例4: print

# 需要导入模块: import DCC [as 别名]
# 或者: from DCC import print_doc_basic [as 别名]
            
            PERM.check_perms(s, SET_TMTPUBLISHED, [handle], Ask = True)            
            docmodlist.append('Document-' + doc[1]['dccDocHandleNo'])
            

print('\n\n*********** Audit of documents in Published Collection ****************')
for dcc_doc in pub_list:
    if 'Document-' in dcc_doc:
        fd = DCC.prop_get(s, dcc_doc, InfoSet = 'DocBasic')
        fd['permissions'] = DCC.prop_get(s, dcc_doc, InfoSet = 'Perms')
        fd['versions'] = DCC.prop_get(s, dcc_doc, InfoSet = 'Versions')
        print('\n############## ', dcc_doc, '##############')
        if dcc_doc in docmodlist:
            DocMod.print_report(docmodreport, docmatch[dcc_doc])
            print('\n')
            DCC.print_doc_basic(fd)
            print('\n\t DCC View URL: ',Tree.url_view(fd['handle']),'\n')

            print('*** [', dcc_doc, '] is recorded as published in Document Module')
            if not 'TMTPublished' in fd['keywords']:
                print('*** WARNING: Document in Published Collection, but TMTPublished keyword is not set')
#                 print('Checking flag_update = ',flag_update)
                if flag_update and MyUtil.get_yn('Change DCC Keyword to add TMTPublished (Y/N)? '):
                    DCC.set_metadata(s,fd['handle'],Keywords = fd['keywords'] + ' TMTPublished')
                                    
            docmod_title = docmatch[dcc_doc].get('dccDocTitle', 'No Attribute Value Assigned')
            docmod_type = docmatch[dcc_doc].get('DocType', 'No Attribute Value Assigned')
            docmod_short = docmatch[dcc_doc].get('dccShortTitle', 'No Attribute Value Assigned')
            docmod_no = docmatch[dcc_doc].get('dccDocNo', 'No Attribute Value Assigned')
            docmod_rev = docmatch[dcc_doc].get('dccDocRev', 'No Attribute Value Assigned') 
            docmod_cadno = docmatch[dcc_doc].get('CADDocumentNo', '')
开发者ID:gtrancho,项目名称:Utilities,代码行数:33,代码来源:DocModAudit.py


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