|
From: Mark N. <no...@so...> - 2003-01-15 16:06:21
|
I'd like to get everyone's thoughts about a new RST directive,
which I'll tentatively call "shell", though I'm open to other
ideas for the name. The proposed shell directive would be
similar to the "include" directive except that instead of reading
from a file that is named in the argument, it executes the
argument in a shell. Like "include", it would allow the
"literal" option to disable reparsing of the output as RST.
The advantage of the proposed "shell" directive is that it
allows parts of the document to be constructed dynamically,
without having to run the program previously to create an
included file. For example, you could have a document that
has something like
The following files are in this directory:
.. shell:: ls -l
:literal:
What do people think?
--Mark
|
|
From: Benja F. <b.f...@gm...> - 2003-01-15 16:44:40
|
Mark Nodine wrote: > I'd like to get everyone's thoughts about a new RST directive, > which I'll tentatively call "shell", though I'm open to other > ideas for the name. The proposed shell directive would be > similar to the "include" directive except that instead of reading > from a file that is named in the argument, it executes the > argument in a shell. Like "include", it would allow the > "literal" option to disable reparsing of the output as RST. > > The advantage of the proposed "shell" directive is that it > allows parts of the document to be constructed dynamically, > without having to run the program previously to create an > included file. For example, you could have a document that > has something like > > The following files are in this directory: > > .. shell:: ls -l > :literal: > > What do people think? You'd want to allow this only when a special option is passed to docutils, so that you can simply run a ReST someone sends you through the converter without worrying about '.. shell:: rm ~ -rf'. - Benja |
|
From: Gary G. <ggo...@io...> - 2003-01-15 23:51:41
|
In gmane.text.docutils.devel, you wrote: [...] > .. shell:: ls -l > :literal: I'd be a little concerned about security: > .. shell:: rm -rf / > :literal: I'm not too sure where this would be needed. Any place where you might want a shell command, you could just create a tag and handle it by pre or post processing: .. _replaceMeLaterWithLsOutput -- Gary Godfrey Austin, TX USA ggo...@io... |
|
From: David G. <go...@py...> - 2003-01-16 23:41:06
|
Mark Nodine wrote: > I'd like to get everyone's thoughts about a new RST directive, > which I'll tentatively call "shell", though I'm open to other > ideas for the name. It's already in the to-do list, with the directive name "system": <http://docutils.sf.net/spec/notes.html#misc-system>. There's also an "exec" directive for executing Python code. They are both just awaiting implementation ;). -- David Goodger <go...@py...> Open-source projects: - Python Docutils: http://docutils.sourceforge.net/ (includes reStructuredText: http://docutils.sf.net/rst.html) - The Go Tools Project: http://gotools.sourceforge.net/ |
|
From: Richard J. <rj...@ek...> - 2003-01-17 00:23:28
|
On Fri, 17 Jan 2003 10:43 am, David Goodger wrote: > Mark Nodine wrote: > > I'd like to get everyone's thoughts about a new RST directive, > > which I'll tentatively call "shell", though I'm open to other > > ideas for the name. > > It's already in the to-do list, with the directive name "system": > <http://docutils.sf.net/spec/notes.html#misc-system>. There's also an > "exec" directive for executing Python code. > > They are both just awaiting implementation ;). Just glancing at that, I believe that "misc.exec" and "misc.eval" need to have their notes upgraded to "Definitely dangerous!". Richard |
|
From: Benja F. <b.f...@gm...> - 2003-01-17 00:35:12
|
Richard Jones wrote: > On Fri, 17 Jan 2003 10:43 am, David Goodger wrote: > >>Mark Nodine wrote: >> >>>I'd like to get everyone's thoughts about a new RST directive, >>>which I'll tentatively call "shell", though I'm open to other >>>ideas for the name. >> >>It's already in the to-do list, with the directive name "system": >><http://docutils.sf.net/spec/notes.html#misc-system>. There's also an >>"exec" directive for executing Python code. >> >>They are both just awaiting implementation ;). > > > Just glancing at that, I believe that "misc.exec" and "misc.eval" need to have > their notes upgraded to "Definitely dangerous!". Except if you run them inside a strong bastion by default... I do believe that 'python' is a better name than 'exec,' for language agnosticity, btw. Cheers, - Benja |
|
From: Richard J. <rj...@ek...> - 2003-01-17 00:40:36
|
On Fri, 17 Jan 2003 11:34 am, Benja Fallenstein wrote: > Richard Jones wrote: > > On Fri, 17 Jan 2003 10:43 am, David Goodger wrote: > >>Mark Nodine wrote: > >>>I'd like to get everyone's thoughts about a new RST directive, > >>>which I'll tentatively call "shell", though I'm open to other > >>>ideas for the name. > >> > >>It's already in the to-do list, with the directive name "system": > >><http://docutils.sf.net/spec/notes.html#misc-system>. There's also an > >>"exec" directive for executing Python code. > >> > >>They are both just awaiting implementation ;). > > > > Just glancing at that, I believe that "misc.exec" and "misc.eval" need to > > have their notes upgraded to "Definitely dangerous!". > > Except if you run them inside a strong bastion by default... There appears to be no chance that a secure bastion will exist for Python in the near future. The Bastion and rexec code is being removed from Python 2.3 for this reason. > I do believe that 'python' is a better name than 'exec,' for language > agnosticity, btw. +1 Richard |
|
From: Fred L. D. Jr. <fd...@ac...> - 2003-01-17 04:24:01
|
Benja Fallenstein writes: > Except if you run them inside a strong bastion by default... No, there's no way to do this in the standard library. > I do believe that 'python' is a better name than 'exec,' for language > agnosticity, btw. Yes, most certainly! -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Zope Corporation |