def post(self, configuration=None): config_file = settings.rel_path(configuration) storage_path = ext_storage_path(settings.config_dir, configuration) trash_path = trash_storage_path(settings.config_dir) mkdir_p(trash_path) shutil.move(config_file, os.path.join(trash_path, configuration)) storage_json = StorageJSON.load(storage_path) if storage_json is not None: # Delete build folder (if exists) name = storage_json.name build_folder = os.path.join(settings.config_dir, name) if build_folder is not None: shutil.rmtree(build_folder, os.path.join(trash_path, name))
def post(self, configuration=None): config_file = os.path.join(CONFIG_DIR, configuration) storage_path = ext_storage_path(CONFIG_DIR, configuration) storage_json = StorageJSON.load(storage_path) if storage_json is None: self.set_status(500) return name = storage_json.name trash_path = trash_storage_path(CONFIG_DIR) mkdir_p(trash_path) shutil.move(config_file, os.path.join(trash_path, configuration)) # Delete build folder (if exists) build_folder = os.path.join(CONFIG_DIR, name) if build_folder is not None: shutil.rmtree(build_folder, os.path.join(trash_path, name))
def post(self, configuration=None): config_file = os.path.join(CONFIG_DIR, configuration) trash_path = trash_storage_path(CONFIG_DIR) shutil.move(os.path.join(trash_path, configuration), config_file)
def post(self, configuration=None): config_file = settings.rel_path(configuration) trash_path = trash_storage_path(settings.config_dir) shutil.move(os.path.join(trash_path, configuration), config_file)