@celery_app.task(base=ArchiverTask, ignore_result=False)
@logged('stat_addon')
def stat_addon(addon_short_name, job_pk):
 addon_name = addon_short_name
 version = None
 if ('dataverse' in addon_short_name):
  addon_name = 'dataverse'
  version = ('latest' if (addon_short_name.split('-')[(-1)] == 'draft') else 'latest-published')
 create_app_context()
 job = ArchiveJob.load(job_pk)
 (src, dst, user) = job.info()
 src_addon = src.get_addon(addon_name)
 try:
  file_tree = src_addon._get_file_tree(user=user, version=version)
 except HTTPError as e:
  dst.archive_job.update_target(addon_short_name, ARCHIVER_NETWORK_ERROR, errors=[e.data['error']])
  raise
 result = AggregateStatResult(src_addon._id, addon_short_name, targets=[utils.aggregate_file_tree_metadata(addon_short_name, file_tree, user)])
 return result

@ celery_app . task ( base = ArchiverTask , ignore_result = False ) @ logged ( 'stat_addon' ) def stat_addon ( addon_short_name , job_pk ) : addon_name = addon_short_name version = None if ( 'dataverse' in addon_short_name ) : addon_name = 'dataverse' version = ( 'latest' if ( addon_short_name . split ( '-' ) [ ( - 1 ) ] == 'draft' ) else 'latest-published' ) create_app_context ( ) job = ArchiveJob . load ( job_pk ) ( src , dst , user ) = job . info ( ) src_addon = src . get_addon ( addon_name ) try : file_tree = src_addon . _get_file_tree ( user = user , version = version ) except HTTPError as e : dst . archive_job . update_target ( addon_short_name , ARCHIVER_NETWORK_ERROR , errors = [ e . data [ 'error' ] ] ) raise result = AggregateStatResult ( src_addon . _id , addon_short_name , targets = [ utils . aggregate_file_tree_metadata ( addon_short_name , file_tree , user ) ] ) return result
collect metadata about the file tree of a given addon .