Re: For new Leo users / Tagged topics in this forum / useful resource

2016-02-04 Thread reinhard . engel . de
Got it. Thank you! Reinhard On Wednesday, February 3, 2016 at 6:24:31 PM UTC+1, Chris George wrote: > > It is visible when you are on the front page of the group, but vanishes > when you are reading an individual posting. > > Chris > > On Tuesday, February 2, 2016 at 10:22:45 PM UTC-8, >

Re: For new Leo users / Tagged topics in this forum / useful resource

2016-02-02 Thread reinhard . engel . de
Thanks for the tip, but I don't see a 'Tags Members About' toolbar. Reinhard On Tuesday, February 2, 2016 at 9:39:36 PM UTC+1, Richard Andersen wrote: > > I'm guessing the Leo veterans already utilize the tagging in this forum, > but I wanted to take a moment to mention it to others who may

Re: Running a Qt application with Ctrl-B

2015-08-25 Thread reinhard . engel . de
@Terry and Edward Thank you both for your detailed answers! I tried both methods, and both work like a charm. Reinhard -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from this group and stop receiving emails from it, send

Re: Wrap around search/replace in the Find tab

2015-08-25 Thread reinhard . engel . de
On Tuesday, August 25, 2015 at 5:19:47 PM UTC+2, Edward K. Ream wrote: On Mon, Aug 24, 2015 at 8:56 AM, reinhard...@googlemail.com javascript: wrote: ... would be a nice feature. ​Please file a wishlist bug at https://github.com/leo-editor/leo-editor/issues. Sorry, I thought I

Running a Qt application with Ctrl-B

2015-08-25 Thread reinhard . engel . de
May be this is a stupid question: I'm trying to import a large Qt application into Leo. For testing, I created a script in a single node with the headline '@clean QtTest.pyw)' and the following body: @language python @tabwidth -4 import sys from PyQt5.QtCore import QObject from

Re: pyw as extension for @clean imports

2015-08-25 Thread reinhard . engel . de
Thank you! I added the '.pyw' extension to the extensions list in the Python importer. Everything works fine now. Reinhard -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from this group and stop receiving emails from it, send an

Wrap around search/replace in the Find tab

2015-08-24 Thread reinhard . engel . de
... would be a nice feature. Reinhard -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to

Find tab: forward wrapping does not work

2015-08-24 Thread reinhard . engel . de
When searching forward (F3) in the Find tab, the search stops at the last found item: 'not found (wrapping)'. -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from this group and stop receiving emails from it, send an email to

pyw as extension for @clean imports

2015-08-24 Thread reinhard . engel . de
May I suggest to use not only 'py' but also 'pyw' as default extension for @clean imports of Python files. Reinhard -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from this group and stop receiving emails from it, send an email

Re: Does @clean go too far?

2015-08-21 Thread reinhard . engel . de
How much more informative if instead it could become something like #*** Imports and magic import mypackage my_magic_number = 42 #*** class definition class A(object): #*** *** method 1 def method1(self): pass # description of aims of method #*** *** method 2

Re: Leo's future

2015-07-30 Thread reinhard . engel . de
Perception becomes almost as important as function. May I add: Function that isn't perceived, does not exist! Reinhard -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from this group and stop receiving emails from it, send

Re: Leo's future

2015-07-30 Thread reinhard . engel . de
An excellent suggestion is to reach out to magazine editors, get them excited... How? Speaking of marketing: First impressions count! So: Update the documentation. I.E.: Searching for '@clean' from the homepage of Leo gives: 'Your search did not match any documents' The user

Re: The new beautifier is complete unobtrusive with just one setting

2015-06-03 Thread reinhard . engel . de
I guess, we have different concepts of what means 'to beautify code'. Instead, just change ''' to as you like. How hard is that? Well, it's not about using ''' vs. . Among other things, for me to beaitify code code also means to take care of the consistency in naming and writing

Re: The new beautifier is complete unobtrusive with just one setting

2015-06-01 Thread reinhard . engel . de
How about string quotes, especially for doc strings? PEP8 states: For triple-quoted strings, always use double quote characters to be consistent with the docstring convention in PEP 257 http://legacy.python.org/dev/peps/pep-0257. Reinhard -- You received this message because you are

Re: x,y coordinates of text cursor in body

2015-05-31 Thread reinhard . engel . de
Your'e welcome! Didn't know someone else was following my postings...:) Reinhard On Sunday, May 31, 2015 at 1:46:55 PM UTC+2, john lunzer wrote: BTW, thank you Reinhard for getting me moving in the right direction. Knowledgeable as always :) -- You received this message because you are

Re: x,y coordinates of text cursor in body

2015-05-30 Thread reinhard . engel . de
Since Leo works with PyQT/Qt, a look there might help, i.e. http://www.qtcentre.org/threads/3073-How-to-get-mouse-s-position Reinhard On Saturday, May 30, 2015 at 3:20:03 PM UTC+2, john lunzer wrote: c.frame.body.widget.cursorRect() will give you the location of the cursor relative to the

Re: Better @g.command decorator

2015-05-18 Thread reinhard . engel . de
Maybe you should using different decorators. No, it doesn't work. In ​leo/commands/helpCommands I replaced:​ def cmd(name): '''Command decorator for the helpCommands class.''' return g.new_cmd_decorator(name,['c','helpCommands',]) with cmd = g.cmd where g.cmd is defined as you

Re: Better @g.command decorator

2015-05-17 Thread reinhard . engel . de
Forget the decorator! I'm not sure what you try to accomplish. Your publicCommands tables in Leo already associate command_names with functions or methods, so you don't need a decorator for that. As you told Terry (somewhere above) you need to retrieve the information if you need a 'self'

Re: Rev 9f3856f cleans lots of command code

2015-05-16 Thread reinhard . engel . de
Who wants to define *two *wrappers in the same decorator? Just to be clear, this whole discussion is moot because the following works: @cmd('clone-find-all') @cmd('find-clone-all') And a good thing too, because I seen *no way* to define *two *wrappers in the same decorator. And even if

Re: Better @g.command decorator

2015-05-16 Thread reinhard . engel . de
There is no need to 'compute' the class, because the class is stored in the decorator, wenn the command is created. I post my code from the other thread here again. When Leo sees a command, it looks up the wrapper in the dict and simply calls the wrapper with an event arg. The *wrapper

Re: Rev 9f3856f cleans lots of command code

2015-05-16 Thread reinhard . engel . de
In particular, only the AbbrevCommands class needs a finishCreate method. For your next work: Aren't abbreviations just synonyms that could go into the @cmd definition: @cmd('clone-find-all','find-clone-all', 'cfa', 'fca') Reinhard -- You received this message because you are subscribed

Re: Double decorators define command synonyms

2015-05-16 Thread reinhard . engel . de
A caveat: Each additional decorator adds an additional wrapper code to your code base. If over-used this way, you get a lot more code (not visible during programming but there none the less.) Reinhard -- You received this message because you are subscribed to the Google Groups leo-editor

Re: Rev 9f3856f cleans lots of command code

2015-05-16 Thread reinhard . engel . de
- Decorators will allow a list of command names: @cmd(['clone-find-all','find-clone-all']) May I suggest not to use the list notation but instead just @cmd('clone-find-all','find-clone-all') The '*args' (or more aptly named '*command_names') parameter in the function definition of 'cmd'

Re: Rev 9f3856f cleans lots of command code

2015-05-16 Thread reinhard . engel . de
See my comment ('No class needed') in thread 'Better @g.command.decorator' where you are still struggling with the problem. Reinhard I'm not sure it's worth doing, but it's good to know. -- You received this message because you are subscribed to the Google Groups leo-editor group. To

Re: Better @g.command decorator

2015-05-14 Thread reinhard . engel . de
So it looks like we're stuck. Any ideas? This works for both Python2 and Python3: from functools import wraps isPython3 = True def cmd(command_name): def inner_cmd(func): @wraps(func) def _decorator(*args, **kwargs): type0 = args and str(type(args[0])) or

Re: Better @g.command decorator

2015-05-14 Thread reinhard . engel . de
So it looks like we're stuck. Any ideas? Apart from using a sophisticated decorator you could just pass the class name as an optional parameter in @cmd(command_name, class_name=None) I'm no expert here, but this would require about 150 changes in the Leo code base and could be done by a

Re: Better @g.command decorator

2015-05-13 Thread reinhard . engel . de
It's even easier: You don't need a class decorator but can retrieve the class nam from th decorator's __dict__: commands_dict = {} ivars_dict = {} # Use as function/method decorator def cmd(command_name): class Decorator: def __init__(self, func): self.func = func

Re: Better @g.command decorator

2015-05-13 Thread reinhard . engel . de
Instead of using per plass decorators you might use a class decorator that enhances the function/method decorators with the class name: commands_dict = {} ivars_dict = {} # Use as function/method decorator def cmd(command_name): class Decorator: def __init__(self, func):

Re: Better @g.command decorator

2015-05-09 Thread reinhard . engel . de
​ This works without static/class methods and is a little less involved: ​A nice idea, but __qualname__ is Python 3 only. The main point is to tell a function from a method. If you don't want to use __qualname__ one might use the inspect module. But assuming the Python convention to name

Re: Better @g.command decorator

2015-05-09 Thread reinhard . engel . de
I would *much *rather do this than use class methods anywhere in Leo. YMMV, but you have little chance of changing my mind. Yes, there is a bit more code involved, but it is completely encapsulated. In contrast, static/class methods have global consequences. I'm not going there.

Re: Better @g.command decorator

2015-05-08 Thread reinhard . engel . de
*A two-level solution* Rather than using a single command-decorator, we must use separate decorators for each defining class: commands_dict = {} class TestClass: def cmd(name): def _decorator(func): commands_dict[name]= func ivars_dict[name] =

Re: Better @g.command decorator

2015-05-08 Thread reinhard . engel . de
In the 5th edition of 'Learning Python', pages 1289ff, Mark Lutz discusses extensively solutions for decorators that work on *both *simple functions and class-level methods (with passing instances!). Reinhard -- You received this message because you are subscribed to the Google Groups

Re: Leo 5.1-final released

2015-04-17 Thread reinhard . engel . de
When installing Leo I get a couple of syntax errors mainly related to Python 3, i.e in the print command because of missing '()' or the except command because of missing 'as: print message instead of print(message) or except OSError, e instead of except OSError as e These errors are

Re: Aha: how to organize data so we can find stuff

2015-04-17 Thread reinhard . engel . de
I'll continue to use clones. For example, when working on a to-do item I almost always clone it so it is ready to hand. However, the recent Aha's show (to my satisfaction) that clones should not be used in creating an initial organization of any kind of data. This is quite a surprise

Re: Aha: how to organize data so we can find stuff

2015-04-17 Thread reinhard . engel . de
I just wondered, because you were talking about 'any kind of data'. Anyway, thanks for the new version! Reinhard -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: @clean is more important than we think :-)

2015-02-24 Thread reinhard . engel . de
Thanks for the clarification! Did you try this on Leo itself, having some hundreds of thousands of lines in one Leo file? ​No, because we aren't going to use @clean for Leo.​ ​I tried it on a significant project: pylint. Loading a single .leo is fast, regardless of size. I

Re: Any reason to keep @auto or @shadow?

2015-02-23 Thread reinhard . engel . de
Well, I was suggesting to use '@clean' instead of '@plain', to avoid the association to 'dirty' or 'changed'. On Saturday, February 21, 2015 at 12:21:33 PM UTC+1, Edward K. Ream wrote: On Sat, Feb 21, 2015 at 3:21 AM, reinhard...@googlemail.com javascript: wrote: Before you go for

Re: @clean is more important than we think :-)

2015-02-23 Thread reinhard . engel . de
??? 3. A minor advantage: @file makes Leo files smaller. *Leo stores the entire @clean *tree* in the .leo file*, but only stores the top-level @file *node* in the .leo file. Does this mean to keep alle the files of an entire project in *one* Leo file? Did you try this on Leo itself,

Re: Any reason to keep @auto or @shadow?

2015-02-21 Thread reinhard . engel . de
Before you go for '@clean' you might consider '@plain' instead. '@clean' immediately makes me think of its contrary: '@dirty'. What would be the alternative to a '@clean' file? Reinhard On Friday, February 20, 2015 at 12:20:51 PM UTC+1, Edward K. Ream wrote: On Fri, Feb 20, 2015 at

Re: User friendliness. Will it ever be a priority?

2015-02-03 Thread reinhard . engel . de
​I am not aware that F2 has any standard meaning concerning outlines.​ Just check the Windows Explorer where you can edit items in the tree view as well in the list view by pressing F2. Reinhard -- You received this message because you are subscribed to the Google Groups leo-editor

Re: User friendliness. Will it ever be a priority?

2015-02-03 Thread reinhard . engel . de
On Monday, February 2, 2015 at 7:59:34 PM UTC+1, Dufriz wrote: ... but on second thoughts I no longer know if it's worth it. It isn't. Just study the history of similar attempts on this forum. Even really, really simple changes of concepts that might alienate newbies are not implemented

Re: Running Leo and IPython

2015-01-13 Thread reinhard . engel . de
Thanks! This belongs into the documentation. Reinhard -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this

Running Leo and IPython (Addendum)

2015-01-10 Thread reinhard . engel . de
If I use (two '--' !) python launchLeo.py --ipython I get zmq.error.ZMQError: permission denied can not init leo.cor.leoIPython.py Reinhard -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from this group and stop receiving

Running Leo and IPython

2015-01-10 Thread reinhard . engel . de
How do I run Leo and IPython? The documentation says: run Leo in a console window http://leoeditor.com/installing.html#running-leo-from-a-console-window with the –ipython command-line option enabled I tried python launchLeo.py -ipython python launchLeo.py -ipython python launchLeo.py

Re: Is @auto broken?

2014-12-13 Thread reinhard . engel . de
Yes, I used 'LeoSetup-5.0.final.exe' as of 2014-11-24. On Saturday, December 13, 2014 3:39:57 PM UTC+1, Edward K. Ream wrote: On Fri, Dec 12, 2014 at 2:08 PM, reinhard...@googlemail.com javascript: wrote: Leo Log Window Leo 5.0-final, build 20141124101406, Mon Nov 24 10:14:06 CST 2014

Re: Is @auto broken?

2014-12-13 Thread reinhard . engel . de
https://lh3.googleusercontent.com/-SuyVRGxaOgs/VIxloM52OQI/AEo/v7DwCYgmfjg/s1600/SyntaxErros.png Installing Leo, using the latest (as of today) 'leo-editor-master.zip' from Github gives a lot syntax errors (see attached file) which seem to be related to Python 3 syntax. If I just

Re: Is @auto broken?

2014-12-13 Thread reinhard . engel . de
If I use the full path in the head of the node @auto D:\Benutzer\Reinhard\mycode.py (German Windows!) everything works as expected. If I use @auto D:\User\Reinhard\mycode.py I get an 'not found' error. How is the full path formed, when I use only @auto mycode.py without any path

Is @auto broken?

2014-12-12 Thread reinhard . engel . de
I have the following very simple file named mycode.py in my working directory: #!/usr/bin/python # -*- coding: utf-8 -*- def p1(): print(Hello world!) def p2(): print(Hello World, again!) if __name__ == __main__: p1() p2() Of course this file works fine when run with

Bug in leoGlobals.py, function 'pause'

2014-11-27 Thread reinhard . engel . de
Sorry, I'm just looking at the new code... There is no function 'long' in Python3. -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from this group and stop receiving emails from it, send an email to

PyQt5 and file ../plugins/qt_main.py

2014-11-27 Thread reinhard . engel . de
# For PyQt5, this block: #QObject.connect(self.leo_spell_btn_Add, SIGNAL(clicked()), MainWindow.do_leo_spell_btn_Add) #QObject.connect(self.leo_spell_btn_Change, SIGNAL(clicked()), MainWindow.do_leo_spell_btn_Change) #QObject.connect(self.leo_spell_btn_Find, SIGNAL(clicked()),

Re: Maybe exclude quickstart.leo from the final release

2014-11-20 Thread reinhard . engel . de
On Thursday, November 20, 2014 6:16:46 PM UTC+1, Edward K. Ream wrote: On Wed, Nov 19, 2014 at 1:02 PM, reinhard...@googlemail.com javascript: wrote: Do I have to clean up everything manually? ​Yes, but you ​can use file-delete to delete any file by name. After choosing 'Edit

Re: Maybe exclude quickstart.leo from the final release

2014-11-20 Thread reinhard . engel . de
On Thursday, November 20, 2014 6:42:54 PM UTC+1, Edward K. Ream wrote: On Thu, Nov 20, 2014 at 11:17 AM, Matt Wilkie map...@gmail.com javascript: wrote: Why on earth should Leo put notepad in the Open With menu? In the tradition of 5 whys http://en.wikipedia.org/wiki/5_Whys:

Re: Maybe exclude quickstart.leo from the final release

2014-11-20 Thread reinhard . engel . de
​Amusing. But to repeat, afaik, Leo does *not* offer notepad as a default anywhere. In other words, I thought I was wrong, but I wasn't... :-) Well, it does, in a context-menu of 'quickstart.leo'. Reinhard -- You received this message because you are subscribed to the Google Groups

Re: Maybe exclude quickstart.leo from the final release

2014-11-20 Thread reinhard . engel . de
On Thursday, November 20, 2014 9:52:19 PM UTC+1, Edward K. Ream wrote: On Thu, Nov 20, 2014 at 12:42 PM, reinhard...@googlemail.com javascript: wrote: ​Amusing. But to repeat, afaik, Leo does *not* offer notepad as a default anywhere. In other words, I thought I was wrong, but I

Fields in status line are not input fields

2014-11-19 Thread reinhard . engel . de
I just tried out Leo5.0-b2. May I suggest to change the fields in the status line (below the minibuffer) into labels, because they are not input fields (or are they?) -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from this

Fields in status line are not input fields

2014-11-19 Thread reinhard . engel . de
I just tried out Leo5.0-b2. May I suggest that the fields in the status line below the minibuffer are *not styled as input fields*, because they are not (or are they?). Simple labels would do. -- You received this message because you are subscribed to the Google Groups leo-editor group. To

Leo5.0-b2 - which Python?

2014-11-19 Thread reinhard . engel . de
On my machine, I've installed Python 2.7 and Python 3.4 in parallel, 3.4 being the default when calling 'python' in the Explorer. But the installation routine of Leo5.0-b2 picks up and suggests Python 2.7 during installation as the Python to install. Why? -- You received this message because

Installing Leo5.0-b2 in parallel

2014-11-19 Thread reinhard . engel . de
When installing Leo5.0-b2, it automatically picks-up my settings from my Leo4.x version. That's ok. But I would appreciate the option to install the new version in parallel to the old version *without* using my old settings. Is this possible? -- You received this message because you are

Re: Installing Leo5.0-b2 in parallel

2014-11-19 Thread reinhard . engel . de
Thanks Terry, guess, I have to change the leoSettings.leo file. I prefer to keep all my settings close to my installation directories (and not in my home directory). Reinhard -- You received this message because you are subscribed to the Google Groups leo-editor group. To unsubscribe from

Maybe exclude quickstart.leo from the final release

2014-11-19 Thread reinhard . engel . de
After installing Leo5.0-b2 on my Windows 8 machine I was just playing around with 'quickstart.leo'. Here are just two remarks after following the tutorial for only five minutes: The way this tutorial is structured (with '@path ~'), the examples clutter my home directory with files I don't

Re: Maybe exclude quickstart.leo from the final release

2014-11-19 Thread reinhard . engel . de
​It's notepad that you shouldn't trust. Try using an editor that can handle linux line breaks intelligently. I recommend scite: http://www.scintilla.org/SciTE.html You'll never use notepad again :-) Well, that's the editor that is mentioned in the first command of the context menu,

Re: Maybe exclude quickstart.leo from the final release

2014-11-19 Thread reinhard . engel . de
​This will only happen if you actually create the files by changing one of the @@file nodes to a live @file node.​ I was just follwing what the tutorial suggests. ​If you created the file, it's up to you to deal with it.​ Of course! Perhaps the @path node is confusing, but you have

Re: Leo5.0-b2 - which Python?

2014-11-19 Thread reinhard . engel . de
On Wednesday, November 19, 2014 11:26:57 PM UTC+1, Matt Wilkie wrote: Don't know the answer the why question, but just to be clear, you're on Windows right? On Wed, Nov 19, 2014 at 9:16 AM, reinhard...@googlemail.com javascript: wrote: On my machine, I've installed Python 2.7 and