本文整理汇总了Python中DIRAC.DataManagementSystem.Client.DataManager.DataManager.cleanLogicalDirectory方法的典型用法代码示例。如果您正苦于以下问题:Python DataManager.cleanLogicalDirectory方法的具体用法?Python DataManager.cleanLogicalDirectory怎么用?Python DataManager.cleanLogicalDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.DataManagementSystem.Client.DataManager.DataManager
的用法示例。
在下文中一共展示了DataManager.cleanLogicalDirectory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: removeOutputData
# 需要导入模块: from DIRAC.DataManagementSystem.Client.DataManager import DataManager [as 别名]
# 或者: from DIRAC.DataManagementSystem.Client.DataManager.DataManager import cleanLogicalDirectory [as 别名]
def removeOutputData(baseDir, logLevel="INFO"):
gLogger.setLevel(logLevel)
res = getProxyInfo(False, False)
if not res["OK"]:
gLogger.error("Failed to get client proxy information.", res["Message"])
return {"OK": False, "Message": "Failed to get client proxy information: %s" % str(res["Message"]), "RC": 71}
# ######################################################################################################## #
rm = DataManager()
try:
result = rm.cleanLogicalDirectory(baseDir)
except KeyError, ke:
return {"OK": False, "Message": "Caught key error, full stacktrace below\n%s" % str(ke), "RC": 137}
示例2: len
# 需要导入模块: from DIRAC.DataManagementSystem.Client.DataManager import DataManager [as 别名]
# 或者: from DIRAC.DataManagementSystem.Client.DataManager.DataManager import cleanLogicalDirectory [as 别名]
import sys,os
from DIRAC.Core.Utilities.List import sortList,randomize
if len(sys.argv) < 2:
Script.showHelp()
DIRACExit( -1 )
else:
inputFileName = sys.argv[1]
if os.path.exists(inputFileName):
inputFile = open(inputFileName,'r')
string = inputFile.read()
lfns = sortList(string.splitlines(),True)
inputFile.close()
else:
lfns = [inputFileName]
from DIRAC.DataManagementSystem.Client.DataManager import DataManager
dm = DataManager()
for lfn in sortList(lfns):
lfn = lfn.strip()
if not lfn: continue
print "Cleaning directory %s ... " % lfn,
sys.stdout.flush()
result = dm.cleanLogicalDirectory( lfn )
if result['OK']:
print 'OK'
else:
print "ERROR: %s" % result['Message']