Cool & Useful EmPy project, prior art?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ville Vainio

    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',"t he 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
  • Ville Vainio

    #2
    Re: Cool & Useful EmPy project, prior art?

    Ville Vainio <ville.spammeha rdvainio@spamtu t.fi> writes:
    [color=blue]
    > ('gclip' of win32 unxutils should work, how can I do it in python BTW?)[/color]

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

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

    Comment

    • Peter Milliken

      #3
      Re: Cool &amp; Useful EmPy project, prior art?

      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" <ville.spammeha rdvainio@spamtu t.fi> wrote in message
      news:du71xunfwe g.fsf@mozart.cc .tut.fi...[color=blue]
      >
      > 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',"t he name of the class",'string' ),('i',"some[/color]
      number",'int')[color=blue]
      >
      > 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[/color]


      Comment

      • Erik Max Francis

        #4
        Re: Cool &amp; Useful EmPy project, prior art?

        Ville Vainio wrote:
        [color=blue]
        > 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...[/color]

        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 && max@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

        Comment

        • Ville Vainio

          #5
          Re: Cool &amp; Useful EmPy project, prior art?

          [color=blue]
          > 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.[/color]

          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

          Comment

          Working...