提交 c6a7e0e6 编写于 作者: qq_25193841's avatar qq_25193841

Revert code display

上级 e57e6144
此差异已折叠。
......@@ -29,7 +29,7 @@ except ImportError:
def newIcon(icon, iconSize=None):
if iconSize is not None:
return QIcon(QIcon(':/' + icon).pixmap(iconSize, iconSize))
return QIcon(QIcon(':/' + icon).pixmap(iconSize,iconSize))
else:
return QIcon(':/' + icon)
......@@ -43,15 +43,8 @@ def newButton(text, icon=None, slot=None):
return b
def newAction(parent,
text,
slot=None,
shortcut=None,
icon=None,
tip=None,
checkable=False,
enabled=True,
iconSize=None):
def newAction(parent, text, slot=None, shortcut=None, icon=None,
tip=None, checkable=False, enabled=True, iconSize=None):
"""Create a new action and assign callbacks, shortcuts, etc."""
a = QAction(text, parent)
if icon is not None:
......@@ -90,6 +83,7 @@ def labelValidator():
class struct(object):
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
......@@ -111,25 +105,20 @@ def generateColorByText(text):
b = int((hashCode / 16581375) % 255)
return QColor(r, g, b, 100)
def have_qstring():
'''p3/qt5 get rid of QString wrapper as py3 has native unicode str type'''
return not (sys.version_info.major >= 3 or QT_VERSION_STR.startswith('5.'))
def util_qt_strlistclass():
return QStringList if have_qstring() else list
def natural_sort(list, key=lambda s: s):
def natural_sort(list, key=lambda s:s):
"""
Sort the list into natural alphanumeric order.
"""
def get_alphanum_key_func(key):
convert = lambda text: int(text) if text.isdigit() else text
return lambda s: [convert(c) for c in re.split('([0-9]+)', key(s))]
sort_key = get_alphanum_key_func(key)
list.sort(key=sort_key)
......@@ -161,7 +150,6 @@ def get_rotate_crop_image(img, points):
except Exception as e:
print(e)
def stepsInfo(lang='en'):
if lang == 'ch':
msg = "1. 安装与运行:使用上述命令安装与运行程序。\n" \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册