# HG changeset patch # User Paul Boddie # Date 1237592064 -3600 # Node ID 56b405d5a872b620a581012f4a0970a1ac462266 # Parent 893516dc2a2cd4cd71d17911690512862d2d1e56 Added filename fix for uploads. Added a rollback method to the DirectoryRepository class in order to support the use of such repositories with StoreSelector instances. diff -r 893516dc2a2c -r 56b405d5a872 WebStack/Helpers/Request.py --- a/WebStack/Helpers/Request.py Fri Mar 20 22:45:11 2009 +0100 +++ b/WebStack/Helpers/Request.py Sat Mar 21 00:34:24 2009 +0100 @@ -3,7 +3,7 @@ """ Request helper classes. -Copyright (C) 2004, 2005, 2006, 2007, 2008 Paul Boddie +Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Paul Boddie This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -277,7 +277,8 @@ elif name == "filename": try: content_disposition = self.headers["Content-Disposition"] - return content_disposition.filename + # NOTE: Always seem to need to remove quotes. + return content_disposition.filename[1:-1] except (KeyError, AttributeError): return None diff -r 893516dc2a2c -r 56b405d5a872 WebStack/Repositories/Directory.py --- a/WebStack/Repositories/Directory.py Fri Mar 20 22:45:11 2009 +0100 +++ b/WebStack/Repositories/Directory.py Sat Mar 21 00:34:24 2009 +0100 @@ -3,7 +3,7 @@ """ Directory repositories for WebStack. -Copyright (C) 2005, 2006, 2007 Paul Boddie +Copyright (C) 2005, 2006, 2007, 2009 Paul Boddie This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -73,6 +73,12 @@ else: self.fsencoding = fsencoding or 'ascii' + def rollback(self): + + "A method used by the StoreSelector." + + pass + def _convert_name(self, name): "Convert the given 'name' to a plain string in the filesystem encoding."