當前位置: 首頁>>代碼示例>>Python>>正文


Python DCC.prop_get方法代碼示例

本文整理匯總了Python中DCC.prop_get方法的典型用法代碼示例。如果您正苦於以下問題:Python DCC.prop_get方法的具體用法?Python DCC.prop_get怎麽用?Python DCC.prop_get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DCC的用法示例。


在下文中一共展示了DCC.prop_get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: check_perms

# 需要導入模塊: import DCC [as 別名]
# 或者: from DCC import prop_get [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

示例2: fix_set

# 需要導入模塊: import DCC [as 別名]
# 或者: from DCC import prop_get [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

示例3: build_tree

# 需要導入模塊: import DCC [as 別名]
# 或者: from DCC import prop_get [as 別名]
def build_tree(s, keyname, target, tree, **kwargs):
    # kwargs options:
    #  Exclude - List of handles to not be included in the tree

    excludeList = kwargs.get("Exclude", [])

    documents = []
    collections = []
    others = []
    dict = {}

    fd = DCC.prop_get(s, target, InfoSet="CollCont", Depth="1")

    for idx, d in enumerate(fd):
        handle = d["name"][1]
        if not handle in excludeList:
            if idx == 0:
                dict["parent"] = handle
            else:
                if "Document" in handle:
                    documents.append(handle)
                elif "Collection" in handle:
                    collections.append(handle)
                else:
                    others.append(handle)

    dict["collections"] = collections
    dict["documents"] = documents
    dict["others"] = others

    tree[keyname] = dict
    for col in collections:
        if not col in excludeList:
            tree = build_tree(s, col, col, tree, **kwargs)
    return tree
開發者ID:pbbarnes,項目名稱:Library1,代碼行數:37,代碼來源:Tree.py

示例4: iter_print_tree

# 需要導入模塊: import DCC [as 別名]
# 或者: from DCC import prop_get [as 別名]
def iter_print_tree(s, tree, key, indent):
    branch = tree[key]
    for doc in branch['documents']:
        nameData = DCC.prop_get(s, doc, InfoSet = 'DocBasic')
        print(indent + doc)
        print(indent+'    DCC Title: ',nameData['title'],sep='') 
        print(indent+'    TMT Doc. Num.: ',nameData['tmtnum'],sep='') 
        print(indent+'    Owner: ',nameData['owner-name']) 
        print(indent+'    Filename: ',nameData['filename'],sep='')
        print(indent+'    Date Modified: ',nameData['date'],sep='')
        print(indent+'    URL: ','https://docushare.tmt.org/docushare/dsweb/ServicesLib/',doc,'/View',sep='')
    for other in branch['others']:
        nameData = DCC.prop_get(s, other, InfoSet = 'Title')
        print(indent+other, ':', nameData['title'])        
    for col in branch['collections']:
        nameData = DCC.prop_get(s, col, InfoSet = 'Title')
        print(indent+col, ':', nameData['title'])
        print(indent+'    URL: ','https://docushare.tmt.org/docushare/dsweb/ServicesLib/',col,sep='')        
        iter_print_tree(s, tree, col, indent+'    ')
開發者ID:TMTSystemsEngineering,項目名稱:Library,代碼行數:21,代碼來源:Tree.py

示例5: xls_tree_iter

# 需要導入模塊: import DCC [as 別名]
# 或者: from DCC import prop_get [as 別名]
def xls_tree_iter(s,ws,tree,col, **kwargs):
    global ssrow
    # Write and format the headings in Excel
    xls_tree_headings(ws)

    collData = DCC.prop_get(s, col, InfoSet = 'Title')
    branch = tree[col]
    
    keyword = kwargs.get('Keyword', '')
    
    for doc in branch['documents']:
        print(col,doc)
        docData = DCC.prop_get(s, doc, InfoSet = 'DocBasic')
        docData['Versions'] = DCC.prop_get(s,doc,InfoSet = 'Versions',WriteProp = True)
        if keyword in docData['keywords']:
            xls_print_ssrow(ws, collData, docData, ssrow)
            ssrow += 1
    for newcol in branch['collections']:
        xls_tree_iter(s,ws,tree,newcol,**kwargs)
開發者ID:TMTSystemsEngineering,項目名稱:Library,代碼行數:21,代碼來源:Tree.py

示例6: iter_print_tree

# 需要導入模塊: import DCC [as 別名]
# 或者: from DCC import prop_get [as 別名]
def iter_print_tree(s, tree, key, indent):
    branch = tree[key]
    for doc in branch["documents"]:
        nameData = DCC.prop_get(s, doc, InfoSet="DocBasic")
        print(indent + doc)
        print(indent + "    DCC Title: ", nameData["title"], sep="")
        print(indent + "    TMT Doc. Num.: ", nameData["tmtnum"], sep="")
        print(indent + "    Owner: ", nameData["owner-name"])
        print(indent + "    Filename: ", nameData["filename"], sep="")
        print(indent + "    Date Modified: ", nameData["date"], sep="")
        print(indent + "    URL: ", "https://docushare.tmt.org/docushare/dsweb/ServicesLib/", doc, "/View", sep="")
    for other in branch["others"]:
        nameData = DCC.prop_get(s, other, InfoSet="Title")
        print(indent + other, ":", nameData["title"])
    for col in branch["collections"]:
        nameData = DCC.prop_get(s, col, InfoSet="Title")
        print(indent + col, ":", nameData["title"])
        print(indent + "    URL: ", "https://docushare.tmt.org/docushare/dsweb/ServicesLib/", col, sep="")
        iter_print_tree(s, tree, col, indent + "    ")
開發者ID:pbbarnes,項目名稱:Library1,代碼行數:21,代碼來源:Tree.py

示例7: id_perm_changes

# 需要導入模塊: import DCC [as 別名]
# 或者: from DCC import prop_get [as 別名]
def id_perm_changes(s, handle, fd, permdata, set):
    removelist = []
    changelist = []
    addlist = []
       
    if not check_fd_sel(fd, set) or not check_perm_sel(permdata, set):
        return([removelist,changelist,addlist])
    
    for perm_act in set['PermAct']:
        # pass if no action is defined
        if not perm_act['Action']:
            pass
        elif perm_act['Action']['Action'] == 'Remove':
            for perm in permdata['perms']:
                if Match.parse(perm_act['Criteria'], perm):
                    removelist.append(perm)
        elif perm_act['Action']['Action'] == 'Change':
            for perm in permdata['perms']:
                if Match.parse(perm_act['Criteria'], perm):
                    # delete the old permission
                    newperm = perm.copy()
                    if 'Read' in perm: del(newperm['Read'])
                    if 'Write'in perm: del(newperm['Write'])
                    if 'Manage' in perm: del(newperm['Manage'])
                    for key,val in perm_act['Action']['Perms'].items():
                        newperm[key] = val
                    changelist.append(newperm)  
        elif perm_act['Action']['Action'] == 'Add':
            addFlag = True
            for perm in permdata['perms']:
                if not Match.parse(perm_act['Criteria'], perm):
                    addFlag = False
            if addFlag:
                pEntry = {}
                pEntry['handle'] = perm_act['Action']['Handle']
                grpdata = DCC.prop_get(s, pEntry['handle'], InfoSet = 'Title')
                pEntry['name'] = grpdata['title']
                if 'Read' in perm_act['Action']['Perms']:
                    pEntry['Read'] = perm_act['Action']['Perms']['Read']
                if 'Write' in perm_act['Action']['Perms']:
                    pEntry['Write'] = perm_act['Action']['Perms']['Write']
                if 'Manage' in perm_act['Action']['Perms']:
                    pEntry['Manage'] = perm_act['Action']['Perms']['Manage']
                addlist.append(pEntry) 
                
        elif perm_act['Action']['Action'] == 'Message':
            for perm in permdata['perms']:
                if Match.parse(perm_act['Criteria'], perm):
                    print(perm_act['Action']['Message'])
                    DCC.print_perm(perm, LF = True)
        
    return([removelist, changelist, addlist])
開發者ID:TMTSystemsEngineering,項目名稱:Library,代碼行數:54,代碼來源:PERM.py

示例8: check_cache_okay

# 需要導入模塊: import DCC [as 別名]
# 或者: from DCC import prop_get [as 別名]
def check_cache_okay(s, handle, fname, path = CF.dccfilepath):
    if not '.json' in fname:
        fname = fname + '.json' 
    if not os.path.isfile(path+fname):
        return(False)
    if debug: print('File Exists')
    if 'NoDateCheck' in cacheMode or 'All' in cacheMode:
        dccDate = "Sat, 01 Jan 2000 00:00:00 GMT"
    else:
        fd = DCC.prop_get(s, handle, InfoSet = 'DocDate')
        dccDate = fd['date']
    if not check_date_okay(dccDate, os.path.getctime(path+fname)):
        return(False)
    return(True)
開發者ID:pbbarnes,項目名稱:Library1,代碼行數:16,代碼來源:FileSys.py

示例9: reviewColls

# 需要導入模塊: import DCC [as 別名]
# 或者: from DCC import prop_get [as 別名]
def reviewColls():
    
    set = top_level
    #creates sets that define the user choice to cover miscellaneous cases
    prod = ['prod', 'production', 'p', ' ']
    tes = ['test', 'tes', 't']
    checker = False
    print("Would you like to log into the production site or the test site?")
    print("Valid Inputs are as follows: Production, prod, p, test, t :", end="")
    choice = input().lower()
    #while loop to continue asking the user for input until a correct input has been entered
    while (checker == False):
        #Production site login choice
        if(choice in prod):
            print("You are now logging into the Production version of DocuShare")
            s = DCC.login(Site ='Production')
            checker = True
        #test site login choice
        elif(choice in tes):
            print("You are now logging into the test VM DocuShare")
            s = DCC.login(Site ='Test')
            checker = True
            #cf.dcc_url + cf.dcc_login 
        #error message alerting user to enter a valid choice
        else:
            print("Please enter a valid choice, (P)roduction or (T)est")
            choice = input().lower()
    yes = ['yes', 'y', 'ye']
    #creates a new boolean variable to allow user to break from loop
    checker1 = False
    print("Please enter a collection number that you would like to create a sub-collection under")
    #checker1 only true when user enters correct information 
    while(checker1 == False):
        col = input()
        parent = 'Collection-' + col
        fd = DCC.prop_get(s, parent , InfoSet = 'CollData', Print = True)
        print("Please enter the name of this new collection:")
        name = input()
        # double checks user to make sure that they would like to create this collection
        print("Are you sure that you want to create: " + name + " under " + parent)
        print("Valid Inputs are as follows: Yes, Y, No, N")
        ans = input().lower()
        # checks that user input is correct, if the answer is a valid form of yes
        # then the collection will be made and the user will break from the loop
        if(ans in yes):
            print("You are now making a collection named: " + name + " under " + parent )
            checker1 = True
            createReviewColls(s, parent, set, name)
        else:
            print("Please re-enter a Collection number and Collection name")
開發者ID:gtrancho,項目名稱:Utilities,代碼行數:52,代碼來源:MakeColls.py

示例10: fix_objact

# 需要導入模塊: import DCC [as 別名]
# 或者: from DCC import prop_get [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

示例11: build_tree

# 需要導入模塊: import DCC [as 別名]
# 或者: from DCC import prop_get [as 別名]
def build_tree(s, keyname, target, tree, **kwargs):
    # kwargs options:
    #  Exclude - List of handles to not be included in the tree
    
    excludeList = kwargs.get('Exclude',[])

    documents = []
    collections = []
    others = []
    dict = {}
    
    fd = DCC.prop_get(s, target, InfoSet = 'CollCont', Depth = '1')

    for idx,d in enumerate(fd):
        handle = d['name'][1]
        print(handle)
        if not handle in excludeList:
            if idx == 0:
                dict['parent'] = handle
            else:
                if 'Document' in handle:
                    documents.append(handle)
                elif 'Collection' in handle:
                    collections.append(handle)
                else:
                    others.append(handle)

    dict['collections'] = collections
    dict['documents'] = documents
    dict['others'] = others

    tree[keyname] = dict
    for col in collections:
        if not col in excludeList:
            tree = build_tree(s, col, col, tree, **kwargs)
    return(tree)
開發者ID:TMTSystemsEngineering,項目名稱:Library,代碼行數:38,代碼來源:Tree.py

示例12: get_group_handles

# 需要導入模塊: import DCC [as 別名]
# 或者: from DCC import prop_get [as 別名]
def get_group_handles(s,grp):
    fd = DCC.prop_get(s, grp, InfoSet = 'Group', Print = True, WriteProp = True)
    chandles = []
    for c in fd['children']:
        chandles.append(c[0])
    return(chandles)
開發者ID:pbbarnes,項目名稱:Library1,代碼行數:8,代碼來源:PERM.py

示例13: traverse

# 需要導入模塊: import DCC [as 別名]
# 或者: from DCC import prop_get [as 別名]
def traverse(s, tr, collkey, dirpath = './', indent = '', **kwargs):
    # traverse follows the collection structure on the DCC and replicates it on the local disk
    pflag = False
    savefiles = kwargs.get('SaveFiles', False)
    exclude = kwargs.get('Exclude', [])        
    maxfilesize = kwargs.get('MaxFileSize', sys.maxsize)
        
    branch = tr[collkey]
    collist = branch['collections']
    doclist = branch['documents']
        
    cinfo = DCC.prop_get(s, collkey, InfoSet = 'CollData')
    print(indent,'Files in ', collkey, ': ', cinfo['title'])
    colname = cinfo['title']
    colname = colname.replace('/',' ')
    dirpath = dirpath + colname + '/' 
    if savefiles:
        try:
            os.stat(dirpath)
        except:
            os.mkdir(dirpath) 
    for doc in doclist:
        finfo = DCC.prop_get(s, doc, InfoSet = 'DocBasic')
        print(indent + '\t',doc)
        print(indent + '\t\tTitle: ',finfo['title'])
        print(indent + '\t\tFileName: ',finfo['filename'],' [',finfo['date'],']' ,' [', finfo['size'],' bytes ]')
        filedirpath = dirpath + finfo.get('title').replace('/',' ') + '/'
        filename = finfo.get('filename')
        if savefiles:
            try:
                os.stat(filedirpath)
            except:
                os.mkdir(filedirpath)
        if not os.path.isfile(filedirpath+filename):
            print(indent + "\t\t\tFile doesn't exist")
            if savefiles:
                if finfo['size'] < maxfilesize:
                    print(indent + "\t\t\tGetting file")
                    DCC.file_download(s, doc, filedirpath, finfo['filename'])
                else:
                    print(indent + "\t\t\tFile size exceeds MaxFileSize of ", maxfilesize, "bytes")
            else:
                print(indent + "\t\t\tSaveFiles is False, so file will not be downloaded")


        elif (datetime.strptime(finfo['date'],'%a, %d %b %Y %H:%M:%S %Z') - datetime(1970,1,1)).total_seconds() > os.path.getctime(filedirpath+filename):
            print(indent + "\t\t\tFile exists, but is out of date:", time.ctime(os.path.getctime(filedirpath+filename)))
            if savefiles:
                if finfo['size'] < maxfilesize:
                    print(indent + "\t\t\tGetting updated file")
                    DCC.file_download(s, doc, filedirpath, finfo['filename'])
                else:
                    print(indent + "\t\t\tFile size exceeds MaxFileSize of ", maxfilesize, "bytes")
            else:
                print(indent + "\t\t\tSaveFiles is False, so file will not be downloaded")
        else:
            print(indent + "\t\t\tFile exists, created:", time.ctime(os.path.getctime(filedirpath+filename)))

    for c in collist:
        if (not c == collkey) and (not c in exclude):
            traverse(s, tr, c, dirpath, indent + '\t', **kwargs)
開發者ID:pbbarnes,項目名稱:Library1,代碼行數:63,代碼來源:FileSys.py

示例14: iter_html_tree

# 需要導入模塊: import DCC [as 別名]
# 或者: from DCC import prop_get [as 別名]
def iter_html_tree(s, htmlfile, tree, key, indent, **kwargs):
    branch = tree[key]
    
    keyword = kwargs.get('Keyword', '')
    
    for doc in branch['documents']:
        nameData = DCC.prop_get(s, doc, InfoSet = 'DocBasic')
        if keyword in nameData['keywords']:
            print(doc)
            print('<div style="text-indent: ',str(indent),'em;">',file=htmlfile,sep='')
            print('<p>',file=htmlfile,sep='')
            print(href_str(nameData['title'],url_access(doc)),file=htmlfile,sep='')
            print('[',file=htmlfile,sep='')
            print(href_str(doc,url_view(doc)),file=htmlfile,sep='') 
            print(', ',file=htmlfile,sep='')
            print(href_str('Perm',url_perm(doc)),file=htmlfile,sep='')
            print(', ',file=htmlfile,sep='')
            print(href_str('Ver',url_ver(doc)),file=htmlfile,sep='')
            print(', ',file=htmlfile,sep='')
            print(href_str('Loc',url_loc(doc)),file=htmlfile,sep='')
            print(']',file=htmlfile,sep='')
            print('</p>',file=htmlfile,sep='')
            print('</div>',file=htmlfile,sep='') 
                
            print('<div style="text-indent: ',str(indent+2),'em;">',file=htmlfile,sep='')
            print('<p>TMT Doc. Num.: ',nameData['tmtnum'],'</p>',file=htmlfile,sep='') 
            print('<p>Owner: ',nameData['owner-name'],file=htmlfile,sep='')
            print('<p>Filename: ',nameData['filename'],file=htmlfile,sep='')
            print('<p>Date Modified: ',nameData['date'],file=htmlfile,sep='')
            print('</div>',file=htmlfile,sep='') 
                
    for other in branch['others']:
        print(other)
        nameData = DCC.prop_get(s, other, InfoSet = 'Title')
        print('<div style="text-indent: ',str(indent),'em;">',file=htmlfile,sep='')
        print('<p>',file=htmlfile,sep='')
        print('[',file=htmlfile,sep='')
        print(href_str(other,url_access(other)),file=htmlfile,sep='') 
        print(']',file=htmlfile,sep='')
        print(href_str(nameData['title'],url_view(other)),file=htmlfile,sep='')
        print('[',file=htmlfile,sep='')
        print(href_str('Perm',url_perm(other)),file=htmlfile,sep='')
        print(']',file=htmlfile,sep='')

        print('</p>',file=htmlfile,sep='')
        print('</div>',file=htmlfile,sep='')        
        
    for col in branch['collections']:
        print(col)
        nameData = DCC.prop_get(s, col, InfoSet = 'Title')
        print('<div style="text-indent: ',str(indent),'em;">',file=htmlfile,sep='')
        print('<p></p>',file=htmlfile,sep='')
        print('<p>',file=htmlfile,sep='')
        print(href_str(nameData['title'],url_access(col)),file=htmlfile,sep='')
        print('[',file=htmlfile,sep='')
        print(href_str(col,url_view(col)),file=htmlfile,sep='') 
        print(', ',file=htmlfile,sep='')
        print(href_str('Perm',url_perm(col)),file=htmlfile,sep='')
        print(', ',file=htmlfile,sep='')
        print(href_str('Ver',url_ver(col)),file=htmlfile,sep='')
        print(', ',file=htmlfile,sep='')
        print(href_str('Loc',url_loc(col)),file=htmlfile,sep='')
        print(']',file=htmlfile,sep='')

        print('</p>',file=htmlfile,sep='')
        print('</div>',file=htmlfile,sep='')        
        iter_html_tree(s, htmlfile, tree, col, indent+2, **kwargs)
開發者ID:TMTSystemsEngineering,項目名稱:Library,代碼行數:69,代碼來源:Tree.py

示例15: gen_ss_cid

# 需要導入模塊: import DCC [as 別名]
# 或者: from DCC import prop_get [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


注:本文中的DCC.prop_get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。