Skip to content

Commit

Permalink
Support Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
SerVB committed May 5, 2019
1 parent d3be377 commit 92b02f8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/scripts/client/gui/mods/mod_recent_stat_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def loadPlayerDataByVehicleList(self, vehicles):
try:
vehicleInfoTasks = set()

for _vehicleID, vehicleData in vehicles.iteritems():
for _vehicleID, vehicleData in vehicles.items():
if "name" in vehicleData and "accountDBID" in vehicleData:
playerName = vehicleData["name"]
playerId = vehicleData["accountDBID"]
Expand Down Expand Up @@ -95,7 +95,7 @@ def loadPlayerDataByVehicleList(self, vehicles):
withRecentStat = 0
withoutStat = 0

for _vehicleID, vehicleData in vehicles.iteritems():
for _vehicleID, vehicleData in vehicles.items():
if "accountDBID" in vehicleData:
playerId = vehicleData["accountDBID"]

Expand Down
16 changes: 8 additions & 8 deletions src/scripts/client/gui/mods/mod_recent_stat_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

def logInfo(message):
# type: (str) -> None
print "[--- The Recent Stat of You vvv]"
print message
print "[--- The Recent Stat of You ^^^]"
print("[--- The Recent Stat of You vvv]")
print(message)
print("[--- The Recent Stat of You ^^^]")


def logError(message, exceptionText):
# type: (str, str) -> None
print "[!--- The Recent Stat of You vvv]"
print message
print "[!--- Exception text:]"
print exceptionText
print "[!--- The Recent Stat of You ^^^]"
print("[!--- The Recent Stat of You vvv]")
print(message)
print("[!--- Exception text:]")
print(exceptionText)
print("[!--- The Recent Stat of You ^^^]")
8 changes: 6 additions & 2 deletions src/scripts/client/gui/mods/mod_recent_stat_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
# https://www.apache.org/licenses/LICENSE-2.0.html

import random
from urllib2 import urlopen, Request
import sys
if "urllib.request" in sys.modules:
from urllib.request import urlopen, Request
else:
from urllib2 import urlopen, Request

from mod_recent_stat_string import removeTags

Expand All @@ -26,7 +30,7 @@ def generateHeaders():
def getRawSiteText(url, timeout=_DEFAULT_TIMEOUT):
# type: (str, int) -> str
req = Request(url, headers=generateHeaders())
html = urlopen(req, timeout=timeout).read()
html = urlopen(req, timeout=timeout).read().decode("utf-8")
return html


Expand Down
2 changes: 1 addition & 1 deletion src/scripts/client/gui/mods/mod_recent_stat_wg_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def loadPlayerDataByVehicleList(self, vehicles, playerIdToData):
# type: (dict, dict) -> None
idsToBeLoaded = set()

for _vehicleID, vehicleData in vehicles.iteritems():
for _vehicleID, vehicleData in vehicles.items():
if "accountDBID" in vehicleData:
playerId = vehicleData["accountDBID"]

Expand Down

0 comments on commit 92b02f8

Please sign in to comment.