Changeset 7b28990b5af30df5f624c94e39699cec8839543a
- Timestamp:
- 04/06/08 05:00:01
(9 months ago)
- Author:
- Jason Michalski <armooo@armooo.net>
- git-committer:
- Jason Michalski <armooo@armooo.net> 1207476001 -0500
- git-parent:
[4bc2854bb0f9b2e4302bf6483771110b74519332]
- git-author:
- Jason Michalski <armooo@armooo.net> 1207476001 -0500
- Message:
Unlink the video adter sending it.
We could unlink it when the tranfer failed, but we would send a
206 response anyway.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r4bc2854 |
r7b28990 |
|
| 10 | 10 | import shutil |
|---|
| 11 | 11 | import os.path |
|---|
| | 12 | import os |
|---|
| | 13 | import urlparse |
|---|
| 12 | 14 | import urllib |
|---|
| 13 | 15 | import xml.etree.ElementTree as ElementTree |
|---|
| … | … | |
| 140 | 142 | |
|---|
| 141 | 143 | print 'done downloading %s to %s' % (url, file_path) |
|---|
| | 144 | |
|---|
| | 145 | def send_file(self, handler, container, name): |
|---|
| | 146 | Video.send_file(self, handler, container, name) |
|---|
| | 147 | |
|---|
| | 148 | o = urlparse.urlparse("http://fake.host" + handler.path) |
|---|
| | 149 | path = urllib.unquote(o[2]) |
|---|
| | 150 | file_path = container['path'] + path[len(name) + 1:] |
|---|
| | 151 | if os.path.exists(file_path): |
|---|
| | 152 | os.unlink(file_path) |
|---|
| | 153 | |
|---|