[wingide-users] Fwd: Using Templates

Peter Mott peter at monicol.co.uk
Tue Oct 11 11:03:52 EDT 2005


An example? This is a template that I use to set up logging:

# Setup logging. Use log.error(message,exc_info=1) to log with traceback
import logging
log = logging.getLogger()
h = logging.FileHandler("%(log_file)s")
f = logging.Formatter('%%(asctime)s %%(levelname)s: %%(message)s')
h.setFormatter(f)
log.addHandler(h)
log.setLevel(logging.%(!Logging_level||ERROR)s)

You right click in the template tool and choose "add a new template", choose
a name and extension for the file (I always use py for the extension) then
edit the template file, and then save it. It should appear in the template
tool in the list of templates. If you don't see the template tool then you
need to right click in some other tool (eg Indentation, Module etc) which
pops up a content menu which has the submenu 'Insert Tool'. You select this
and then choose 'Template Tool'. There is documentation on the format of
templates. 

HTH

Peter

> -----Original Message-----
> From: wingide-users-bounces at wingware.com [mailto:wingide-users-
> bounces at wingware.com] On Behalf Of Wolfram Kriesing
> Sent: 11 October 2005 15:30
> To: wingide-users at wingware.com; Wingware Support
> Subject: [wingide-users] Fwd: Using Templates
> 
> Hi,
> 
> I sent this mail yesterday and I was wondering if I made a mistake
> in sending, since it doesnt get replied and not even to the mailing list
> And it seemed to me an alike the question to the "auto complete"
> question from Jonathan this morning, which had already been answered.
> 
> Thx
> 
> ---------- Forwarded message ----------
> From: Wolfram Kriesing <wolfram.kriesing at gmail.com>
> Date: Oct 10, 2005 11:02 AM
> Subject: Using Templates
> To: wingide-users at wingware.com
> 
> 
> I thought I was able to figure it out, but I found nothing on the web
> and the tutorial http://wingware.com/doc/edit/templating doesnt help
> much either.
> How do I use templates, give me an example template file please!
> The template-tool doesnt appear in my tools-menu, and also not in the
> insert-tool thingy.
> And once i have a template, does it appear in the auto-complete menu
> or is there a keyboard short cut to execute/paste it in? (or even
> both)
> 
> I know templates from the ZendIDE, a PHP editor and they were editable
> in the GUI, so this seems a bit difficult to me.
> 
> thanks for the help
> --
> cu
> 
> Wolfram
> 
> 
> --
> cu
> 
> Wolfram
> _________________________________________________
> Wing IDE users list
> http://wingware.com/lists/wingide



More information about the wingide-users mailing list