def do_src_archive(dirname, targetdir): if dirname == targetdir: return files = get_files(dirname) for f in files: relfile = f.replace(dirname+"/", '') if os.path.dirname(relfile): alfred._create(os.path.join(targetdir, os.path.dirname(relfile))) shutil.copy(f, os.path.join(targetdir, os.path.dirname(relfile)))
def do_src_archive(dirname, targetdir): if dirname == targetdir: return files = get_files(dirname) for f in files: relfile = f.replace(dirname + "/", '') if os.path.dirname(relfile): alfred._create(os.path.join(targetdir, os.path.dirname(relfile))) shutil.copy(f, os.path.join(targetdir, os.path.dirname(relfile)))
def read_json_var(export_info): try: workflow_export_dir = os.path.abspath(os.path.expanduser(export_info['workflow-export']['directory'])) alfred._create(workflow_export_dir) will_workflow_export = export_info['workflow-export']['enable'] source_export_dir = os.path.abspath(os.path.expanduser(export_info['source-export']['directory'])) alfred._create(source_export_dir) will_source_export = export_info['source-export']['enable'] except KeyError: print "Invalid export.json file" sys.exit(1) except IOError: print "Io error" sys.exit(1) return (workflow_export_dir, will_workflow_export, source_export_dir, will_source_export)
def read_json_var(export_info): try: workflow_export_dir = os.path.abspath( os.path.expanduser(export_info['workflow-export']['directory'])) alfred._create(workflow_export_dir) will_workflow_export = export_info['workflow-export']['enable'] source_export_dir = os.path.abspath( os.path.expanduser(export_info['source-export']['directory'])) alfred._create(source_export_dir) will_source_export = export_info['source-export']['enable'] except KeyError: print "Invalid export.json file" sys.exit(1) except IOError: print "Io error" sys.exit(1) return (workflow_export_dir, will_workflow_export, source_export_dir, will_source_export)