本文整理汇总了Python中DBSAPI.dbsOptions.DbsOptionParser类的典型用法代码示例。如果您正苦于以下问题:Python DbsOptionParser类的具体用法?Python DbsOptionParser怎么用?Python DbsOptionParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DbsOptionParser类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self):
# , srcURL, dstURL):
try:
srcURL = "http://cmsdbsdev1.cern.ch:8880/DBSANZ/servlet/DBSServlet"
dstURL = "http://cmsdbsprod.cern.ch/cms_dbs_prod_global/servlet/DBSServlet"
optManager = DbsOptionParser()
(opts, args) = optManager.getOpt()
args = {}
args["url"] = srcURL
args["mode"] = "POST"
args["version"] = "DBS_2_0_5"
self.srcApi = DbsApi(args)
args["url"] = dstURL
self.dstApi = DbsApi(args)
except DbsApiException, ex:
print "Caught API Exception %s: %s " % (ex.getClassName(), ex.getErrorMessage())
if ex.getErrorCode() not in (None, ""):
print "DBS Exception Error Code: ", ex.getErrorCode()
示例2: DbsOptionParser
#!/usr/bin/env python
# Revision: 1.3 $"
# Id: DBSXMLParser.java,v 1.3 2006/10/26 18:26:04 afaq Exp $"
#
import sys
import os
from DBSAPI.dbsException import *
from DBSAPI.dbsApiException import *
from DBSAPI.dbsOptions import DbsOptionParser
from DBSAPI.dbsApi import DbsApi
try:
optManager = DbsOptionParser()
(opts,args) = optManager.getOpt()
args = {}
args['url']='http://cmssrv17.fnal.gov:8989/DBS_1_0_5_STABLE/servlet/DBSServlet'
#args['version']='DBS_1_0_7'
args['mode']='POST'
api = DbsApi(args)
#api = DbsApi(opts.__dict__)
srcURL = sys.argv[1]
dstURL = sys.argv[2]
path = sys.argv[3]
block = ""
if len(sys.argv) > 4 :
block = sys.argv[4]
api.migrateDatasetContents(srcURL, dstURL, path, block , False, True)
#print api.listPrimaryDatasets();