Example #1
0
	def _use_rextfv_archive(self, filename, keepOldFiles=False):
		with self.lock:
			self._nlxtp_make_writeable()
			try:
				UserError.check(os.path.exists(filename), UserError.NO_DATA_AVAILABLE, "No file has been uploaded")
				if self.rextfv_max_size is not None:
					UserError.check(os.path.getsize(filename) < self.rextfv_max_size, UserError.INVALID_VALUE,
						"Uploaded file is too large")
				if not keepOldFiles:
					self._clear_nlxtp_contents__already_mounted()
				if not os.path.exists(self._nlxtp_path("")):
					os.makedirs(self._nlxtp_path(""))
				path.extractArchive(filename, self._nlxtp_path(""), ["--no-same-owner"])
			finally:
				self._nlxtp_close()
Example #2
0
	def _use_rextfv_archive(self, filename, keepOldFiles=False):
		with self.lock:
			self._nlxtp_make_writeable()
			try:
				UserError.check(os.path.exists(filename), UserError.NO_DATA_AVAILABLE, "No file has been uploaded")
				if self.rextfv_max_size is not None:
					UserError.check(os.path.getsize(filename) < self.rextfv_max_size, UserError.INVALID_VALUE,
						"Uploaded file is too large")
				if not keepOldFiles:
					self._clear_nlxtp_contents__already_mounted()
				if not os.path.exists(self._nlxtp_path("")):
					os.makedirs(self._nlxtp_path(""))
				path.extractArchive(filename, self._nlxtp_path(""), ["--no-same-owner"])
			finally:
				self._nlxtp_close()
Example #3
0
 def _useImage(self, path_):
     assert self.state != ST_CREATED
     imgPath = self._imagePath()
     path.remove(imgPath, recursive=True)
     path.createDir(imgPath)
     path.extractArchive(path_, imgPath)
Example #4
0
	def _useImage(self, path_):
		assert self.state != ST_CREATED
		imgPath = self._imagePath()
		path.remove(imgPath, recursive=True)
		path.createDir(imgPath)
		path.extractArchive(path_, imgPath)