VirtualMailManager/cli/subcommands.py
branchv0.6.x
changeset 559 cc0f67f99780
parent 555 499c63f52462
child 561 b0165b7af7a3
equal deleted inserted replaced
558:2fcf12fdecc2 559:cc0f67f99780
   671     if ctx.argc < 3:
   671     if ctx.argc < 3:
   672         usage(EX_MISSING_ARGS, _(u'Missing e-mail address and storage value.'),
   672         usage(EX_MISSING_ARGS, _(u'Missing e-mail address and storage value.'),
   673               ctx.scmd)
   673               ctx.scmd)
   674     elif ctx.argc < 4:
   674     elif ctx.argc < 4:
   675         usage(EX_MISSING_ARGS, _(u'Missing storage value.'), ctx.scmd)
   675         usage(EX_MISSING_ARGS, _(u'Missing storage value.'), ctx.scmd)
   676     try:
   676     if ctx.args[3] != 'default':
   677         bytes_ = ctx.args[3] if ctx.args[3] == 'default' \
   677         try:
   678                              else size_in_bytes(ctx.args[3])
   678             bytes_ = size_in_bytes(ctx.args[3])
   679     except (ValueError, TypeError):
   679         except (ValueError, TypeError):
   680         usage(INVALID_ARGUMENT, _(u"Invalid storage value: '%s'") %
   680             usage(INVALID_ARGUMENT, _(u"Invalid storage value: '%s'") %
   681               ctx.args[3], ctx.scmd)
   681                   ctx.args[3], ctx.scmd)
       
   682     else:
       
   683         bytes_ = ctx.args[3]
   682     if ctx.argc < 5:
   684     if ctx.argc < 5:
   683         messages = 0
   685         messages = 0
   684     else:
   686     else:
   685         try:
   687         try:
   686             messages = int(ctx.args[4])
   688             messages = int(ctx.args[4])