git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@335 830e0280-6d2a-0410-9c65-932aecc39d9d
Michal Ludvig authored on 2009/01/12 20:25:52... | ... |
@@ -1,3 +1,9 @@ |
1 |
+2009-01-13 Michal Ludvig <michal@logix.cz> |
|
2 |
+ |
|
3 |
+ * TODO: Updated. |
|
4 |
+ * s3cmd: renamed (fetch_)remote_keys to remote_list and |
|
5 |
+ a few other renames for consistency. |
|
6 |
+ |
|
1 | 7 |
2009-01-08 Michal Ludvig <michal@logix.cz> |
2 | 8 |
|
3 | 9 |
* S3/S3.py: Some errors during file upload were incorrectly |
... | ... |
@@ -17,8 +17,8 @@ TODO list for s3cmd project |
17 | 17 |
|
18 | 18 |
- For 1.0.0 |
19 | 19 |
- Add --include/--include-from/--rinclude* for sync |
20 |
- - Add 'setacl' command. |
|
21 | 20 |
- Add commands for CloudFront. |
21 |
+ - Add 'geturl' command, both Unicode and urlencoded output. |
|
22 | 22 |
|
23 | 23 |
- After 1.0.0 |
24 | 24 |
- Speed up upload / download with multiple threads. |
... | ... |
@@ -29,7 +29,7 @@ TODO list for s3cmd project |
29 | 29 |
- Keep backup files remotely on put/sync-to if requested |
30 | 30 |
(move the old 'object' to e.g. 'object~' and only then upload |
31 | 31 |
the new one). Could be more advanced to keep, say, last 5 |
32 |
- copies, etc. |
|
32 |
+ copies, etc. |
|
33 | 33 |
|
34 | 34 |
- Implement GPG for sync |
35 | 35 |
(it's not that easy since it won't be easy to compare |
... | ... |
@@ -169,9 +169,9 @@ def cmd_bucket_delete(args): |
169 | 169 |
_bucket_delete_one(uri) |
170 | 170 |
output(u"Bucket '%s' removed" % uri.uri()) |
171 | 171 |
|
172 |
-def fetch_remote_keys(args): |
|
172 |
+def fetch_remote_list(args): |
|
173 | 173 |
remote_uris = [] |
174 |
- remote_keys = [] |
|
174 |
+ remote_list = [] |
|
175 | 175 |
|
176 | 176 |
for arg in args: |
177 | 177 |
uri = S3Uri(arg) |
... | ... |
@@ -191,7 +191,7 @@ def fetch_remote_keys(args): |
191 | 191 |
'remote_uri' : object, |
192 | 192 |
'key' : key |
193 | 193 |
} |
194 |
- remote_keys.append(download_item) |
|
194 |
+ remote_list.append(download_item) |
|
195 | 195 |
else: |
196 | 196 |
for uri in remote_uris: |
197 | 197 |
uri_str = str(uri) |
... | ... |
@@ -215,7 +215,7 @@ def fetch_remote_keys(args): |
215 | 215 |
'remote_uri' : S3Uri(objectlist[key]['object_uri_str']), |
216 | 216 |
'key' : key, |
217 | 217 |
} |
218 |
- remote_keys.append(download_item) |
|
218 |
+ remote_list.append(download_item) |
|
219 | 219 |
else: |
220 | 220 |
## No wildcards - simply append the given URI to the list |
221 | 221 |
key = os.path.basename(uri.object()) |
... | ... |
@@ -225,8 +225,8 @@ def fetch_remote_keys(args): |
225 | 225 |
'remote_uri' : uri, |
226 | 226 |
'key' : key |
227 | 227 |
} |
228 |
- remote_keys.append(download_item) |
|
229 |
- return remote_keys |
|
228 |
+ remote_list.append(download_item) |
|
229 |
+ return remote_list |
|
230 | 230 |
|
231 | 231 |
def cmd_object_put(args): |
232 | 232 |
s3 = S3(Config()) |
... | ... |
@@ -326,29 +326,29 @@ def cmd_object_get(args): |
326 | 326 |
if len(args) == 0: |
327 | 327 |
raise ParameterError("Nothing to download. Expecting S3 URI.") |
328 | 328 |
|
329 |
- remote_keys = fetch_remote_keys(args) |
|
330 |
- total_count = len(remote_keys) |
|
329 |
+ remote_list = fetch_remote_list(args) |
|
330 |
+ remote_count = len(remote_list) |
|
331 | 331 |
|
332 | 332 |
if not os.path.isdir(destination_base) or destination_base == '-': |
333 | 333 |
## We were either given a file name (existing or not) or want STDOUT |
334 |
- if total_count > 1: |
|
334 |
+ if remote_count > 1: |
|
335 | 335 |
raise ParameterError("Destination must be a directory when downloading multiple sources.") |
336 |
- remote_keys[0]['local_filename'] = destination_base |
|
336 |
+ remote_list[0]['local_filename'] = destination_base |
|
337 | 337 |
elif os.path.isdir(destination_base): |
338 | 338 |
if destination_base[-1] != os.path.sep: |
339 | 339 |
destination_base += os.path.sep |
340 |
- for key in remote_keys: |
|
340 |
+ for key in remote_list: |
|
341 | 341 |
key['local_filename'] = destination_base + key['key'] |
342 | 342 |
else: |
343 | 343 |
raise InternalError("WTF? Is it a dir or not? -- %s" % destination_base) |
344 | 344 |
|
345 | 345 |
seq = 0 |
346 |
- for item in remote_keys: |
|
346 |
+ for item in remote_list: |
|
347 | 347 |
seq += 1 |
348 | 348 |
uri = item['remote_uri'] |
349 | 349 |
## Encode / Decode destination with "replace" to make sure it's compatible with current encoding |
350 | 350 |
destination = unicodise_safe(item['local_filename']) |
351 |
- seq_label = "[%d of %d]" % (seq, total_count) |
|
351 |
+ seq_label = "[%d of %d]" % (seq, remote_count) |
|
352 | 352 |
|
353 | 353 |
start_position = 0 |
354 | 354 |
|
... | ... |
@@ -890,12 +890,12 @@ def cmd_setacl(args): |
890 | 890 |
|
891 | 891 |
set_to_acl = cfg.acl_public and "Public" or "Private" |
892 | 892 |
|
893 |
- remote_keys = fetch_remote_keys(args) |
|
894 |
- total_keys = len(remote_keys) |
|
893 |
+ remote_list = fetch_remote_list(args) |
|
894 |
+ remote_count = len(remote_list) |
|
895 | 895 |
seq = 0 |
896 |
- for key in remote_keys: |
|
896 |
+ for key in remote_list: |
|
897 | 897 |
seq += 1 |
898 |
- seq_label = "[%d of %d]" % (seq, total_keys) |
|
898 |
+ seq_label = "[%d of %d]" % (seq, remote_count) |
|
899 | 899 |
uri = key['remote_uri'] |
900 | 900 |
acl = s3.get_acl(uri) |
901 | 901 |
debug(u"acl: %s - %r" % (uri, acl.grantees)) |