except NameError:
pass
+# Python 2/3 compatibility for execfile function
+try:
+ execfile
+except:
+ def execfile(somefile, global_vars, local_vars):
+ with open(somefile) as f:
+ code = compile(f.read(), somefile, 'exec')
+ exec(code, global_vars, local_vars)
+
parser = src.options.Options()
parser.add_option('n', 'name', 'string', 'name',
_("""REQUIRED: the name of the module to create.
# check required parameters in template.info
missing = []
for pp in ["file_subst", "parameters"]:
- if not ldic.has_key(pp): missing.append("'%s'" % pp)
+ if not (pp in ldic): missing.append("'%s'" % pp)
if len(missing) > 0:
raise src.SatException(_(
"Bad format in settings file! %s not defined.") % ", ".join(
val = ""
while not tp.check_value(val):
- val = raw_input(tp.prompt)
+ val = input(tp.prompt)
if len(val) == 0 and len(tp.default) > 0:
val = tp.default
dico[tp.name] = val
# ask for missing value for pyconf
pyconfparam = self.get_pyconf_parameters()
- for p in filter(lambda l: not dico.has_key(l), pyconfparam):
+ for p in filter(lambda l: not (l in dico), pyconfparam):
rep = ""
while len(rep) == 0:
- rep = raw_input("%s? " % p)
+ rep = input("%s? " % p)
dico[p] = rep
self.dico = dico
logger.write("\n", 1)
return 1
- if "APPLICATION" in runner.cfg:
- msg = _("Error: this command does not use a product.")
- logger.write(src.printcolors.printcError(msg), 1)
- logger.write("\n", 1)
- return 1
+ # if "APPLICATION" in runner.cfg:
+ # msg = _("Error: this command does not use a product.")
+ # logger.write(src.printcolors.printcError(msg), 1)
+ # logger.write("\n", 1)
+ # return 1
if options.info:
return get_template_info(runner.cfg, options.template, logger)