Functions | Variables
get_files Namespace Reference

Functions

def testProject (defname="project", appFamily="demo", appName="demo", appVersion="demo")
 

Variables

 Project = sys.argv[1]
 
 Destination = sys.argv[2]
 
 samweb = samweb_client.SAMWebClient(experiment='lbne')
 
 defname
 

Function Documentation

def get_files.testProject (   defname = "project",
  appFamily = "demo",
  appName = "demo",
  appVersion = "demo" 
)

Definition at line 16 of file get_files.py.

16 def testProject(defname="project", appFamily="demo", appName="demo", appVersion="demo"):
17 
18  projectname = samweb.makeProjectName(defname)
19  projectinfo = samweb.startProject(projectname, defname)
20  projecturl = projectinfo["projectURL"]
21  print ("Project name is %s" % projectinfo["project"])
22  print ("Project URL is %s" % projecturl)
23 
24  deliveryLocation = None # set this to a specific hostname if you want - default is the local hostname
25  cpid = samweb.startProcess(projecturl, appFamily, appName, appVersion, deliveryLocation)
26  print ("Consumer process id %s" % cpid)
27  processurl = samweb.makeProcessUrl(projecturl, cpid)
28  print ("Process URL is %s" % processurl)
29 
30  while True:
31  try:
32  newfile = samweb.getNextFile(processurl)['url']
33  print ("Got file %s" % newfile)
34  print ("Attempting globus-url-copy to scratch...")
35  stat = os.system('globus-url-copy %s %s' % (newfile,Destination))
36  except samweb_client.NoMoreFiles:
37  print ("No more files available")
38  break
39 
40  samweb.releaseFile(processurl, newfile)
41  print ("Released file %s" % newfile)
42 
43  samweb.stopProject(projecturl)
44  print samweb.projectSummaryText(projecturl)
45  print ("Project ended")
46 
def testProject(defname="project", appFamily="demo", appName="demo", appVersion="demo")
Definition: get_files.py:16

Variable Documentation

get_files.defname

Definition at line 49 of file get_files.py.

get_files.Destination = sys.argv[2]

Definition at line 12 of file get_files.py.

get_files.Project = sys.argv[1]

Definition at line 11 of file get_files.py.

get_files.samweb = samweb_client.SAMWebClient(experiment='lbne')

Definition at line 14 of file get_files.py.