Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 72906 Details for
Bug 110062
pyRacerz 0.2 is a new car racing game
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to save replays in home directory
replays.patch (text/plain), 2.73 KB, created by
Solveig Haag
on 2005-11-14 14:36:12 UTC
(
hide
)
Description:
patch to save replays in home directory
Filename:
MIME Type:
Creator:
Solveig Haag
Created:
2005-11-14 14:36:12 UTC
Size:
2.73 KB
patch
obsolete
>--- modules/game.py 2005-10-16 17:14:51.000000000 +0200 >+++ modules/game.py 2005-11-14 23:00:21.000000000 +0100 >@@ -35,16 +35,24 @@ > > class Game: > '''Class representing a game: Tournament or Single Race''' >+ pathtoreplays = None >+ pathtosavedir = None > > def __init__(self, gameType, listTrackName=None, listPlayer=None, maxLapNb=-1): > '''Constructor''' >+ global pathtoreplays >+ global pathtosavedir > > self.gameType = gameType > self.listTrackName = listTrackName > self.listPlayer = listPlayer > self.maxLapNb = maxLapNb >+ pathtoreplays = os.environ.get('HOME') + "/.pyRacerz/replays" >+ pathtosavedir = os.environ.get('HOME') + "/.pyRacerz" > > def play(self): >+ global pathtoreplays >+ global pathtosavedir > > if self.gameType == None or self.listTrackName == None or self.listPlayer == None or self.maxLapNb == -1: > print "Incomplete game" >@@ -524,7 +532,12 @@ > waitMenu = menu.SimpleTitleOnlyMenu(misc.titleFont, "recording Replay...") > > if select2 != None and select2 != "": >- f = file(os.path.join("replays", select2 + ".rep"), "wb") >+ if not os.path.exists(pathtoreplays): >+ if not os.path.exists(pathtosavedir): >+ os.mkdir(pathtosavedir) >+ os.mkdir(pathtoreplays) >+ >+ f = file(os.path.join(pathtoreplays, select2 + ".rep"), "wb") > > # TrackName Inv NbEnreg NbCar PlayerName1 PlayerCarColor1 PlayerCarLevel1... > f.write(str(misc.VERSION) + " " + currentTrack.name + " " + str(currentTrack.reverse) + " " + str(masterChrono) + " " + str(len(self.listPlayer)) + " ") > >--- pyRacerz.py 2005-10-14 17:07:15.000000000 +0200 >+++ pyRacerz.py 2005-11-14 23:26:30.000000000 +0100 >@@ -44,6 +44,8 @@ > double = 1 > > displayFlags = HWSURFACE >+ >+ pathtoreplays = os.environ.get('HOME') + "/.pyRacerz/replays" > > # Get commandline options > if len(sys.argv) != 1: >@@ -248,17 +250,18 @@ > > elif select1 == 4: > replays = [] >- >- listFiles = os.listdir("replays") >- for fileReplay in listFiles: >- if fileReplay.endswith(".rep"): >- replays.append(fileReplay.replace(".rep", "")) >+ >+ if os.path.exists(pathtoreplays): >+ listFiles = os.listdir(pathtoreplays) >+ for fileReplay in listFiles: >+ if fileReplay.endswith(".rep"): >+ replays.append(fileReplay.replace(".rep", "")) > > menu7 = menu.SimpleMenu(misc.titleFont, "replay: chooseFile", 1*misc.zoom, misc.smallItemFont, replays) > select7 = menu7.getInput() > > if select7 != -1 and len(replays) != 0: >- rep = replay.Replay(os.path.join("replays", replays[select7-1] + ".rep")) >+ rep = replay.Replay(os.path.join(pathtoreplays, replays[select7-1] + ".rep")) > rep.play() > > elif select1 == 5:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 110062
:
71135
|
72895
|
72896
| 72906 |
72907