r101296 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101295‎ | r101296 | r101297 >
Date:07:16, 30 October 2011
Author:aaron
Status:ok
Tags:
Comment:
Comment tweaks
Modified paths:
  • /trunk/extensions/SwiftMedia/wmf/rewrite.py (modified) (history)

Diff [purge]

Index: trunk/extensions/SwiftMedia/wmf/rewrite.py
@@ -15,7 +15,7 @@
1616 # just return the open file handle, and webob would take care of reading from
1717 # the socket and returning the data to the client machine. If we were only
1818 # opening a URL and writing its contents out to Swift, we could call
19 -# put_object with the file handle and it would read take care of reading from
 19+# put_object with the file handle and it would take care of reading from
2020 # the socket and writing the data to the Swift proxy.
2121 # We have to do both at the same time. This requires that we hand over a class which
2222 # is an iterable which reads, writes one copy to Swift (using put_object_chunked), and
@@ -153,13 +153,15 @@
154154
155155 # keep a copy of the original request so we can ask the scalers for it
156156 reqorig = req.copy()
157 - # match these two URL forms, with the wikipedia, commons, and the rest
158 - # going into groups.
 157+ # match these two URL forms (source files and thumbnails):
 158+ # http://upload.wikimedia.org/<site>/<lang>/.*
 159+ # http://upload.wikimedia.org/<site>/<lang>/thumb/.*
 160+ # example:
159161 # http://upload.wikimedia.org/wikipedia/commons/a/aa/000_Finlanda_harta.PNG
160162 # http://upload.wikimedia.org/wikipedia/commons/thumb/a/aa/000_Finlanda_harta.PNG/75px-000_Finlanda_harta.PNG
161163 match = re.match(r'/(.*?)/(.*?)/(.*)', req.path)
162164 if match:
163 - # Our target URL is as follows:
 165+ # Our target URL is as follows (example):
164166 # https://alsted.wikimedia.org:8080/v1/AUTH_6790933748e741268babd69804c6298b/wikipedia-en/2/25/Machinesmith.png
165167
166168 # quote slashes in the container name

Status & tagging log