def copy_smart_previews(local_catalog, cloud_catalog, local2cloud=True):
    """Copy Smart Previews from local to cloud or
       vica versa when 'local2cloud==False'
       NB: nothing happens if source dir doesn't exist"""

    lcat_noext = local_catalog[0:local_catalog.rfind(".lrcat")]
    ccat_noext = cloud_catalog[0:cloud_catalog.rfind(".lrcat")]
    lsmart = join(dirname(local_catalog),"%s Smart Previews.lrdata"%basename(lcat_noext))
    csmart = join(dirname(cloud_catalog),"%s Smart Previews.lrdata"%basename(ccat_noext))
    if local2cloud and os.path.isdir(lsmart):
        logging.info("Copy Smart Previews - local to cloud: %s => %s"%(lsmart, csmart))
        distutils.dir_util.copy_tree(lsmart,csmart, update=1)
    elif os.path.isdir(csmart):
        logging.info("Copy Smart Previews - cloud to local: %s => %s"%(csmart, lsmart))
        distutils.dir_util.copy_tree(csmart,lsmart, update=1)
def copy_smart_previews(local_catalog, cloud_catalog, local2cloud=True):
    """Copy Smart Previews from local to cloud or
       vica versa when 'local2cloud==False'
       NB: nothing happens if source dir doesn't exist"""

    lcat_noext = local_catalog[0:local_catalog.rfind(".lrcat")]
    ccat_noext = cloud_catalog[0:cloud_catalog.rfind(".lrcat")]
    lsmart = join(dirname(local_catalog),"%s Smart Previews.lrdata"%basename(lcat_noext))
    csmart = join(dirname(cloud_catalog),"%s Smart Previews.lrdata"%basename(ccat_noext))
    if local2cloud and os.path.isdir(lsmart):
        logging.info("Copy Smart Previews - local to cloud: %s => %s"%(lsmart, csmart))
        distutils.dir_util.copy_tree(lsmart,csmart, update=1)
    elif os.path.isdir(csmart):
        logging.info("Copy Smart Previews - cloud to local: %s => %s"%(csmart, lsmart))
        distutils.dir_util.copy_tree(csmart,lsmart, update=1)
def copy_smart_previews ( local_catalog , cloud_catalog , local2cloud = True ) : lcat_noext = local_catalog [ 0 : local_catalog . rfind ( ".lrcat" ) ] ccat_noext = cloud_catalog [ 0 : cloud_catalog . rfind ( ".lrcat" ) ] lsmart = join ( dirname ( local_catalog ) , "%s Smart Previews.lrdata" % basename ( lcat_noext ) ) csmart = join ( dirname ( cloud_catalog ) , "%s Smart Previews.lrdata" % basename ( ccat_noext ) ) if local2cloud and os . path . isdir ( lsmart ) : logging . info ( "Copy Smart Previews - local to cloud: %s => %s" % ( lsmart , csmart ) ) distutils . dir_util . copy_tree ( lsmart , csmart , update = 1 ) elif os . path . isdir ( csmart ) : logging . info ( "Copy Smart Previews - cloud to local: %s => %s" % ( csmart , lsmart ) ) distutils . dir_util . copy_tree ( csmart , lsmart , update = 1 )
Copy Smart Previews from local to cloud or
       vica versa when 'local2cloud==False'
       NB: nothing happens if source dir doesn't exist
Copy Smart Previews from local to cloud or vica versa when local2cloud == False NB : nothing happens if source dir doesn t exist