ALT Linux Bugzilla
– Attachment 2255 Details for
Bug 10817
Пытается писать в системные директории
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Патч, для сохранения настроек в ~/.wrw
config.py.diff (text/plain), 993 bytes, created by
Slava Semushin
on 2007-11-06 18:51:49 MSK
(
hide
)
Description:
Патч, для сохранения настроек в ~/.wrw
Filename:
MIME Type:
Creator:
Slava Semushin
Created:
2007-11-06 18:51:49 MSK
Size:
993 bytes
patch
obsolete
>--- config.py.orig 2007-11-06 20:08:58 +0600 >+++ config.py 2007-11-06 20:42:16 +0600 >@@ -1,5 +1,7 @@ > > import pygame >+from os.path import basename, dirname, expanduser >+from os import mkdir > > pl1car = "images/cars/bentley/bentleysmall.png" > pl1stin = "images/cars/bentley/bentleystin.png" >@@ -36,7 +38,7 @@ > > players = 1 > >-configFile = "options" >+configFile = expanduser("~/.wrw/options") > rozmer = 1 > xx = [1280, 1024, 800, 640] > yy = [1024, 768, 600, 480] >@@ -46,7 +48,10 @@ > multikola = 3 > > def readConfig(): >- source = file(configFile).read() >+ try: >+ source = file(configFile).read() >+ except: >+ source = file(basename(configFile)).read() > exec source in locals(), globals() > > def writeConfig(): >@@ -56,6 +61,10 @@ > name = %r > multikola = %d > """ % (rozmer, zvuky, full, name, multikola) >+ try: >+ mkdir(dirname(configFile), 0700) >+ except OSError: >+ pass > output = file(configFile, "w") > output.write(text) > output.close()
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 10817
:
2255
|
2256