def generate_securecc_object_entry(args): obj, phony_obj = args if not os.path.exists(obj): shutil.copy(phony_obj, obj) else: digest = blade_util.md5sum_file(obj) phony_digest = blade_util.md5sum_file(phony_obj) if digest != phony_digest: shutil.copy(phony_obj, obj)
def archive_package_sources(package, sources, destinations): """Content of the `MANIFEST.TXT` file in the target zip file""" manifest = [] for i, s in enumerate(sources): package(s, destinations[i]) manifest.append('%s %s' % (blade_util.md5sum_file(s), destinations[i])) return manifest
def generate_python_library(pylib, basedir, args): sources = [] for py in args: digest = blade_util.md5sum_file(py) sources.append((py, digest)) with open(pylib, 'w') as f: print(str({'base_dir': basedir, 'srcs': sources}), file=f)
def generate_python_library_entry(args): basedir, pylib = args[0], args[1] if basedir == '__pythonbasedir__': basedir = '' sources = [] for py in args[2:]: digest = blade_util.md5sum_file(py) sources.append((py, digest)) with open(pylib, 'w') as f: f.write(str({'base_dir': basedir, 'srcs': sources}))
def revision(self): """Blade revision to identify changes""" if self.__blade_revision is None: if os.path.isfile(self.__blade_path): # blade.zip self.__blade_revision = md5sum_file(self.__blade_path) else: # In develop mode, take the mtime of the `blade` directory self.__blade_revision = str(os.path.getmtime( os.path.join(self.__blade_path, 'blade'))) return self.__blade_revision
def archive_package_sources(package, sources, destinations): manifest = [] for i, s in enumerate(sources): package(s, destinations[i]) manifest.append('%s %s' % (blade_util.md5sum_file(s), destinations[i])) return manifest