def process(source, scene_root, verbose=False, clean=False, list_file=None, overwrite=False): if pusher.check_existance(scene_root): print 'Scene %s already exists on destination bucket.' % scene_root if not overwrite: return collect_missing_entry(scene_root, verbose, clean, list_file) if verbose: print 'Processing scene: %s' % scene_root scene_dict = {} local_tarfile = puller.pull(source, scene_root, scene_dict, verbose=verbose) local_dir = splitter.split(scene_root, local_tarfile, verbose=verbose) scene_info.add_mtl_info(scene_dict, scene_root, local_dir) thumbnailer.thumbnail(scene_root, local_dir, verbose=verbose) scene_index_maker.make_index(scene_root, local_dir, verbose=verbose) pusher.push(scene_root, local_dir, scene_dict, verbose=verbose, overwrite=overwrite) if clean: os.unlink(local_tarfile) shutil.rmtree(local_dir) if list_file: scene_info.append_scene_line(list_file, scene_dict) return scene_dict
def fix_index(scene_root, scene_dir, verbose=False): index_filename = scene_dir + '/index.html' old_index = open(index_filename).read() scene_index_maker.make_index(scene_root, scene_dir, verbose=verbose) new_index = open(index_filename).read() return new_index != old_index
def process(source, scene_root, verbose=False, clean=False, list_file=None, overwrite=False): if pusher.check_existance(scene_root): print 'Scene %s already exists on destination bucket.' % scene_root if not overwrite: return collect_missing_entry(scene_root, verbose, clean, list_file) if verbose: print 'Processing scene: %s' % scene_root scene_dict = {} local_tarfile = puller.pull(source, scene_root, scene_dict, verbose=verbose) try: local_dir = splitter.split(scene_root, local_tarfile, verbose=verbose) except: if source == 's3queue': # Remove problematic scenes from the queue directory puller_s3queue.clean_queued_tarfile(scene_root) return scene_info.add_mtl_info(scene_dict, scene_root, local_dir) thumbnailer.thumbnail(scene_root, local_dir, verbose=verbose) scene_index_maker.make_index(scene_root, local_dir, verbose=verbose) pusher.push(scene_root, local_dir, scene_dict, verbose=verbose, overwrite=overwrite) if clean: os.unlink(local_tarfile) shutil.rmtree(local_dir) if list_file: scene_info.append_scene_line(list_file, scene_dict) return scene_dict