original_docstring: Transfer a directory between two archives.
          
docstring: Transfer a directory between two archives.
docstring_tokens: Transfer a directory between two archives .
code: def transfer_directory(self, relpath):
          """Transfer a directory between two archives.
          """
          if miscutils.fwdebug_check(0, "ARCHIVE_TRANSFER_GLOBUSONLINE"):
              miscutils.fwdebug_print("\trelpath: %s" % relpath)
  
          srcpath = "%s/%s" % (self.src_archive_info['root'], relpath)
          dstpath = "%s/%s" % (self.dst_archive_info['root'], relpath)
  
          credfile = None
          if X509_USER_PROXY in self.config:
              credfile = self.config[X509_USER_PROXY]
          elif 'X509_USER_PROXY' in os.environ:
              credfile = os.environ['X509_USER_PROXY']
  
          if credfile is None:
              miscutils.fwdie(
                  'Error:  Cannot determine location of X509 proxy.  Either set in config or environment.', 1)
  
          proxy_valid_hrs = 12
          if PROXY_VALID_HRS in self.config:
              proxy_valid_hrs = self.config[PROXY_VALID_HRS]
  
          if GO_USER not in self.config:
              miscutils.fwdie('Error:  Missing %s in config' % GO_USER, 1)
  
          goclient = globonline.DESGlobusOnline(self.src_archive_info, self.dst_archive_info, credfile,
                                                self.config[GO_USER], proxy_valid_hrs)
          transresults = goclient.transfer_directory(srcpath, dstpath)
  
          # get listing of remote directory
          dstlisting = goclient.get_directory_listing(dstpath, self.dst_archive_info['endpoint'], True)
  
          retresults = {}
          for fullname, finfo in list(dstlisting.items()):
              filename = miscutils.parse_fullname(fullname, miscutils.CU_PARSE_FILENAME)
              if finfo is not None:   # include labels required by framework
                  if finfo['type'] == 'file':
                      retresults[filename] = finfo
                      retresults[filename]['filesize'] = retresults[filename]['size']
                      retresults[filename]['fullname'] = fullname
  
          # check for missing files
          srclisting = goclient.get_directory_listing(srcpath, self.src_archive_info['endpoint'], True)
          for fullname, finfo in list(srclisting.items()):
              filename = miscutils.parse_fullname(fullname, miscutils.CU_PARSE_FILENAME)
              if finfo is not None and finfo['type'] == 'file' and filename not in retresults:
                  retresults[filename] = finfo
                  retresults[filename]['filesize'] = retresults[filename]['size']
                  retresults[filename]['fullname'] = fullname
                  retresults[filename]['err'] = 'Unknown error'
  
          return retresults
code_tokens: def transfer_directory ( self , relpath ) : if miscutils . fwdebug_check ( 0 , "ARCHIVE_TRANSFER_GLOBUSONLINE" ) : miscutils . fwdebug_print ( "\trelpath: %s" % relpath ) srcpath = "%s/%s" % ( self . src_archive_info [ 'root' ] , relpath ) dstpath = "%s/%s" % ( self . dst_archive_info [ 'root' ] , relpath ) credfile = None if X509_USER_PROXY in self . config : credfile = self . config [ X509_USER_PROXY ] elif 'X509_USER_PROXY' in os . environ : credfile = os . environ [ 'X509_USER_PROXY' ] if credfile is None : miscutils . fwdie ( 'Error:  Cannot determine location of X509 proxy.  Either set in config or environment.' , 1 ) proxy_valid_hrs = 12 if PROXY_VALID_HRS in self . config : proxy_valid_hrs = self . config [ PROXY_VALID_HRS ] if GO_USER not in self . config : miscutils . fwdie ( 'Error:  Missing %s in config' % GO_USER , 1 ) goclient = globonline . DESGlobusOnline ( self . src_archive_info , self . dst_archive_info , credfile , self . config [ GO_USER ] , proxy_valid_hrs ) transresults = goclient . transfer_directory ( srcpath , dstpath ) dstlisting = goclient . get_directory_listing ( dstpath , self . dst_archive_info [ 'endpoint' ] , True ) retresults = { } for fullname , finfo in list ( dstlisting . items ( ) ) : filename = miscutils . parse_fullname ( fullname , miscutils . CU_PARSE_FILENAME ) if finfo is not None : if finfo [ 'type' ] == 'file' : retresults [ filename ] = finfo retresults [ filename ] [ 'filesize' ] = retresults [ filename ] [ 'size' ] retresults [ filename ] [ 'fullname' ] = fullname srclisting = goclient . get_directory_listing ( srcpath , self . src_archive_info [ 'endpoint' ] , True ) for fullname , finfo in list ( srclisting . items ( ) ) : filename = miscutils . parse_fullname ( fullname , miscutils . CU_PARSE_FILENAME ) if finfo is not None and finfo [ 'type' ] == 'file' and filename not in retresults : retresults [ filename ] = finfo retresults [ filename ] [ 'filesize' ] = retresults [ filename ] [ 'size' ] retresults [ filename ] [ 'fullname' ] = fullname retresults [ filename ] [ 'err' ] = 'Unknown error' return retresults
short_docstring: Transfer a directory between two archives.
short_docstring_tokens: Transfer a directory between two archives .
comment: """Transfer a directory between two archives.
          """$SEP$# get listing of remote directory$SEP$# include labels required by framework$SEP$# check for missing files