Skip to content

Commit

Permalink
Bugfix about unicode label.
Browse files Browse the repository at this point in the history
  • Loading branch information
NateScarlet committed Mar 7, 2018
1 parent 5c9bd64 commit 7540252
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pyblish_lite/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from . import settings
from .awesome import tags as awesome
from .vendor.Qt import QtCore, __binding__
from .vendor.six import text_type

# GENERAL

Expand Down Expand Up @@ -467,7 +468,7 @@ def setData(self, index, value, role):
def update_with_result(self, result):
for record in result["records"]:
self.append({
"label": str(record.msg),
"label": text_type(record.msg),
"type": "record",

# Native
Expand All @@ -485,7 +486,7 @@ def update_with_result(self, result):
if error is not None:
fname, line_no, func, exc = error.traceback
self.append({
"label": str(error),
"label": text_type(error),
"type": "error",
"fname": fname,
"line_number": line_no,
Expand Down Expand Up @@ -642,7 +643,8 @@ def filterAcceptsRow(self, source_row, source_parent):

# --- Check if any family assigned to the plugin is in allowed families
for role, values in self.includes.items():
includes_list = [([x] if isinstance(x, (list, tuple)) else x) for x in getattr(item, role, None)]
includes_list = [([x] if isinstance(x, (list, tuple)) else x)
for x in getattr(item, role, None)]
return any(include in values for include in includes_list)

for role, values in self.excludes.items():
Expand Down
2 changes: 2 additions & 0 deletions tests/test_model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding=UTF-8 -*-
import logging

from pyblish_lite import model
Expand All @@ -16,6 +17,7 @@ def test_label_nonstring():
{"a": "dict"},
list(),
1.0,
u'测试',
)
],
"error": None
Expand Down

0 comments on commit 7540252

Please sign in to comment.