def codesnippet_method(line_begin): res = run_method_dialog(is_intf_method = False) if not res: return name, visibility, scope, virtual, abstract = res block = Textblock(line_begin) block.writeln('with Method("%s",' % name) block.indent() visi_names = { PUBLIC: "PUBLIC", PROTECTED: "PROTECTED", PRIVATE: "PRIVATE" } block.write("inVisi = %s" % visi_names[visibility]) if scope == STATIC: block.writeln(",") block.write("inScope = STATIC") if abstract: block.writeln(",") block.write("inAbstract = True") elif virtual: block.writeln(",") block.write("inVirtual = True") block.writeln() block.writeln("):") block.writeln() block.writeln('Param("<name>", "<type>")') return str(block)
def codesnippet_intf_method(line_begin): res = run_method_dialog(is_intf_method = True) if not res: return name, visibility, scope, virtual, abstract = res block = Textblock(line_begin) block.writeln('with IntfMethod("%s"):' % name) block.indent() block.writeln('Param("<name>", "<type>")') return str(block)