diff options
author | Wade Brainerd <wadetb@gmail.com> | 2008-05-23 23:33:59 (GMT) |
---|---|---|
committer | Wade Brainerd <wadetb@gmail.com> | 2008-05-23 23:33:59 (GMT) |
commit | b3ff69e40a788003fa31cef4d410e8d818cd83fc (patch) | |
tree | 79175e3d2116aabbd6f2f5288173aed21c959563 /server.py | |
parent | 6f7eace8b6056d820fb8239b97dee834ec524ca3 (diff) |
Fix images path to be relative to es_PE/
Diffstat (limited to 'server.py')
-rwxr-xr-x | server.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -109,14 +109,14 @@ class WPImageDB: def getPath(self, name, size=None): hashed_name = self.hashpath(name) - path = 'images/%s' % hashed_name + path = 'es_PE/images/%s' % hashed_name #print "getPath: %s -> %s" % (name.encode('utf8'), path.encode('utf8')) return path def getURL(self, name, size=None): hashed_name = self.hashpath(name) - if os.path.exists('images/' + hashed_name): - url = '/images/' + hashed_name + if os.path.exists('es_PE/images/' + hashed_name): + url = '/es_PE/images/' + hashed_name else: url = 'http://upload.wikimedia.org/wikipedia/commons/' + hashed_name #print "getUrl: %s -> %s" % (name.encode('utf8'), url.encode('utf8')) @@ -458,7 +458,7 @@ class WikiRequestHandler(SimpleHTTPRequestHandler): self.wfile.write("</body></html>") def send_image(self, path): - if os.path.exists('images/' + path): + if os.path.exists('es_PE/images/' + path): # If image exists locally, serve it as normal. SimpleHTTPRequestHandler.do_GET(self) else: |