本文整理匯總了Python中DCC.list_obj_in_coll方法的典型用法代碼示例。如果您正苦於以下問題:Python DCC.list_obj_in_coll方法的具體用法?Python DCC.list_obj_in_coll怎麽用?Python DCC.list_obj_in_coll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DCC
的用法示例。
在下文中一共展示了DCC.list_obj_in_coll方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: make_cid
# 需要導入模塊: import DCC [as 別名]
# 或者: from DCC import list_obj_in_coll [as 別名]
def make_cid(dirpath, CID_coll, htmlfile, outroot):
# Get list of DCC documents from a Word file saved as html
GetUrlWord.get_url_word(dirpath + outroot, dirpath + htmlfile)
# Login to DCC
s = DCC.login(CF.dcc_url + CF.dcc_login)
json_handlelist = dirpath + outroot + 'bothlist.txt'
json_ssdata = dirpath + outroot + 'CID.txt'
get_cid_ssdata(s, json_handlelist, json_ssdata)
xlfile = dirpath + outroot + 'CID_Analysis.xls'
write_spreadsheet(json_ssdata, xlfile)
json_verlist = dirpath + outroot + 'ver_list.txt'
json_doclist = dirpath + outroot + 'doc_list.txt'
make_handle_lists(json_ssdata, json_doclist, json_verlist)
## Remove the files that are currently located in the collection for the CID
if MyUtil.get_yn('Remove location (not delete) of files from ' + CID_coll[0] +'(Y/N)?: '):
doclist = DCC.list_obj_in_coll(s, CID_coll[0],Print=True,Jwrite=False,Depth='infinity',Type='Doc')
for doc in doclist:
DCC.dcc_remove_doc_from_coll(s, doc, CID_coll[0])
## Add CID files to the collection
fh = open(json_doclist, 'r')
dl = json.load(fh)
fh.close()
if MyUtil.get_yn('Add CID files to ' + CID_coll[0] +' (Y/N)?: '):
DCC.add_docs_2_collections(s, dl, CID_coll)
# Check that the expected docs are in the collection
DCC.check_docs_in_coll(s, dl, CID_coll)
示例2: make_cid
# 需要導入模塊: import DCC [as 別名]
# 或者: from DCC import list_obj_in_coll [as 別名]
def make_cid(dirpath, CID_coll, htmlfile, outroot):
# Get list of DCC documents from a Word file saved as html
GetUrlWord.get_url_word(dirpath + outroot, dirpath + htmlfile)
# Login to DCC
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()
json_handlelist = dirpath + outroot + 'bothlist.txt'
json_ssdata = dirpath + outroot + 'CID.txt'
get_cid_ssdata(s, json_handlelist, json_ssdata)
xlfile = dirpath + outroot + 'CID_Analysis.xls'
write_spreadsheet(json_ssdata, xlfile)
json_verlist = dirpath + outroot + 'ver_list.txt'
json_doclist = dirpath + outroot + 'doc_list.txt'
make_handle_lists(json_ssdata, json_doclist, json_verlist)
## Remove the files that are currently located in the collection for the CID
if MyUtil.get_yn('Remove location (not delete) of files from ' + CID_coll[0] +'(Y/N)?: '):
doclist = DCC.list_obj_in_coll(s, CID_coll[0],Print=True,Jwrite=False,Depth='infinity',Type='Doc')
for doc in doclist:
DCC.dcc_remove_doc_from_coll(s, doc, CID_coll[0])
## Add CID files to the collection
fh = open(json_doclist, 'r')
dl = json.load(fh)
fh.close()
if MyUtil.get_yn('Add CID files to ' + CID_coll[0] +' (Y/N)?: '):
DCC.add_docs_2_collections(s, dl, CID_coll)
# Check that the expected docs are in the collection
DCC.check_docs_in_coll(s, dl, CID_coll)