本文整理汇总了Python中Tree.return_tree方法的典型用法代码示例。如果您正苦于以下问题:Python Tree.return_tree方法的具体用法?Python Tree.return_tree怎么用?Python Tree.return_tree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tree
的用法示例。
在下文中一共展示了Tree.return_tree方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_perms
# 需要导入模块: import Tree [as 别名]
# 或者: from Tree import return_tree [as 别名]
def check_perms(s, set, handle, treename, **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)
tr = Tree.return_tree(s, handle, treename)
handles = Tree.get_flat_tree(tr)
for handle in handles:
fix_set(s, handle, set, **kwargs)
示例2: main
# 需要导入模块: import Tree [as 别名]
# 或者: from Tree import return_tree [as 别名]
def main():
# Login to DCC
s = DCC.login(CF.dcc_url + CF.dcc_login)
#****** SET Flag for asking about changes ******
ask_flag = MyUtil.get_yn('Ask about changes to files *** BE CAREFUL !!! *** (Y/N)? ')
print()
#****** Choose SET ******
### Safe to run without checking ###
# set = PD.SET_REMOVE_RO_IF_SE_READERSHIP
# set = PD.SET_REMOVE_STR_MANAGERS
# set = PD.SET_REMOVE_INACTIVE
set = PD.SET_PUBLISHED
### Don't Run without checking ###
# set = PD.SET_PERM_NRTCPDR
# set = PD.SET_M1CS_PDR
# set = PD.SET_REMOVE_STR_MANAGERS
# set = PD.SET_SE_READERSHIP
# set = PD.SET_IRIS_REMOVE_MATTHIAS_MANAGE_FALSE
# set = PD.SET_IRIS_REMOVE_ISBRUCKER
# set = PD.SET_REPLACE_IRIS_EAR_WITH_ALL
# set = PD.SET_REMOVE_STR_MANAGERS
# set = PD.SET_REMOVE_UNNEEDED
### IRIS Manager Set with removal of group membership
# set = PD.SET_IRIS_TEAM
# ghs = PERM.get_group_handles(s,PD.grp_IRIS_MANAGE)
# for gh in ghs:
# PD.SET_ADD_IRIS_MANAGER['PermAct'].append(PD.remove_user(gh))
# print(PD.SET_ADD_IRIS_MANAGER['PermAct'])
### IRIS Team Set with removal of group members
# set = PD.SET_IRIS_TEAM
# ghs = PERM.get_group_handles(s,PD.grp_IRIS_team)
# for gh in ghs:
# PD.SET_IRIS_TEAM['PermAct'].append(PD.remove_user_ifperms(gh, PD.manage_false))
# print(PD.SET_IRIS_TEAM['PermAct'])
### M1S Team Set with removal of optics group members
# set = PD.SET_M1S_Suijian
#
# PD.remove_user_if_group(s, set, PD.grp_optics, PD.manage_false)
# PD.remove_user_if_group(s, set, PD.grp_niaotEAR, PD.WM_false)
#
# print(PD.SET_M1S_Suijian['PermAct'])
### CRYO Team Set with removal of optics group members
# set = PD.SET_EMPTY
#
# PD.remove_user_if_group(s, set, PD.grp_CryoTeam, PD.manage_false)
# PD.remove_user_if_group(s, set, PD.grp_CryoManager,PD.read_true)
#
# print(PD.SET_EMPTY['PermAct'])
#****** Choose Collection ******
# m1cs_pdr_root = 'Collection-10725'
# m1cs_pdr_presentation = 'Collection-10821'
# handle = m1cs_pdr_presentation
# config_control = 'Collection-8277'
# handle = config_control
IRIS_science = 'Collection-7542'
IRIS = 'Collection-2463'
Change_control = 'Collection-399'
SE_access_handling = 'Collection-2949'
SE_interface_control = 'Collection-195'
SE_budgets = 'Collection-309'
Published = 'Collection-8277'
IRIS_LPDR = 'Collection-11161'
NRTC_PDR = 'Collection-10045'
M1S_suijian_coll = 'Collection-5678'
CRYO_coll = 'Collection-9141'
LGSF_IOE = 'Collection-4956'
ENC_Construction_Phase = 'Collection-10598'
Test = 'Document-27819'
# set = PD.SET_ENC_CONSTRUCTION
# set = PD.SET_REMOVE_RO_IF_SE_READERSHIP
# handle = ENC_Construction_Phase
# handle = Test
handle = Published
#******!!! Run !!! ******
# print(set)
tr = Tree.return_tree(s, handle, 'Tree_' + handle)
handles = Tree.get_flat_tree(tr)
PERM.check_perms(s, set, handles, Ask = ask_flag)
示例3:
# 需要导入模块: import Tree [as 别名]
# 或者: from Tree import return_tree [as 别名]
#!/usr/bin/env python3
import Tree
import DCC
# This script can be used to create an html list and a spreadsheet of documents below the
# specified collection. The main use of the code is to create CID lists in html and spreadsheet
# from from a set of collections containing CID files
froot = 'NFIRAOS CID'
coll = 'Collection-10609'
keyword_filter = '' # if no keyword set keyword_filter = ''
# Login to DCC
s = DCC.login(Site = 'Production')
tr = Tree.return_tree(s, coll, froot)
Tree.xls_tree(s,tr,coll,froot, Keyword = keyword_filter)
Tree.html_tree(s,tr,froot, Keyword = keyword_filter)
示例4: print
# 需要导入模块: import Tree [as 别名]
# 或者: from Tree import return_tree [as 别名]
docmodreport.append('CADDocumentNo')
docmodreport.append('dccDocHandleHyperlink')
docmodreport.append('dccDocVersionHyperlink')
docmodreport.append('dccDocSignedApproved')
docmodreport.append('TMTPublished')
docmodreport.append('dccDocStatus')
docmodreport.append('dccStatusCheckDate')
docmodreport.append('dccDocHandleNo')
s = DCC.login(CF.dcc_url + CF.dcc_login)
docmodlist = []
pub_coll = 'Collection-8277'
tr = Tree.return_tree(s, pub_coll, 'Tree_' + pub_coll)
pub_list = Tree.get_flat_tree(tr)
docmatch = {}
for ref in reflist.items():
print('looking for ', ref[0], ref[1])
for doc in dm.items():
if DocMod.is_in_dict(ref[1],doc[1]):
print('\n\n\n############## Found Document Module Object #:', doc[0], '##############\n')
DocMod.print_report(docmodreport, doc[1])
handle = 'Document-' + doc[1]['dccDocHandleNo']
docmatch[handle] = doc[1]
# Construct a new PERM set for each handle entry