Revision 36fa6ffb
b/kamaki/cli/utils/__init__.py | ||
---|---|---|
434 | 434 |
return terms |
435 | 435 |
|
436 | 436 |
|
437 |
def ask_user(msg, true_resp=('y', ), out=stdout, user_in=stdin):
|
|
437 |
def ask_user(msg, true_resp=('y', ), **kwargs):
|
|
438 | 438 |
"""Print msg and read user response |
439 | 439 |
|
440 | 440 |
:param true_resp: (tuple of chars) |
... | ... | |
443 | 443 |
""" |
444 | 444 |
yep = ', '.join(true_resp) |
445 | 445 |
nope = '<not %s>' % yep if 'n' in true_resp or 'N' in true_resp else 'N' |
446 |
out.write('%s [%s/%s]: ' % (msg, yep, nope)) |
|
447 |
user_response = user_in.readline() |
|
446 |
user_response = raw_input('%s [%s/%s]: ' % (msg, yep, nope)) |
|
448 | 447 |
return user_response[0].lower() in [s.lower() for s in true_resp] |
449 | 448 |
|
450 | 449 |
|
b/kamaki/clients/pithos/__init__.py | ||
---|---|---|
624 | 624 |
for thread in activethreads(): |
625 | 625 |
thread.join() |
626 | 626 |
raise |
627 |
self._cb_next() |
|
627 | 628 |
|
628 | 629 |
r = self.object_put( |
629 | 630 |
obj, |
... | ... | |
1359 | 1360 |
finally: |
1360 | 1361 |
from time import sleep |
1361 | 1362 |
sleep(2 * len(activethreads())) |
1363 |
self._cb_next() |
|
1362 | 1364 |
return headers.values() |
1363 | 1365 |
|
1364 | 1366 |
def truncate_object(self, obj, upto_bytes): |
... | ... | |
1427 | 1429 |
data=block) |
1428 | 1430 |
headers.append(dict(r.headers)) |
1429 | 1431 |
offset += len(block) |
1430 |
|
|
1431 |
self._cb_next
|
|
1432 |
self._cb_next() |
|
1433 |
self._cb_next()
|
|
1432 | 1434 |
return headers |
1433 | 1435 |
|
1434 | 1436 |
def copy_object( |
Also available in: Unified diff