#NEWLINE# def archive_retrieve_one( self , name ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# archive_id = self . cache . get_archive_id ( self . args . vault , name ) #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# raise ConsoleError ( ( 'archive %r not found' % name ) ) #NEWLINE# #UNINDENT# vault = self . connection . get_vault ( self . args . vault ) #NEWLINE# retrieval_jobs = find_retrieval_jobs ( vault , archive_id ) #NEWLINE# complete_job = find_complete_job ( retrieval_jobs ) #NEWLINE# if complete_job : #NEWLINE# #INDENT# self . _archive_retrieve_completed ( self . args , complete_job , name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if has_pending_job ( retrieval_jobs ) : #NEWLINE# #INDENT# if self . args . wait : #NEWLINE# #INDENT# complete_job = wait_until_job_completed ( retrieval_jobs ) #NEWLINE# self . _archive_retrieve_completed ( self . args , complete_job , name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise RetryConsoleError ( ( 'job still pending for archive %r' % name ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# job = vault . retrieve_archive ( archive_id ) #NEWLINE# if self . args . wait : #NEWLINE# #INDENT# wait_until_job_completed ( [ job ] ) #NEWLINE# self . _archive_retrieve_completed ( self . args , job , name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise RetryConsoleError ( ( 'queued retrieval job for archive %r' % name ) )