Changeset 7b28990b5af30df5f624c94e39699cec8839543a

Show
Ignore:
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
  • plugins/webvideo/webvideo.py

    r4bc2854 r7b28990  
    1010import shutil 
    1111import os.path 
     12import os 
     13import urlparse 
    1214import urllib 
    1315import xml.etree.ElementTree as ElementTree 
     
    140142 
    141143        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