1 Star 0 Fork 14

mds.lanruo/hplip

forked from src-openEuler/hplip 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
hplip-use-binary-str.patch 1.59 KB
一键复制 编辑 原始数据 按行查看 历史
jackie_wu123 提交于 2020-02-17 18:58 . package init
diff -up hplip-3.18.5/base/utils.py.use-binary-str hplip-3.18.5/base/utils.py
--- hplip-3.18.5/base/utils.py.use-binary-str 2018-05-28 13:52:32.698082273 +0200
+++ hplip-3.18.5/base/utils.py 2018-05-28 13:53:20.563707314 +0200
@@ -961,10 +961,7 @@ else:
def printable(s):
- if s:
- return s.translate(identity, unprintable)
- else:
- return ""
+ return s.translate(identity, unprintable)
def any(S,f=lambda x:x):
diff -up hplip-3.18.5/fax/pmlfax.py.use-binary-str hplip-3.18.5/fax/pmlfax.py
--- hplip-3.18.5/fax/pmlfax.py.use-binary-str 2018-05-24 06:34:40.000000000 +0200
+++ hplip-3.18.5/fax/pmlfax.py 2018-05-28 13:52:05.752293151 +0200
@@ -143,8 +143,8 @@ class PMLFaxDevice(FaxDevice):
def getPhoneNum(self):
if PY3:
- data = utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1])
- return data
+ data = utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1].encode('utf-8'))
+ return data.decode('utf-8')
else:
return utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1])
phone_num = property(getPhoneNum, setPhoneNum, doc="OID_FAX_LOCAL_PHONE_NUM")
@@ -155,8 +155,8 @@ class PMLFaxDevice(FaxDevice):
def getStationName(self):
if PY3:
- data = utils.printable(self.getPML(pml.OID_FAX_STATION_NAME)[1])
- return data
+ data = utils.printable(self.getPML(pml.OID_FAX_STATION_NAME)[1].encode('utf-8'))
+ return data.decode('utf-8')
else:
return utils.printable(self.getPML(pml.OID_FAX_STATION_NAME)[1])
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mdslanruo/hplip.git
git@gitee.com:mdslanruo/hplip.git
mdslanruo
hplip
hplip
master

搜索帮助