473,320 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Cool & Useful EmPy project, prior art?


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...

--
Ville Vainio http://www.students.tut.fi/~vainio24
Jul 18 '05 #1
4 1607
Ville Vainio <vi********************@spamtut.fi> writes:
('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...

--
Ville Vainio http://www.students.tut.fi/~vainio24
Jul 18 '05 #2
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
"Ville Vainio" <vi********************@spamtut.fi> wrote in message
news:du*************@mozart.cc.tut.fi...

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...

--
Ville Vainio http://www.students.tut.fi/~vainio24

Jul 18 '05 #3
Ville Vainio wrote:
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.

--
Erik Max Francis && ma*@alcyone.com && http://www.alcyone.com/max/
__ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/ \ There is nothing so subject to the inconstancy of fortune as war.
\__/ Miguel de Cervantes
Jul 18 '05 #4
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.

--
Ville Vainio http://www.students.tut.fi/~vainio24
Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Florian Proch | last post by:
Hi all... i'm currently working for a big project to construct a website. We need to support some browser and OS : IE 5.0 -> IE 6, Mozilla 1.2 -> 1.7, Opera 5 -> Opéra 7.5x, Netscape 4.75 -> NS...
81
by: Michael Rozdoba | last post by:
I've been wandering around the results of numerous googles for several hours without reaching a conclusive solution, so I'm dipping a tentative toe back in ciwah... I've been persuaded here in...
39
by: Hareth | last post by:
C# 2005 express & vb 2005 express: 1. During runtime, I can edit my codes in C#..... How come this cannot be done in VB? it says ...."read-only" during runtime...... 2. Why does vb...
4
by: Ian | last post by:
Hi there, Has anybody got any tips or recommendations for using Vs.Net and Dreamweaver 2004 together? I like to use dreamweaver as the layout tool as for me it just seems a little more...
6
by: snt | last post by:
I have a C# asp.net project in which I create meta keywords dynamically. I have a problem with "&" character. When the page is rendered, the "&" character is converted into "&amp;". Is there any...
6
by: Gordowey | last post by:
Where can I find this DIV effect. go to: http://www.amazon.com Put mouse over the text "See All 32 Product Categories" (Top-Middle)..it will open a window with a cool effect... does anyone...
17
by: Arpan | last post by:
When a Button is clicked in a Web Form in an ASPX page, the Form will post back to itself. Under such circumstances (i.e. when a Button is clicked), will the Page_Load sub execute first & then will...
0
by: Michael | last post by:
Hi, We're (BBC Research) participating in Google's Summer of Code as a mentor organisation again, and I thought it worth spreading some extra publicity where I think there might be some...
0
by: Very cool design! Useful information. Go on!,Very | last post by:
Very cool design! Useful information. Go on!,Very cool design! Useful information. Go on!,Very cool design! Useful information. Go on!
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.