Re: The screenshots plugin is ready

2010-10-05 Thread Edward K. Ream
On Oct 4, 5:42 pm, Edward K. Ream edream...@gmail.com wrote:

 I expect to be creating real slide shows for Leo's web site later
 tonight.

This morning I created a real slideshow.  This brought to light some
interesting sphinx build issues.  How do we get sphinx to create the
slideshows the way we want?  In particular, how do we get the links we
want between pages?

The great divide is this:  Are slideshows (collections of html slides)
to be part of Leo's Users Guide, or not?

To state my conclusion first: making slideshows be part of the Users
Guide has some advantages, but not enough.  The proper principle is:
slideshows should be separate from Leo's Users Guide.

Making a slideshow be part of Leo's Guide is easy.  Suppose the
slideshow is in the folder my-slide-show and consists of slides my-
slide-show-001 through my-slide-show-N.  In leo_toc_html_text we
simply add::

   my-slide-show/my-slide-show-*

after the entry for 'slides'.  This makes all the slides follow the
'slides' page.  It has the further advantage that sphinx's make
operation will automatically make all slides of the slide show.

Alas, this scheme has a big disadvantage: the links are wrong:

1. The 'next' link of the slides chapter should link to the next
chapter in the Users Guide, *not* to my-slide-show-001.

2. The 'next' link of the last slide, say my-slide-show-005, should be
empty, or refer back to to the 'slides' chapter.  But in this
scheme, it would refer either to the chapter after the 'slides'
chapter, or, if there is another slide show, to the first slide of the
next slide show.

3. Similarly, the 'prev' links of the first slide of each slideshow
would be wrong.  They should either be empty or refer to the 'slides'
chapter.

4. A link to a slideshow from Leo's home page would land the user into
confusion: that is, smack in the middle of Leo's Users Guide.

Instead, I'll adopt the rule that slideshows are distinct entities:

- There will be no 'prev' link in the first slide, and no 'next' link
in the last slide.

- The 'slides' chapter will link to each slideshow 'by hand', just as
Leo's home page will.

We could imaging a fixup script that patches prev and next links in
slideshows.  This would be straightforward to write, but the problem
is remembering to run after each sphinx make.  That is, the patches
must be made to the .html files in the leo/doc/html/slideshow-name/
_build/html folder.

As I write this I realize that it would be possible to run this fixup
script from the makefile itself.  Before going further, I'll
investigate to see how easy this would be.

Edward

P.S.  Yes, the title of this thread is becoming something of a
joke :-)

EKR

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To post to this group, send email to leo-edi...@googlegroups.com.
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.



Re: The screenshots plugin is ready

2010-10-05 Thread Edward K. Ream
On Oct 5, 8:57 am, Edward K. Ream edream...@gmail.com wrote:

 As I write this I realize that it would be possible to run this fixup
 script from the makefile itself.

Yes.  Define fixdoc.py in leo\doc\html and in make.bat and makefile
add::

python -m fixdoc

after:

%SPHINXBUILD% -b html %ALLSPHINXOPTS% _build/html

in the html target.

Probably fixdoc.py should be told the names of the folders containing
slideshows.  And the name of the 'slides' slide.  It can take it from
there.

My *guess* is that fixdoc.py will be the simplest thing that could
possibly work, but only some experimentation will tell for sure.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To post to this group, send email to leo-edi...@googlegroups.com.
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.



Re: I'm ready to work with codewise now

2010-10-05 Thread Ville M. Vainio
On Mon, Oct 4, 2010 at 2:18 AM, Edward K. Ream edream...@gmail.com wrote:

 Perhaps the real value of my recent scanning work is that something
 has shifted inside my bean.  I am ready to accept ctags and Ville's
 codewise tool built upon it.

I'm glad you are seeing it now :). codewise approach is simpler to
understand and extend than some monolithic system inside leo's core.

The tricky part, now, is getting a good QCompleter imlpmentation
working with key events in Leo. The existing ones in
codewisecompleter.py and ctagscompleter.py requile mouse because of
bad key handling.



 Last night's experience using the prototype scanner code convinced me
 that using such a scheme would be pleasant.  For some reason, that
 experience was essential.

 Furthermore, all the object-related code in Leo's old autocompleter is
 gone, and this should clear the way for direct support for ctags and
 codewise.

 I did a search here (in leo-editor) for codewise using the Search
 this group button:

 http://groups.google.com/group/leo-editor/search?group=leo-editorq=codewiseqt_g=Search+this+group

 I had forgotten all about these discussions in December of last year.
 My aunt was dying about this time--perhaps this explains my total
 blank.  More likely, I simply didn't grasp the importance of the
 discussions.  Now I do.

 I'd like to add something to Terry's howto:  On Windows, at least,
 instead of doing:

    codewise command args

 it appears you must do:

    python -m codewise command args

 However, I'll omit the python -m in the following discussion.

 Also, it's possible to run the commands directly from Leo.  Like this:

    import codewise as cw
    cw.cmd_init(args=[])

 The following worked for me (from the command line):

    codewise setup
    codewise init
    codewise parse path to Leo's trunk

 However, the following (ambitious!) call failed:

    codewise parse c:\python31\Lib

 The traceback was:

 c:\leo.repo\trunkc:\Python31\python.exe -m codewise parse c:
 \python31\lib
 c:\Users\edreamleo/.codewise.db
 ctags -R --sort=no -f - c:\python31\lib
 Traceback (most recent call last):
  File c:\Python31\lib\runpy.py, line 128, in _run_module_as_main
    __main__, fname, loader, pkg_name)
  File c:\Python31\lib\runpy.py, line 34, in _run_code
    exec(code, run_globals)
  File c:\Python31\lib\site-packages\codewise.py, line 454, in
 module
    main()
  File c:\Python31\lib\site-packages\codewise.py, line 440, in main
    cmd_parse(args)
  File c:\Python31\lib\site-packages\codewise.py, line 370, in
 cmd_parse
    cw.parse(args)
  File c:\Python31\lib\site-packages\codewise.py, line 307, in parse
    self.feed_ctags(f)
  File c:\Python31\lib\site-packages\codewise.py, line 250, in
 feed_ctags
    fil = fields[1]
 IndexError: list index out of range

 I'm using the latest rev, rev 12.

 No doubt a fix will be forthcoming :-)  In any case, I am happy about
 the possibilities of this scheme.  We'll have to deal with the issues
 surrounding ctags: maybe we'll fall back on the prototype scheme if
 ctags does not exist.


I guess you should inspect why the ctags file doesn't have 4 fields
separated by tab for you (print fields would help there, below).

Also, a workaround:

def feed_ctags(self,tagsfile_obj):
for l in tagsfile_obj:
#print l
if not isPython3:
l = unicode(l, 'utf8', 'replace')
if l.startswith('!'):
continue
fields = l.split('\t')
if len(fields)  4: continue  # ADDED this
m = fields[0]
fil = fields[1]


-- 
Ville M. Vainio @@ Forum Nokia

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To post to this group, send email to leo-edi...@googlegroups.com.
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.



Re: The screenshots plugin is ready

2010-10-05 Thread Edward K. Ream
On Tue, Oct 5, 2010 at 9:26 AM, Edward K. Ream edream...@gmail.com wrote:

 My *guess* is that fixdoc.py will be the simplest thing that could
 possibly work, but only some experimentation will tell for sure.

Testing fixdoc is very easy, so I think I'll go with this.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To post to this group, send email to leo-edi...@googlegroups.com.
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.



how can I change the setting of leo to show the line number in the bodypane??

2010-10-05 Thread softside
I have been using leo for just a few weeks , this problem has confused
me for a long time.
so ,any one can help me ??

thanks ..

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To post to this group, send email to leo-edi...@googlegroups.com.
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.



Re: corrupted leo file?

2010-10-05 Thread Todd Mars

 OT: It amazes me that an OS which actually calls itself Windows ships with 
 a window manager which buries critical dialogs under all the other windows.  
 And that this *still* happens in Windows 7.  It's been saying 'Please wait, 
 installing' for three hours... oh wait, there's a click to continue dialog 
 underneath the main installer window, with no entry on the task bar

Windows doesn't do that. The application (installer in this case) does
that.  The problem with Windows is they let developers specify the
properties of the dialogs, even critical ones. Oh, wait, the
application does not think it's Critical so it does not specify
Always On Top or whateverAnd should it be a modal dialog?...
Spider-man's uncle said with great power comes great responsibility.

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To post to this group, send email to leo-edi...@googlegroups.com.
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.



Re: Leo and Objective-C highlighting

2010-10-05 Thread Tyomalu
Still I can't find out why the syntax highlighting from objective_c.py
does not highlight those keywords automatically, everything seems to
be fine with it's code..

On 4 окт, 18:56, Edward K. Ream edream...@gmail.com wrote:
 On Mon, Oct 4, 2010 at 9:14 AM, Tyomalu tyoma...@gmail.com wrote:
  Is there any solution to interpret those symbols as keywords but not
  as Leo commands?

 The following script works.

 for z in ('interface','implementation','end'):
     if z not in g.globalDirectiveList:
         g.globalDirectiveList.append(z)

 c.frame.body.colorizer.highlighter.colorer.defineLeoKeywordsDict()

 You might want to make it a plugin so that it will automatically be
 run for each commander c.

 Edward
 --
 Edward K. Ream email: edream...@gmail.com
 Leo:http://webpages.charter.net/edreamleo/front.html
 --

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To post to this group, send email to leo-edi...@googlegroups.com.
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.



Re: The screenshots plugin is ready

2010-10-05 Thread Edward K. Ream


On Oct 5, 10:11 am, Edward K. Ream edream...@gmail.com wrote:
 On Tue, Oct 5, 2010 at 9:26 AM, Edward K. Ream edream...@gmail.com wrote:

  My *guess* is that fixdoc.py will be the simplest thing that could
  possibly work, but only some experimentation will tell for sure.

 Testing fixdoc is very easy, so I think I'll go with this.

A simplification.  After removing leo_toc.html and the makefiles from
the my-slide-show folder, a 'make clean' followed by a 'make html'
appears not to generate the 'prev' link in the first slide and the
'next' link of the last slide.

This is jolly.  It means that the fixdoc.py need only patch the 'next'
link of slides.html.  I could do it by hand, but I think it's best to
go with a script.  The script is almost ready...

EKR

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To post to this group, send email to leo-edi...@googlegroups.com.
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.



Re: The screenshots plugin is ready

2010-10-05 Thread Edward K. Ream


On Oct 5, 11:00 am, Edward K. Ream edream...@gmail.com wrote:

 A simplification.  After removing leo_toc.html and the makefiles from
 the my-slide-show folder, a 'make clean' followed by a 'make html'
 appears not to generate the 'prev' link in the first slide and the
 'next' link of the last slide.

 This is jolly.  It means that the fixdoc.py need only patch the 'next'
 link of slides.html.  I could do it by hand, but I think it's best to
 go with a script.  The script is almost ready...

No, it's not.  The problem is that most, but not all, of the
references to the slideshow should be removed.  I'm not eager to do
the required AI.

As a prototype, I just modified slides.html by hand.  There are still
issues to be resolved re the locations of files on Leo's web site.

Another idea would be to make the slides completely separate from
Leo's Users Guide.  This solves the problem with slides.html
completely--there will be separate sphinx makes for slides.  I'll play
with this next.  It will involve minor tweaks to the screenshot
plugin.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To post to this group, send email to leo-edi...@googlegroups.com.
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.



OT: window managers (was Re: corrupted leo file?)

2010-10-05 Thread Terry Brown
On Tue, 5 Oct 2010 08:35:40 -0700 (PDT)
Todd Mars tamn...@gmail.com wrote:

  OT: It amazes me that an OS which actually calls itself Windows ships 
  with a window manager which buries critical dialogs under all the other 
  windows.  And that this *still* happens in Windows 7.  It's been saying 
  'Please wait, installing' for three hours... oh wait, there's a click to 
  continue dialog underneath the main installer window, with no entry on the 
  task bar
   
 Windows doesn't do that. The application (installer in this case) does
 that.  The problem with Windows is they let developers specify the
 properties of the dialogs, even critical ones. Oh, wait, the
 application does not think it's Critical so it does not specify
 Always On Top or whateverAnd should it be a modal dialog?...
 Spider-man's uncle said with great power comes great responsibility.

Well, sure, it could be the software developer's fault.  It happened to me just 
a couple of days ago, when I was running Windows Update, and the EULA window 
for IE 8 was placed under the other Windows Update windows, by those pesky 
software developers not using the window manager properly :-}   And surely the 
default for a new window is 'initially on top' unless you go out of your way to 
bury it?

Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To post to this group, send email to leo-edi...@googlegroups.com.
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.



Re: how can I change the setting of leo to show the line number in the bodypane??

2010-10-05 Thread Edward K. Ream
On Tue, Oct 5, 2010 at 6:12 AM, softside thinkba...@gmail.com wrote:
 I have been using leo for just a few weeks , this problem has confused
 me for a long time.
 so ,any one can help me ??

The answer may depend on whether you are using Tk or Qt.  Which is it?

Edward

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To post to this group, send email to leo-edi...@googlegroups.com.
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.



Re: The screenshots plugin is ready

2010-10-05 Thread Edward K. Ream
On Tue, Oct 5, 2010 at 12:04 PM, Edward K. Ream edream...@gmail.com wrote:

 Another idea would be to make the slides completely separate from
 Leo's Users Guide.

After considerable experimentation I think I have a plan that will
work.  There will be a slides directory under the leo\doc\html
directory. The slides directory will contain a separate folder for
each slideshow.  Each slideshow folder will contain the following:

- All the actual slides, as .html.txt files.  For example:
my-first-slide-show-000.html.txt

- All related screenshots.

- The following build files:  conf.py, leo_toc.html.txt, make.bat
and Makefile and the Leo icon, Leo4-80-border.jpg.  These files allow
each screenshot to be built independently.  conf.py specifies the name
'leo_toc.html.txt'.  It might have a better name.

- The slides *chapter* links to the first slide of each slideshow by
hand.  For example, here is the contents of the chapter at present:

Q
##
Slides
##

This is the front page for various slide shows about Leo.

.. _`My first slide show`:
slides/my-first-slide-show/my-first-slide-show-001.html

`My first slide show`_
Q

With this organization, the following are all true:

- No patching is ever required for any built .html file.  That is,
each slideshow is completely independent of all others.

- Each slideshow contains an introductory slide, generated from
leo_toc.html.txt.

- Each slideshow can be build separately from any other slides.

- All slideshows can be made by doing make html in the leo\doc\html
directory.  Happily, no warning is given about there being no
references to the slideshows from Leo's Users Guide:  apparently the
references to the slides in the various subsidiary leo_toc.html.txt
files suffice.

- The by hand references in the built slides.html file to the first
slide of each slideshow works.  This is because the _build directory
in the leo\doc\html directory contains a mirror of all the subfolders
in the leo\doc\html directory.

All this required considerable noodling and messing around.  I think
it is likely the best that can be done.

Careful readers will already have discovered the main drawback, namely
that each slideshow folder must contain copies of the build files:
conf.py, leo_toc.html.txt, make.bat and Makefile and the Leo icon,
Leo4-80-border.jpg.

Actually, the make.bat and Makefile files are probably optional: but
we might as well throw them in so we can do separate makes.

The screenshot plugin (it really should be called the slideshow
plugin) should copy these files automatically.  As impatient as I am,
I think it would be best for the screenshot plugin  to do this.

It seems like we are finally nearing the end of the journey.  We shall see...

Edward

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To post to this group, send email to leo-edi...@googlegroups.com.
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.



Re: how can I change the setting of leo to show the line number in the bodypane??

2010-10-05 Thread softside

qt,

I am using the latest stable version

On 10月6日, 上午3时16分, Edward K. Ream edream...@gmail.com wrote:
 On Tue, Oct 5, 2010 at 6:12 AM, softside thinkba...@gmail.com wrote:
  I have been using leo for just a few weeks , this problem has confused
  me for a long time.
  so ,any one can help me ??

 The answer may depend on whether you are using Tk or Qt.  Which is it?

 Edward

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To post to this group, send email to leo-edi...@googlegroups.com.
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.



May I Flatter Leo?

2010-10-05 Thread Matt Wilkie
Hi Edward,

I'd like to contribute to Leo beyond the odd bug report and
suggestions for the docs. Courtesy of Raphael Hertzog[1] of debian
dpkg fame I've discovered a micropayment system which just might work,
www.flattr.com.

How it works: Flattr users pay a small monthly fee, at any level
(default is 2 euros a month). At the end of the month, that fee is
divided between all the things flattered. Clicking one more flattr
button doesn't add to the fee, just divides the fee between more
people.   Their angle: Flattr Inc. takes 10% of the revenue to those
being flattered. They've said they'd like to reduce the percentage as
they grow if they can (being a new idea, they've no idea what it will
actually cost to run the system yet).

Anyway, please consider it. :)

[1] http://raphaelhertzog.com/flattr-foss/

-- 
-matt

-- 
You received this message because you are subscribed to the Google Groups 
leo-editor group.
To post to this group, send email to leo-edi...@googlegroups.com.
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.