Пример #1
0
    def startPrint(self):
        if not super(PrinterS3g, self).startPrint():
            return

        if not self.isOperational() or self.isPrinting():
            return

        if self._currentFile is None:
            raise ValueError("No file selected for printing")

        if self._printJob and self._printJob.isAlive():
            raise Exception("A Print Job is still running")

        self._changeState(self.STATE_PRINTING)

        data = printerManager().getFileInfo(self._currentFile['filename'])
        eventManager().fire(Events.PRINT_STARTED, data)

        self._printJob = PrintJobS3G(self, self._currentFile)
        self._printJob.start()
Пример #2
0
	def startPrint(self):
		if not super(PrinterS3g, self).startPrint():
			return

		if not self.isOperational() or self.isPrinting():
			return

		if self._currentFile is None:
			raise ValueError("No file selected for printing")

		if self._printJob and self._printJob.isAlive():
			raise Exception("A Print Job is still running")

		self._changeState(self.STATE_PRINTING)
		eventManager().fire(Events.PRINT_STARTED, {
			"file": self._currentFile['filename'],
			"filename": os.path.basename(self._currentFile['filename']),
			"origin": self._currentFile['origin']
		})

		self._printJob = PrintJobS3G(self, self._currentFile)
		self._printJob.start()