Cool & Useful EmPy project, prior art?

V

Ville Vainio

I am thinking of implementing a nice little source code generation
program with empy. I'm planning on having one directory with arbitrary
number of templates. Templates can contain a significator as follows:

@%promptuser ('classname',"the name of the class",'string'),('i',"some number",'int')

After choosing a template from the list, the user will be prompted for
all variables specified in promptuser. Then, the template is expanded
and copied to clipboard for manual pasting into the target document
('gclip' of win32 unxutils should work, how can I do it in python BTW?)

What I'm planning seems to be a pretty "obvious", universally
applicable application of empy (perhaps I should file for a patent if
the EU chooses to shoot itself in the foot? ;-), and am wondering
whether someone has already done such a beast? Perhaps with a GUI,
even... I wouldn't mind doing it myself, it seems like a fun project,
but time == money and something tried & true might already exist out
there...
 
V

Ville Vainio

Ville Vainio said:
('gclip' of win32 unxutils should work, how can I do it in python BTW?)

Obviously I *could* have checked google first, but what the heck...
 
P

Peter Milliken

Ville,

If I understand what you want to do there is already something that does
this job for Emacs. Presumably to get it into some other target document
would require some transfer mechanism though........

Anyway, have a look at http://www.zipworld.com.au/~peterm. ELSE has a set of
language templates for Python.

If you really prefer a question/answer session (such as you describe) there
are other code template systems available for Emacs (that also come as part
of the Emacs distribution). They are template.el and skeleton.el. There are
no existing (to my knowledge) template definitions for Python with these
Emacs modes but I am sure they wouldn't be too hard to produce if you prefer
this form of interface.

Goodluck,
Peter
 
E

Erik Max Francis

Ville said:
What I'm planning seems to be a pretty "obvious", universally
applicable application of empy (perhaps I should file for a patent if
the EU chooses to shoot itself in the foot? ;-), and am wondering
whether someone has already done such a beast? Perhaps with a GUI,
even... I wouldn't mind doing it myself, it seems like a fun project,
but time == money and something tried & true might already exist out
there...

That seems quite reasonable, though I'm not familiar with any other
project which does anything similar. (You can ask on the empy-list
mailing list to be sure.) It does sound like something that could be
generalized to the point of getting its own unique markup, and which
would invoke behavior that can be overriden by the user -- i.e., a
special markup that says, "This information is needed from the user,
please retrieve it." It certainly sounds like a reasonable enhancement
proposal that could be made and discussed on the mailing list.
 
V

Ville Vainio

of the Emacs distribution). They are template.el and skeleton.el. There are
no existing (to my knowledge) template definitions for Python with these
Emacs modes but I am sure they wouldn't be too hard to produce if you prefer
this form of interface.

I really would like to write the templates in EmPy. I'm not actually
thinking of creating a whole file, but small snippets of code to paste
into pre-existing C++ code (with Python, I wouldn't even *need* such a
program). I coded a few elisp functions, saw that the approach sucked,
and would really prefer an external program communicating through
clipboard; that way my Visual Studio wielding colleagues could benefit
from the program & templates as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top