Re: ANN: Docpicture 0.2

2008-11-02 Thread nopsidy
André wrote: Docpicture 0.2 has been released. You can download it from http://code.google.com/p/docpicture/ Docpicture's goal is to enable embedding pictures inside Python docstrings using some custom domain specific language (dsl). docpicture includes a plugin architecture enabling users

ANN: Docpicture 0.2

2008-10-31 Thread André
Docpicture 0.2 has been released. You can download it from http://code.google.com/p/docpicture/ Docpicture's goal is to enable embedding pictures inside Python docstrings using some custom domain specific language (dsl). docpicture includes a plugin architecture enabling users to extend

Re: docpicture

2008-10-17 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Pete Forman wrote: Maybe someone would like to play with the data URL scheme (RFC 2397) to meet the OP's desire to embed the image. AFAIK a downside is that MS are only starting to support that in IE8. Firefox, Konqueror and Safari already support it. So it's

Re: docpicture

2008-10-15 Thread Pete Forman
Scott David Daniels [EMAIL PROTECTED] writes: or you could even use: '''docpicture name=fig1.png code=base64 version=1 1234567890ABCDEF... /docpicture''' A comment _not_ a docstring (only found by scanning the source). which is easy enough to hunt for. -1 for XML

Re: docpicture

2008-10-14 Thread Scott David Daniels
Steven D'Aprano wrote: And if not, it's no big deal. Your help string has a clearly labeled few lines of hex: Help on function spam: spam(...) spam spam spam spam spam spam spam spam spam spam with a fried egg on top === begin docpicture === 1234567890ABCDEF... === end

Re: docpicture

2008-10-14 Thread bearophileHUGS
André: Ok, the following is my first attempt at implementing this idea. I suggest you to change the program you use to encode your images, because it's 1000 bytes, while with my program the same 256 colors image needs just 278 bytes: iVBORw0KGgoNSUhEUgAAABYeCAMfOR5kBGdBTUEAAL

Re: docpicture

2008-10-14 Thread bearophileHUGS
Steven D'Aprano: Unless bearophile is willing to share his code, There's no code: all I do is written in my post, and so far I have done it manually :-) Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: docpicture

2008-10-14 Thread André
(...)     spam spam spam spam spam spam     spam spam spam spam with a fried egg on top     === begin docpicture ===     1234567890ABCDEF...     === end docpicture === Or similar. I'm sure people will cope, especially since it should be relatively rare. or you could even use

Re: docpicture

2008-10-14 Thread Steven D'Aprano
on top === begin docpicture === 1234567890ABCDEF... === end docpicture === Or similar. I'm sure people will cope, especially since it should be relatively rare. or you could even use: '''docpicture name=fig1.png code=base64 version=1 1234567890ABCDEF

Re: docpicture

2008-10-14 Thread André
On Oct 14, 1:56 pm, [EMAIL PROTECTED] wrote: André: Ok, the following is my first attempt at implementing this idea. I suggest you to change the program you use to encode your images, because it's 1000 bytes, while with my program the same 256 colors image needs just 278 bytes:

Re: docpicture

2008-10-14 Thread Aaron Castironpi Brady
(base64) and str.decode(base64), you don't need to import modules. Bye, bearophile +.5 docpicture. For encoding, it might read in from a file, try multiple different formats, including SVG, and uses whichever one is shortest. It might be nice, if they take too many lines, to store them

Re: docpicture

2008-10-14 Thread bearophileHUGS
André: A more complete example is now available at http://code.activestate.com/recipes/576538/ Nice. The idea for this recipe was mentioned on the Python mailing list as something desirable and apparently done by someone That someone has a nickname you can use, I am known in the cookbook

docpicture

2008-10-13 Thread bearophileHUGS
In Python code that processes some geometrical data I want to explain what each variable like w1, w2, h2, h3, etc, means in the geometrical objects. In such situation I don't use longer and more clear variable names because in geometry I'm used to use short vertex/line/length names, finding them

Re: docpicture

2008-10-13 Thread Steven D'Aprano
that often enough, so I think it doesn't deserve to become supported by Python itself. I can't imagine Python having direct syntactic support for it, but I don't see any reason why the standard library couldn't some day grow a docpicture module, complete with a tiny (?) Tkinter app to display

Re: docpicture

2008-10-13 Thread skip
Steven I can't imagine Python having direct syntactic support for it, Steven but I don't see any reason why the standard library couldn't Steven some day grow a docpicture module, complete with a tiny (?) Steven Tkinter app to display the diagram when requested. Heck, if you go

Re: docpicture

2008-10-13 Thread Benjamin Kaplan
On Mon, Oct 13, 2008 at 1:43 PM, [EMAIL PROTECTED] wrote: Steven I can't imagine Python having direct syntactic support for it, Steven but I don't see any reason why the standard library couldn't Steven some day grow a docpicture module, complete with a tiny (?) Steven Tkinter

Re: docpicture

2008-10-13 Thread skip
Benjamin So, the IDEs will support it. what happens when you run the Benjamin interpreter from the command line? Probably get ignored. What else would you propose? It's not executable code anyway, just a special comment or portion of a docstring. S --

Re: docpicture

2008-10-13 Thread Benjamin Kaplan
On Mon, Oct 13, 2008 at 2:48 PM, Joe Strout [EMAIL PROTECTED] wrote: On Oct 13, 2008, at 12:09 PM, Benjamin Kaplan wrote: Heck, if you go to the point of including a docpicture module, might as well just support the feature in IDLE... Other IDEs would probably pick up the feature as well

Re: docpicture

2008-10-13 Thread Joe Strout
On Oct 13, 2008, at 2:43 PM, Benjamin Kaplan wrote: I mean what happens when you type help() into the interactive console on the command line? You will see the docstrings, and there will be a whole bunch of random hex characters there. Good point. It might be better put in a

Re: docpicture

2008-10-13 Thread skip
Nothing. It's just a doc string containing a bunch of hex codes. Doc strings are ignored by the interpreter (AIUI). Benjamin I mean what happens when you type help() into the interactive Benjamin console on the command line? You will see the docstrings, and Benjamin there

Re: docpicture

2008-10-13 Thread Steven D'Aprano
labeled few lines of hex: Help on function spam: spam(...) spam spam spam spam spam spam spam spam spam spam with a fried egg on top === begin docpicture === 1234567890ABCDEF 1234567890ABCDEF 1234567890ABCDEF 1234567890ABCDEF === end docpicture === Or similar