1 Star 0 Fork 14

src-oepkgs-oE-rv/hplip

forked from src-openEuler/hplip 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
hplip-error-print.patch 3.53 KB
一键复制 编辑 原始数据 按行查看 历史
jackie_wu123 提交于 2020-02-17 18:58 . package init
commit 4c913b68d8f8a79e11e247a8f7086f779f2685d4
Author: Tomas Korbar <tkorbar@redhat.com>
Date: Tue Sep 18 16:17:06 2018 +0200
Fix TypeError
- 1564770 - TypeError: 'Error' object does not support indexing
diff --git a/clean.py b/clean.py
index 3d41f04..3a7248e 100755
--- a/clean.py
+++ b/clean.py
@@ -182,7 +182,7 @@ try:
log.error("Cleaning not needed or supported on this device.")
except Error as e:
- log.error("An error occured: %s" % e[0])
+ log.error("An error occured: %s" % e.msg)
else:
log.error("Device is busy or in an error state. Please check device and try again.")
diff --git a/ui/scrollunload.py b/ui/scrollunload.py
index fdb48e8..345ed82 100644
--- a/ui/scrollunload.py
+++ b/ui/scrollunload.py
@@ -120,7 +120,7 @@ class ScrollUnloadView(ScrollView):
self.pc = photocard.PhotoCard(None, self.cur_device.device_uri, self.cur_printer)
except Error as e:
QApplication.restoreOverrideCursor()
- self.form.FailureUI(self.__tr("An error occured: %s" % e[0]))
+ self.form.FailureUI(self.__tr("An error occured: %s" % e.msg))
self.cleanup(EVENT_PCARD_UNABLE_TO_MOUNT)
return False
diff --git a/ui4/wifisetupdialog.py b/ui4/wifisetupdialog.py
index 9fd1786..4d36f83 100644
--- a/ui4/wifisetupdialog.py
+++ b/ui4/wifisetupdialog.py
@@ -256,7 +256,7 @@ class WifiSetupDialog(QDialog, Ui_Dialog):
try:
self.dev = device.Device(self.device_uri)
except Error as e:
- FailureUI(self, self.__tr("<b>Error opening device:</b><p>%s</p><p>(%s)</p>") %(self.device_uri, QString(e[0])))
+ FailureUI(self, self.__tr("<b>Error opening device:</b><p>%s</p><p>(%s)</p>") %(self.device_uri, QString(e.msg)))
if self.dev is not None:
self.dev.close()
@@ -834,7 +834,7 @@ class WifiSetupDialog(QDialog, Ui_Dialog):
def showIOError(self, e):
- FailureUI(self, self.__tr("<b>An I/O error occurred.</b><p>Please check the USB connection to your printer and try again.</p>(%s)" % QString(e[0])))
+ FailureUI(self, self.__tr("<b>An I/O error occurred.</b><p>Please check the USB connection to your printer and try again.</p>(%s)" % QString(e.msg)))
if self.dev is not None:
self.dev.close()
diff --git a/ui5/wifisetupdialog.py b/ui5/wifisetupdialog.py
index e0c7aee..74cc0ef 100644
--- a/ui5/wifisetupdialog.py
+++ b/ui5/wifisetupdialog.py
@@ -259,7 +259,7 @@ class WifiSetupDialog(QDialog, Ui_Dialog):
try:
self.dev = device.Device(self.device_uri)
except Error as e:
- FailureUI(self, self.__tr("<b>Error opening device:</b><p>%s</p><p>(%s)</p>") %(self.device_uri, str(e[0])))
+ FailureUI(self, self.__tr("<b>Error opening device:</b><p>%s</p><p>(%s)</p>") %(self.device_uri, str(e.msg)))
if self.dev is not None:
self.dev.close()
@@ -840,7 +840,7 @@ class WifiSetupDialog(QDialog, Ui_Dialog):
def showIOError(self, e):
- FailureUI(self, self.__tr("<b>An I/O error occurred.</b><p>Please check the USB connection to your printer and try again.</p>(%s)" % str(e[0])))
+ FailureUI(self, self.__tr("<b>An I/O error occurred.</b><p>Please check the USB connection to your printer and try again.</p>(%s)" % str(e.msg)))
if self.dev is not None:
self.dev.close()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-oepkgs-oe-rv/hplip.git
git@gitee.com:src-oepkgs-oe-rv/hplip.git
src-oepkgs-oe-rv
hplip
hplip
master

搜索帮助