Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(python3): replace xrange with range #249

Merged
merged 1 commit into from Aug 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion fofix/core/Data.py
Expand Up @@ -391,7 +391,7 @@ def getSoundObjectList(self, soundPath, soundPrefix, numSounds, soundExtension="
numSounds, soundExtension, soundPath))

sounds = []
for i in xrange(1, numSounds + 1):
for i in range(1, numSounds + 1):
filePath = os.path.join(soundPath, "%s%d%s" %
(soundPrefix, i, soundExtension))
soundObject = Sound(self.resource.fileName(filePath))
Expand Down
8 changes: 4 additions & 4 deletions fofix/core/Player.py
Expand Up @@ -71,10 +71,10 @@ def sortOptionsByKey(dict):
return a

# Redoing this, sir. Redoing this...
CONTROL1 = [1 << n for n in xrange(20)]
CONTROL2 = [1 << n for n in xrange(20, 40)]
CONTROL3 = [1 << n for n in xrange(40, 60)]
CONTROL4 = [1 << n for n in xrange(60, 80)]
CONTROL1 = [1 << n for n in range(20)]
CONTROL2 = [1 << n for n in range(20, 40)]
CONTROL3 = [1 << n for n in range(40, 60)]
CONTROL4 = [1 << n for n in range(60, 80)]
CONTROLS = [CONTROL1, CONTROL2, CONTROL3, CONTROL4]
LEFT = 0
RIGHT = 1
Expand Down
4 changes: 2 additions & 2 deletions fofix/core/Theme.py
Expand Up @@ -95,9 +95,9 @@ def hexToColor(color):
color = color[1:]

if len(color) < 4:
colorData = [color[i]+color[i] for i in xrange(0, len(color))]
colorData = [color[i]+color[i] for i in range(0, len(color))]
else:
colorData = [color[i:i+2] for i in xrange(0, len(color), 2)]
colorData = [color[i:i+2] for i in range(0, len(color), 2)]

rgbColor = tuple([int(i, 16) / 255.0 for i in colorData])

Expand Down
6 changes: 3 additions & 3 deletions fofix/game/guitarscene/GuitarScene.py
Expand Up @@ -4505,7 +4505,7 @@ def render(self, visibility, topMost):
if self.coOpType and self.partImage:
freeX = .05 * (self.numOfPlayers - 1)
freeI = .05 * self.numOfPlayers
for j in xrange(self.numOfPlayers):
for j in range(self.numOfPlayers):
drawImage(self.part[j], scale=(.15, -.15), coord=(self.wFull*(.5-freeX+freeI*j), self.hFull*.58), color=(.8, .8, .8, 1))

text = "%s" % scoreCard.endingScore
Expand Down Expand Up @@ -4566,7 +4566,7 @@ def render(self, visibility, topMost):
if self.coOpType and self.partImage:
freeX = .05 * (self.numOfPlayers - 1)
freeI = .05 * self.numOfPlayers
for j in xrange(self.numOfPlayers):
for j in range(self.numOfPlayers):
drawImage(self.part[j], scale=(.15, -.15), coord=(self.wFull*(.5-freeX+freeI*j), self.hFull*.58))

text = "%s" % scoreCard.endingScore
Expand Down Expand Up @@ -4626,7 +4626,7 @@ def render(self, visibility, topMost):
if self.coOpType and self.partImage:
freeX = .05 * (self.numOfPlayers - 1)
freeI = .05 * self.numOfPlayers
for j in xrange(self.numOfPlayers):
for j in range(self.numOfPlayers):
if self.scoring[j].endingStreakBroken:
partcolor = (.4, .4, .4, 1)
else:
Expand Down