ganga.GangaCore.GPIDev.Lib.File.GoogleFile module

The GoogleFile outputfile type allows for files to be directly uploaded, downloaded, removed and restored from the GoogleDrive service. It can be used as part of a job to output data directly to GoogleDrive, or standalone through the Ganga interface.

example job: j=Job(application=Executable(exe=File(‘/home/hep/hs4011/Tests/testjob.sh’), args=[]),outputfiles=[GoogleFile(‘TestJob.txt’)])

j.submit()

### This job will automatically upload the outputfile ‘TestJob.txt’ to GoogleDrive.

example of standalone submission:

g=GoogleFile(‘TestFile.txt’)

g.localDir = ‘~/TestDirectory’ ### The file’s location must be specified for standalone submission

g.put() ### The put() method uploads the file to GoogleDrive directly

The GoogleFile outputfile is also compatible with the Dirac backend, making outputfiles from Dirac-run jobs upload directly to GoogleDrive.

The first time GoogleFile is used for upload or download, an interactive process will start to get authenticated.

ganga.GangaCore.GPIDev.Lib.File.GoogleFile.const_lock

This is a context manager which acquires the const write lock on the object’s root object.

This lock acquires exclusive access over an object tree to prevent it from changing. Reading schema attributes on the object is still allowed but changing them is not. Only one thread can hold this lock at once.