def login(vo, addr = None, keypath = " "): """ Connect to Grid and create a new proxy.""" if is_ui() == 1: gr = Grid() else: remhost = RemoteHost(addr, keypath) gr = Grid(rhost = remhost) creategridtemp(gr.getExecutor()) gr.setVo(vo) gr.newProxy() gr.getData().chdir("/grid/"+vo) Jobs(gr.getExecutor())
def chdir(_dir): """ Change default lfn directory """ gr = Grid() return gr.getData().chdir(_dir)
def mkdir(_dir): """ Create a new directory """ gr = Grid() return gr.getData().mkdir(_dir)
def lsdir(_dir = None): """ List files of a directory """ gr = Grid() return gr.getData().lsdir(_dir)
def remove(gridfile, se = None): """ Remove a file from a storage element """ gr = Grid() return gr.getData().remove(gridfile, gr.getVo(), se)
def replicate(gridfile, se): """ Replicate (Copy) a file to the storage element """ gr = Grid() return gr.getData().replicate(gridfile, se, gr.getVo())
def download(gridfile, localfile): """ Doenload a file from a storage element """ gr = Grid() return gr.getData().download(gridfile, localfile, gr.getVo())
def upload(localfile, gridfile, se): """ Upload a file to a storage element """ gr = Grid() return gr.getData().upload(localfile, gridfile, gr.getVo(), se)
def rmdir(_dir): """ Remove a directory """ gr = Grid() return gr.getData().rmdir(_dir)