help='define sharing object policy ( "read=user1,grp1,user2,... write=user1,grp2,...')
parser.add_argument('--public', action='store_true', dest='public', default=False,
help='make object publicly accessible')
+ parser.add_argument('--with-pool-size', action='store', dest='poolsize', default=None,
+ help='Set the greenlet pool size (advanced)')
def getsharing(self, orelse={}):
permstr = getattr(self.args, 'sharing')
def main(self, local_path, container____path__):
super(self.__class__, self).main(container____path__)
remote_path = local_path if self.path is None else self.path
+ poolsize = getattr(self.args, 'poolsize')
+ if poolsize is not None:
+ self.POOL_SIZE = int(poolsize)
try:
with open(local_path) as f:
if getattr(self.args, 'unchunked'):
default=None, help='show output if not modified since then')
parser.add_argument('--object-version', action='store', dest='object_version', default=None,
help='get the specific version')
+ parser.add_argument('--with-pool-size', action='store', dest='poolsize', default=None,
+ help='Set the greenlet pool size (advanced)')
def main(self, container___path, local_path=None):
super(self.__class__, self).main(container___path, path_is_optional=False)
raise CLIError(message='Cannot write to file %s - %s'%(local_path,unicode(err)),
importance=1)
download_cb = None if getattr(self.args, 'no_progress_bar') \
- else self.progress('Downloading')
-
+ else self.progress('Downloading')
+ poolsize = getattr(self.args, 'poolsize')
+ if poolsize is not None:
+ self.POOL_SIZE = int(poolsize)
try:
self.client.download_object(self.path, out, download_cb,
except KeyboardInterrupt:
print('\ndownload canceled by user')
if local_path is not None:
- print('re-run command to resume')
+ print('to resume, re-run with --resume')
print
@command()
finally:
if hasattr(sys, '_stderr'):
sys.stderr = _stderr
- POOL_SIZE = 5
+ POOL_SIZE = self.POOL_SIZE if hasattr(self, 'POOL_SIZE') else 5
if self.async_pool is None:
self.async_pool = gevent.pool.Pool(size=POOL_SIZE)
g = SilentGreenlet(self.put_block, data, hash)
if local_hash in remote_hashes:
blockid = remote_hashes.pop(local_hash)
self._cb_next()
+ del file_hashmap
#else:
# continue
# raise ClientError(message='Local file is substantialy different', status=600)