Add ability change variables in cl-template.

master3.3
Mike Hiretsky 14 years ago
parent 412bd02b52
commit 8ba59f0605

@ -39,10 +39,7 @@ CMD_OPTIONS = [{'shortOption':"l",
'all','clt','local','remote'")},
{'longOption':"clt",
'optVal':"CLT_TEMPLATE",
'help':_("process clt template (default)")},
{'shortOption':"v",
'longOption':"vars",
'help':_("print variables")
'help':_("process clt template (default)")
}]
class apply_template_cmd(share_cmd):
@ -55,7 +52,7 @@ class apply_template_cmd(share_cmd):
examples=EXAMPLES,
comment_examples=COMMENT_EXAMPLES,
description=DESCRIPTION,
option_list=CMD_OPTIONS + opt.color_control,
option_list=CMD_OPTIONS + opt.color_control + opt.variable_control,
check_values=self.checkOpts)
# Создаем объект логики
self.logicObj = updateConfFiles()
@ -82,6 +79,7 @@ class apply_template_cmd(share_cmd):
errMsg = _("incorrect arguments") + ":" + " %s" %" ".join(args)
self.optobj.error(errMsg)
return False
self.optobj.checkVarSyntax(optObj)
return optObj, args
def applyCltTemplate(self, cltTemplate):

@ -35,6 +35,9 @@ if __name__ == "__main__":
options, args = ret
# set color/nocolor for display messages
obj.setPrintNoColor(options)
# set values to variables
if not obj.setVars(options):
sys.exit(1)
# Печать переменных
if options.v:
obj.printVars(options)

Loading…
Cancel
Save