本文整理汇总了Python中DIRAC.Interfaces.API.Dirac.Dirac.removeFile方法的典型用法代码示例。如果您正苦于以下问题:Python Dirac.removeFile方法的具体用法?Python Dirac.removeFile怎么用?Python Dirac.removeFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.Interfaces.API.Dirac.Dirac
的用法示例。
在下文中一共展示了Dirac.removeFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DSession
# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import removeFile [as 别名]
' $ drm ./some_lfn_file',
] )
)
Script.parseCommandLine( ignoreErrors = True )
args = Script.getPositionalArgs()
session = DSession( )
catalog = DCatalog( )
if len( args ) < 1:
print "Error: No argument provided\n%s:" % Script.scriptName
Script.showHelp( )
DIRAC.exit( -1 )
lfns = [ ]
for path in args:
lfns.append( pathFromArgument( session, path ))
from DIRAC.Interfaces.API.Dirac import Dirac
dirac = Dirac( )
exitCode = 0
for lfn in lfns:
result = dirac.removeFile( lfn, printOutput = False )
if not result[ 'OK' ]:
print 'ERROR %s: %s' % ( lfn, result[ 'Message' ] )
exitCode = 2
DIRAC.exit( exitCode )
示例2: Dirac
# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import removeFile [as 别名]
#!/usr/bin/env python2
from DIRAC.Core.Base import Script
Script.parseCommandLine()
from DIRAC.Interfaces.API.Dirac import Dirac
dirac = Dirac()
file_collection = []
for line in open('vo.cta.in2p3.fr-user-t-tmichael.lfns'):
line = line.strip()
if "prod3b/paranal_LND/classified_events_electron_tail" not in line:
continue
if len(file_collection) < 100:
file_collection.append(line)
else:
print("removing:")
print(file_collection)
dirac.removeFile(file_collection, True)
file_collection = []
if file_collection:
print("removing:")
print(file_collection)
dirac.removeFile(file_collection, True)
示例3: len
# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import removeFile [as 别名]
Script.setUsageMessage( '\n'.join( [ __doc__.split( '\n' )[1],
'Usage:',
' %s [option|cfgfile] ... LFN ...' % Script.scriptName,
'Arguments:',
' LFN: Logical File Name or file containing LFNs' ] ) )
Script.parseCommandLine( ignoreErrors = True )
lfns = Script.getPositionalArgs()
if len( lfns ) < 1:
Script.showHelp()
from DIRAC.Interfaces.API.Dirac import Dirac
dirac = Dirac()
exitCode = 0
if len( lfns ) == 1:
try:
f = open( lfns[0], 'r' )
lfns = f.read().splitlines()
f.close()
except:
pass
for lfn in lfns:
result = dirac.removeFile( lfn, printOutput = True )
if not result['OK']:
print 'ERROR %s: %s' % ( lfn, result['Message'] )
exitCode = 2
DIRAC.exit( exitCode )