Skip to content

Commit 381ccdb

Browse files
committed
Convert to python3
- String encoding - print function
1 parent 69cd3ed commit 381ccdb

File tree

3 files changed

+208
-200
lines changed

3 files changed

+208
-200
lines changed

src/com/dtmilano/android/culebron.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def toCommandName(operation):
149149
class Culebron:
150150
APPLICATION_NAME = "Culebra"
151151

152-
UPPERCASE_CHARS = string.uppercase[:26]
152+
UPPERCASE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
153153

154154
KEYSYM_TO_KEYCODE_MAP = {
155155
'Home': 'HOME',

src/com/dtmilano/android/viewclient.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,9 @@ def writeImageToFile(self, filename, _format="PNG"):
11081108
image.crop(box).save(filename, _format)
11091109

11101110
def __smallStr__(self):
1111-
__str = str("View[", 'utf-8', 'replace')
1111+
#2to3
1112+
#__str = str("View[", 'utf-8', 'replace')
1113+
__str = "View["
11121114
if "class" in self.map:
11131115
__str += " class=" + self.map['class']
11141116
__str += " id=%s" % self.getId()
@@ -1121,7 +1123,9 @@ def __smallStr__(self):
11211123
return __str
11221124

11231125
def __tinyStr__(self):
1124-
__str = str("View[", 'utf-8', 'replace')
1126+
#2to3
1127+
#__str = str("View[", 'utf-8', 'replace')
1128+
__str = "View["
11251129
if "class" in self.map:
11261130
__str += " class=" + re.sub('.*\.', '', self.map['class'])
11271131
__str += " id=%s" % self.getId()
@@ -1130,7 +1134,9 @@ def __tinyStr__(self):
11301134
return __str
11311135

11321136
def __microStr__(self):
1133-
__str = str('', 'utf-8', 'replace')
1137+
#2to3
1138+
#__str = str('', 'utf-8', 'replace')
1139+
__str = ''
11341140
if "class" in self.map:
11351141
__str += re.sub('.*\.', '', self.map['class'])
11361142
_id = self.getId().replace('id/no_id/', '-')
@@ -1142,7 +1148,9 @@ def __microStr__(self):
11421148
return __str
11431149

11441150
def __str__(self):
1145-
__str = "View[" + 'utf-8' + 'replace'
1151+
#2to3
1152+
#__str = "View[" + 'utf-8' + 'replace'
1153+
__str = "View["
11461154

11471155
if "class" in self.map:
11481156
__str += " class=" + self.map["class"].__str__() + " "

0 commit comments

Comments
 (0)