def cmd_init_push_to_cloud(args):
(lcat, ccat) = (args.local_catalog, args.cloud_catalog)<EOL>logging.info("<STR_LIT>"%(lcat, ccat))<EOL>if not isfile(lcat):<EOL><INDENT>args.error("<STR_LIT>"%lcat)<EOL><DEDENT>if isfile(ccat):<EOL><INDENT>args.error("<STR_LIT>"%ccat)<EOL><DEDENT>(lmeta, cmeta) = ("<STR_LIT>"%lcat, "<STR_LIT>"%ccat)<EOL>if isfile(lmeta):<EOL><INDENT>args.error("<STR_LIT>"%lmeta)<EOL><DEDENT>if isfile(cmeta):<EOL><INDENT>args.error("<STR_LIT>"%cmeta)<EOL><DEDENT>logging.info("<STR_LIT>"%(lcat))<EOL>if not lock_file(lcat):<EOL><INDENT>raise RuntimeError("<STR_LIT>"%lcat)<EOL><DEDENT>util.copy(lcat, ccat)<EOL>mfile = MetaFile(lmeta)<EOL>utcnow = datetime.utcnow().strftime(DATETIME_FORMAT)[:-<NUM_LIT:4>]<EOL>mfile['<STR_LIT>']['<STR_LIT>'] = hashsum(lcat)<EOL>mfile['<STR_LIT>']['<STR_LIT>'] = utcnow<EOL>mfile['<STR_LIT>']['<STR_LIT:filename>'] = lcat<EOL>mfile['<STR_LIT>']['<STR_LIT:filename>'] = ccat<EOL>mfile['<STR_LIT>']['<STR_LIT>'] = hashsum(lcat)<EOL>mfile['<STR_LIT>']['<STR_LIT>'] = utcnow<EOL>mfile.flush()<EOL>mfile = MetaFile(cmeta)<EOL>mfile['<STR_LIT>']['<STR_LIT>'] = True<EOL>mfile['<STR_LIT>']['<STR_LIT>'] = hashsum(lcat)<EOL>mfile['<STR_LIT>']['<STR_LIT>'] = utcnow<EOL>mfile['<STR_LIT>']['<STR_LIT:filename>'] = basename(ccat)<EOL>mfile.flush()<EOL>if not args.no_smart_previews:<EOL><INDENT>copy_smart_previews(lcat, ccat, local2cloud=True)<EOL><DEDENT>logging.info("<STR_LIT>"%(lcat))<EOL>unlock_file(lcat)<EOL>logging.info("<STR_LIT>")<EOL>
Initiate the local catalog and push it the cloud