forked from qt-creator/qt-creator
Squish: Introduce helper function for checking for strings
In Python3 type unicode is unavailable since it's implicit with "str". The new functions helps porting code. Change-Id: I5de0fa182acbbaf267ed51f66f658cb9c884f4c5 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -37,7 +37,7 @@ def placeCursorToLine(editor, line, isRegex=False):
|
||||
return waitForObject(editor)
|
||||
|
||||
isDarwin = platform.system() == 'Darwin'
|
||||
if not isinstance(editor, (str, unicode)):
|
||||
if not isString(editor):
|
||||
editor = objectMap.realName(editor)
|
||||
oldPosition = 0
|
||||
jumpToFirstLine(getEditor())
|
||||
@@ -120,7 +120,7 @@ def replaceEditorContent(editor, newcontent):
|
||||
type(editor, newcontent)
|
||||
|
||||
def typeLines(editor, lines):
|
||||
if isinstance(lines, (str, unicode)):
|
||||
if isString(lines):
|
||||
lines = [lines]
|
||||
if isinstance(lines, (list, tuple)):
|
||||
for line in lines:
|
||||
|
||||
Reference in New Issue
Block a user