Changeset View
Changeset View
Standalone View
Standalone View
pykolab/cli/cmd_set_mailbox_metadata.py
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
def execute(*args, **kw): | def execute(*args, **kw): | ||||
try: | try: | ||||
folder = conf.cli_args.pop(0) | folder = conf.cli_args.pop(0) | ||||
try: | try: | ||||
metadata_path = conf.cli_args.pop(0) | metadata_path = conf.cli_args.pop(0) | ||||
try: | try: | ||||
metadata_value = conf.cli_args.pop(0) | metadata_value = conf.cli_args.pop(0) | ||||
except IndexError, errmsg: | except IndexError: | ||||
metadata_value = utils.ask_question(_("Metadata value")) | metadata_value = utils.ask_question(_("Metadata value")) | ||||
except IndexError, errmsg: | except IndexError: | ||||
metadata_path = utils.ask_question(_("Metadata path")) | metadata_path = utils.ask_question(_("Metadata path")) | ||||
metadata_value = utils.ask_question(_("Metadata value")) | metadata_value = utils.ask_question(_("Metadata value")) | ||||
except IndexError, errmsg: | except IndexError: | ||||
folder = utils.ask_question(_("Folder name")) | folder = utils.ask_question(_("Folder name")) | ||||
metadata_path = utils.ask_question(_("Metadata path")) | metadata_path = utils.ask_question(_("Metadata path")) | ||||
metadata_value = utils.ask_question(_("Metadata value")) | metadata_value = utils.ask_question(_("Metadata value")) | ||||
if len(folder.split('@')) > 1: | if len(folder.split('@')) > 1: | ||||
domain = folder.split('@')[1] | domain = folder.split('@')[1] | ||||
elif not conf.user == None and len(conf.user.split('@')) > 1: | elif not conf.user == None and len(conf.user.split('@')) > 1: | ||||
domain = conf.user.split('@')[1] | domain = conf.user.split('@')[1] | ||||
Show All 26 Lines |