Script.registerSwitch( "D:", "destination-se=", "Storage Element where to put replica (or a comma separated list)", params.setDestinationSE ) Script.registerSwitch( "S:", "source-se=", "source Storage Element for replication", params.setSourceSE ) 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 ) # default lfn: same file name as local_path lfns = pathFromArguments( session, args ) # destination SE dsts = [ ] if params.destinationSE: dsts = params.destinationSE.split( "," ) else: dsts = session.getReplicationSEs() if not dsts: dsts = [ session.getEnv( "default_se", "DIRAC-USER" )[ "Value" ] ] srcopt = "" if params.sourceSE: srcopt = " " + params.sourceSE
dList.printListing( reverse,timeorder ) else: dList.printOrdered( ) else: print "Error:",result[ 'Message' ] except Exception, x: print "Error:", str( x ) session = DSession( ) Script.enableCS( ) fccli = None if params.getReplicas( ): fccli = ReplicaFileCatalogClientCLI( createCatalog( ) ) params.setLong( None ) else: fccli = FileCatalogClientCLI( createCatalog( ) ) optstr = "" if params.long: optstr += "l" if params.time: optstr += "t" if optstr: optstr = "-" + optstr + " " for p in pathFromArguments( session, args ): print "%s:" % p fccli.do_ls( optstr + p )