
    d
                     \    d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlm	Z	 dZ
d	 Zd
 Zy)z!Utils for transfer list commands.    )absolute_import)division)unicode_literalsN)arg_parsers)log   c                     | j                  dt        j                  dt        j                  d      d       | j                  dt        j                  dt        j                  d      t
        d	       y
)z@Inheriting from ListCommand adds flags transfer needs to modify.z--limit   T)	unlimitedz5Return the first items from the API up to this limit.)typehelpz--page-sizez1Retrieve batches of this many items from the API.)r   defaultr   N)add_argumentr   
BoundedIntsysmaxsize_TRANSFER_LIST_PAGE_SIZE)parsers    4lib/googlecloudsdk/command_lib/transfer/list_util.pyadd_common_list_flagsr      sg    !!!S[[DAB  D 	!!!S[[DA&>	  @    c                    g }| D ]O  }|j                  |       t        |      t        k\  s't        j                  j                           |||       g }Q |r't        j                  j                           |||       d|_        y)a  Gcloud's built-in display logic has issues with enormous lists.

  Args:
    resource_iterator (iterable): Likely an instance of Apitools
      list_pager.YieldFromList but can also be a List.
    command_display_function (func): The self.Display function built into
      classes inheriting from base.Command.
    command_args (argparse.Namespace): The args object passed to self.Display
      and self.Run of commands inheriting from base.Command.
  N)appendlenr   r   statusPrintformat)resource_iteratorcommand_display_functioncommand_argsresource_listresources        r   !print_transfer_resources_iteratorr#   +   sw    , -#h"
=55	jj|];m $ JJ\=9 ,r   )__doc__
__future__r   r   r   r   googlecloudsdk.callioper   googlecloudsdk.corer   r   r   r#    r   r   <module>r)      s/    ( &  ' 
 / #  
@#r   