aboutsummaryrefslogtreecommitdiff
path: root/cgi
diff options
context:
space:
mode:
Diffstat (limited to 'cgi')
-rw-r--r--cgi/oekaki.py6
-rwxr-xr-xcgi/weabot.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/cgi/oekaki.py b/cgi/oekaki.py
index 14c3a1d..e20316c 100644
--- a/cgi/oekaki.py
+++ b/cgi/oekaki.py
@@ -116,7 +116,7 @@ def oekaki(self, path_split):
board = setBoard(path_split[3])
ip = inet_aton(self.environ["REMOTE_ADDR"])
- fname = "%s/%s/temp/%d.png" % (Settings.IMAGES_DIR, board['dir'], ip)
+ fname = os.path.join(Settings.IMAGES_DIR, board['dir'], "temp", str(ip) + ".png")
if path_split[4] == 'b64':
page = write_from_base64(fname, self.formdata['image'])
@@ -139,7 +139,7 @@ def oekaki(self, path_split):
ts = int(time.time())
ip = inet_aton(self.environ["REMOTE_ADDR"])
- fname = "%s/%s/temp/%d.png" % (Settings.IMAGES_DIR, board['dir'], ip)
+ fname = os.path.join(Settings.IMAGES_DIR, board['dir'], "temp", str(ip) + ".png")
oek = 'no'
if 'filebase' in self.formdata:
@@ -213,4 +213,4 @@ def write_from_shi(fname, fp):
with open(fname, 'wb') as f:
f.write(img)
- return "OK" \ No newline at end of file
+ return "OK"
diff --git a/cgi/weabot.py b/cgi/weabot.py
index a85c2e7..5757df2 100755
--- a/cgi/weabot.py
+++ b/cgi/weabot.py
@@ -599,7 +599,7 @@ class weabot(object):
# process files
if oek_file:
try:
- fname = "%s/%s/temp/%s.png" % (Settings.IMAGES_DIR, board['dir'], oek_file)
+ fname = os.path.join(Settings.IMAGES_DIR, board['dir'], "temp", oek_file + ".png")
with open(fname, 'rb') as f:
file = f.read()
except: