From: <lu...@us...> - 2009-03-03 11:01:26
|
Revision: 384 http://s3tools.svn.sourceforge.net/s3tools/?rev=384&view=rev Author: ludvigm Date: 2009-03-03 11:01:17 +0000 (Tue, 03 Mar 2009) Log Message: ----------- * s3cmd, S3/Config.py, S3/S3.py: Support for --verbatim. Modified Paths: -------------- s3cmd/trunk/ChangeLog s3cmd/trunk/S3/Config.py s3cmd/trunk/S3/S3.py s3cmd/trunk/s3cmd Modified: s3cmd/trunk/ChangeLog =================================================================== --- s3cmd/trunk/ChangeLog 2009-02-25 03:46:49 UTC (rev 383) +++ s3cmd/trunk/ChangeLog 2009-03-03 11:01:17 UTC (rev 384) @@ -1,3 +1,7 @@ +2009-03-04 Michal Ludvig <mi...@lo...> + + * s3cmd, S3/Config.py, S3/S3.py: Support for --verbatim. + 2009-02-25 Michal Ludvig <mi...@lo...> * s3cmd: Fixed "put file.ext s3://bkt" (ie just the bucket name). Modified: s3cmd/trunk/S3/Config.py =================================================================== --- s3cmd/trunk/S3/Config.py 2009-02-25 03:46:49 UTC (rev 383) +++ s3cmd/trunk/S3/Config.py 2009-03-03 11:01:17 UTC (rev 384) @@ -68,6 +68,7 @@ debug_exclude = {} debug_include = {} encoding = "utf-8" + verbatim = False ## Creating a singleton def __new__(self, configfile = None): Modified: s3cmd/trunk/S3/S3.py =================================================================== --- s3cmd/trunk/S3/S3.py 2009-02-25 03:46:49 UTC (rev 383) +++ s3cmd/trunk/S3/S3.py 2009-03-03 11:01:17 UTC (rev 384) @@ -267,6 +267,11 @@ def urlencode_string(self, string): if type(string) == unicode: string = string.encode("utf-8") + + if self.config.verbatim: + ## Don't do any pre-processing + return string + encoded = "" ## List of characters that must be escaped for S3 ## Haven't found this in any official docs @@ -287,6 +292,7 @@ o == 0x22 or # " o == 0x23 or # # o == 0x25 or # % + o == 0x26 or # & o == 0x2B or # + (or it would become <space>) o == 0x3C or # < o == 0x3E or # > Modified: s3cmd/trunk/s3cmd =================================================================== --- s3cmd/trunk/s3cmd 2009-02-25 03:46:49 UTC (rev 383) +++ s3cmd/trunk/s3cmd 2009-03-03 11:01:17 UTC (rev 384) @@ -1389,6 +1389,7 @@ optparser.add_option( "--add-header", dest="add_header", action="append", metavar="NAME:VALUE", help="Add a given HTTP header to the upload request. Can be used multiple times. For instance set 'Expires' or 'Cache-Control' headers (or both) using this options if you like.") optparser.add_option( "--encoding", dest="encoding", metavar="ENCODING", help="Override autodetected terminal and filesystem encoding (character set). Autodetected: %s" % preferred_encoding) + optparser.add_option( "--verbatim", dest="verbatim", action="store_true", help="Use the S3 name as given on the command line. No pre-processing, encoding, etc. Use with caution!") optparser.add_option( "--list-md5", dest="list_md5", action="store_true", help="Include MD5 sums in bucket listings (only for 'ls' command).") optparser.add_option("-H", "--human-readable-sizes", dest="human_readable_sizes", action="store_true", help="Print sizes in human readable form (eg 1kB instead of 1234).") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |