def do_generate_int_macro(self, line): if line == '': raise PappyException('Macro name is required') args = shlex.split(line) name = args[0] script_str = gen_imacro() fname = 'int_%s.py' % name with open(fname, 'wc') as f: f.write(script_str) print 'Wrote script to %s' % fname
def generate_int_macro(line): """ Generate an intercepting macro script Usage: generate_int_macro <name> """ if line == '': raise PappyException('Macro name is required') args = shlex.split(line) name = args[0] script_str = gen_imacro() fname = 'int_%s.py' % name with open(fname, 'wc') as f: f.write(script_str) print 'Wrote script to %s' % fname
def generate_int_macro(line): """ Generate an intercepting macro script Usage: generate_int_macro <name> """ if line == "": raise PappyException("Macro name is required") args = shlex.split(line) name = args[0] script_str = gen_imacro() fname = "int_%s.py" % name with open(fname, "wc") as f: f.write(script_str) print "Wrote script to %s" % fname