Beispiel #1
0
	def _trash_page(self, path):
		from zim.newfs.helpers import TrashHelper

		logger.debug('Trash page: %s', path)

		if self.config['Notebook']['disable_trash']:
			raise TrashNotSupportedError('disable_trash is set')

		self.emit('delete-page', path)

		file, folder = self.layout.map_page(path)
		helper = TrashHelper()

		re = False
		if folder.exists():
			re = helper.trash(folder)
			if isinstance(path, Page):
				path.haschildren = False

		if file.exists():
			re = helper.trash(file) or re

		self.index.update_file(file)
		self.index.update_file(folder)

		return re
 def mock_trash_iter(*a, **k):
     yield
     raise TrashNotSupportedError('Test')