Submit
Path:
~
/
/
usr
/
lib
/
python2.7
/
site-packages
/
awscli
/
customizations
/
s3
/
syncstrategy
/
File Content:
base.pyc
� =��Xc @ s� d d l Z e j e � Z d d d g Z d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d S( i����Nt file_at_src_and_destt file_not_at_destt file_not_at_srct BaseSyncc B s� e Z d Z d Z d d � Z d � Z e d � � Z d � Z d � Z e d � � Z e d � � Z d � Z d � Z d � Z d � Z d � Z RS( sU Base sync strategy To create a new sync strategy, subclass from this class. R c C s | j | � | | _ d S( s+ :type sync_type: string :param sync_type: This determines where the sync strategy will be used. There are three strings to choose from: 'file_at_src_and_dest': apply sync strategy on a file that exists both at the source and the destination. 'file_not_at_dest': apply sync strategy on a file that exists at the source but not the destination. 'file_not_at_src': apply sync strategy on a file that exists at the destination but not the source. N( t _check_sync_typet _sync_type( t selft sync_type( ( sJ /tmp/pip-build-uEGWVr/awscli/awscli/customizations/s3/syncstrategy/base.pyt __init__0 s c C s) | t k r% t d | t f � � n d S( Ns, Unknown sync_type: %s. Valid options are %s.( t VALID_SYNC_TYPESt ValueError( R R ( ( sJ /tmp/pip-build-uEGWVr/awscli/awscli/customizations/s3/syncstrategy/base.pyR B s c C s | j S( N( R ( R ( ( sJ /tmp/pip-build-uEGWVr/awscli/awscli/customizations/s3/syncstrategy/base.pyR H s c C s* | j d | j � | j d | j � d S( s7 Registers the sync strategy class to the given session.s building-arg-table.syncs choosing-s3-sync-strategyN( t registert add_sync_argumentt use_sync_strategy( R t session( ( sJ /tmp/pip-build-uEGWVr/awscli/awscli/customizations/s3/syncstrategy/base.pyt register_strategyL s c C s t d � � d S( s Subclasses should implement this method. This function takes two ``FileStat`` objects (one from the source and one from the destination). Then makes a decision on whether a given operation (e.g. a upload, copy, download) should be allowed to take place. The function currently raises a ``NotImplementedError``. So this method must be overwritten when this class is subclassed. Note that this method must return a Boolean as documented below. :type src_file: ``FileStat`` object :param src_file: A representation of the opertaion that is to be performed on a specfic file existing in the source. Note if the file does not exist at the source, ``src_file`` is None. :type dest_file: ``FileStat`` object :param dest_file: A representation of the operation that is to be performed on a specific file existing in the destination. Note if the file does not exist at the destination, ``dest_file`` is None. :rtype: Boolean :return: True if an operation based on the ``FileStat`` should be allowed to occur. False if if an operation based on the ``FileStat`` should not be allowed to occur. Note the operation being referred to depends on the ``sync_type`` of the sync strategy: 'file_at_src_and_dest': refers to ``src_file`` 'file_not_at_dest': refers to ``src_file`` 'file_not_at_src': refers to ``dest_file`` t determine_should_syncN( t NotImplementedError( R t src_filet dest_file( ( sJ /tmp/pip-build-uEGWVr/awscli/awscli/customizations/s3/syncstrategy/base.pyR S s $c C s1 d } | j d k r- | j j d d � } n | S( Nt name( t Nonet ARGUMENTt get( R R ( ( sJ /tmp/pip-build-uEGWVr/awscli/awscli/customizations/s3/syncstrategy/base.pyt arg_namey s c C s1 d } | j d k r- | j j d d � } n | S( Nt dest( R R R ( R R ( ( sJ /tmp/pip-build-uEGWVr/awscli/awscli/customizations/s3/syncstrategy/base.pyt arg_dest� s c K s&