Trees | Indices | Help |
---|
|
1 # -*- Mode: Python -*- 2 # -*- Encoding: UTF-8 -*- 3 # vi:si:et:sw=4:sts=4:ts=4 4 # 5 # Flumotion - a streaming media server 6 # Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com). 7 # All rights reserved. 8 9 # This file may be distributed and/or modified under the terms of 10 # the GNU General Public License version 2 as published by 11 # the Free Software Foundation. 12 # This file is distributed without any warranty; without even the implied 13 # warranty of merchantability or fitness for a particular purpose. 14 # See "LICENSE.GPL" in the source distribution for more information. 15 16 # Licensees having purchased or holding a valid Flumotion Advanced 17 # Streaming Server license may use this file in accordance with the 18 # Flumotion Advanced Streaming Server Commercial License Agreement. 19 # See "LICENSE.Flumotion" in the source distribution for more information. 20 21 # Headers in this file shall remain intact. 22 23 import os 24 import urllib 25 26 from flumotion.common import python 27 from flumotion.component.plugs import base 28 29 __version__ = "$Rev$" 30 31 46 4749 50 logCategory = 'forcedownload' 516753 properties = self.args['properties'] 54 self._argument = properties['argument-name'] 55 self._triggers = python.set(properties.get('trigger-value', ['1'])) 56 self.log("Argument name: %s", self._argument) 57 self.log("Trigger values: %s", self._triggers)5860 if self._argument in request.args: 61 if self._triggers & python.set(request.args[self._argument]): 62 filename = os.path.basename(urllib.unquote_plus(request.path)) 63 filename = filename.encode('UTF-8') 64 filename = urllib.quote(filename) 65 header = "attachment; filename*=utf-8''%s" % filename 66 request.setHeader('Content-Disposition', header)
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri Apr 29 18:38:12 2011 | http://epydoc.sourceforge.net |