Re: Is it possible to add time in log pane?

2017-07-17 Thread Terry Brown
On Mon, 17 Jul 2017 16:07:36 -0500
"Edward K. Ream"  wrote:

> On Mon, Jul 17, 2017 at 3:42 PM, Terry Brown 
> wrote: ​
> > ​
> it would take up a bunch of scree
> ​n space.
> 
> How about reporting just the time of the save-file command or the
> write-all-at-file-node command?
> 
> Edward

Might be confusing if you end up with

12:23:45
wrote: base.py
wrote: test_views.py
saved: joyroost.leo
12:33:45
wrote: test_views.py
saved: joyroost.leo
12:43:45
wrote: test_views.py
saved: joyroost.leo
wrote: models.py
12:53:45

which time applies to which file?

What about a with_time kwarg for g.es() (or whatever it is) that could
be set True for the calls that write the 'wrote:' and 'saved:' lines,
if @bool log_show_save_time == True?  Easy to use for other things too
then.

i.e. it would print

07:31:20 wrote: base.py
07:31:20 wrote: test_views.py
07:31:20 saved: joyroost.leo
07:38:20 wrote: test_views.py
07:38:20 saved: joyroost.leo
07:42:18 wrote: test_views.py
07:42:18 saved: joyroost.leo

Cheers -Terry

-- 
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 leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Is it possible to add time in log pane?

2017-07-17 Thread zhaohe wang
I offten check files which be changed. Because I done the wrong thing that 
changed some contents before. And I can not get them back again.
If save files many times, it is not clear to see which file has been saved 
without time. Now I identify them by .leo file.
I hope to add time %H%M%S in log pane with save-file command.
Thanks a lot!

在 2017年7月18日星期二 UTC+8上午5:07:38,Edward K. Ream写道:
>
> On Mon, Jul 17, 2017 at 3:42 PM, Terry Brown  > wrote:
> ​
> > ​
> it would take up a bunch of scree
> ​n space.
>
> How about reporting just the time of the save-file command or the 
> write-all-at-file-node command?
>
> Edward
>

-- 
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 leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Is it possible to add time in log pane?

2017-07-17 Thread zhaohe wang
Maybe only display %H%M%S will not take many space.
I think that popup tool tip is not a good way because of not clear. And 
perhaps the user should move mouse on several texts.

在 2017年7月18日星期二 UTC+8上午4:42:32,Terry Brown写道:
>
> On Mon, 17 Jul 2017 13:32:03 -0700 (PDT) 
> zhaohe wang  wrote: 
>
> > I offten foget when I have saved some files. So if there are some 
> > time diplay in the log pane, I think it is so better. 
> > 
> > wrote: base.py 
> > wrote: test_views.py 
> > saved: joyroost.leo 
> > wrote: test_views.py 
> > saved: joyroost.leo 
> > wrote: test_views.py 
> > saved: joyroost.leowrote: models.py 
> > 
> > *for example:* 
> > 
> > 07:38:20 wrote: base.py 07:38:20 wrote: test_views.py 07:38:20 saved: 
> > joyroost.leo 07:38:20 wrote: test_views.py 07:38:20 saved: 
> > joyroost.leo 07:42:18 wrote: test_views.py 07:42:18 saved: 
> > joyroost.leowrote: models.py 
> > 
> > Is it possible to add time in log pane? Thanks! 
>
> Just an implementation question - it would take up a bunch of screen 
> space, of course it could be toggled with a @setting, but would it work 
> for you if the time was shown as a popup tool tip when hovering the 
> mouse over the text in the log pane? 
>
> Cheers -Terry 
>

-- 
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 leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Is it possible to add time in log pane?

2017-07-17 Thread Edward K. Ream
On Mon, Jul 17, 2017 at 3:42 PM, Terry Brown  wrote:
​
> ​
it would take up a bunch of scree
​n space.

How about reporting just the time of the save-file command or the
write-all-at-file-node command?

Edward

-- 
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 leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: How does instant update work in Pharo?

2017-07-17 Thread Edward K. Ream
On Mon, Jul 17, 2017 at 12:32 PM, Edward K. Ream 
wrote:

*​> ​4. Run the test, edit, repeat*

​> ​
After creating the dev node you simply run the dev script until everything
works :-)  The details depend on the code being developed.  Otoh, we can
safely assume that devs can handle problems as they arise.

​This last sentence hides a lot, but there seems to be nothing more to be
said.  We are, after all, talking about a *general *framework for code
reloading...​


​Otoh, this topic does relate to #511: reload-leo command
​
​. In this context I'd like to be as specific as possible.

As a first observation, the following code crashes Leo.  It's not a hard
crash, but Leo does exit, *despite the try/except block*:

import imp
import sys
import traceback
import leo.core.leoGlobals as g
try: # This crashes Leo, despite the try/except!
imp.reload(g)
except Exception:
typ, val, tb = sys.exc_info()
lines = traceback.format_exception(typ, val, tb)
print(lines)

The crash happens in c.executeScriptHelper, outside of any try/except
block.  Indeed, the try/except block above exists only in the exec
statement in c.executeScriptHelper.
​
​  It is gone by the time the actual crash happens.​


​Without going into details, the call to imp.reload(g) has thoroughly
messed up Leo's run-time environment.  In particular, g.app becomes None.

Imo this is *not* a real bug in c.executeScriptHelper, or leoGlobals.py or
anywhere else.  It just means that one dasn't reload the leoGlobals module,
at least not until we have a more robust init scheme.

And good luck with that.  Initing the leoGlobals module, and g.app, takes
place very early, but despite (or because of) that it is very tricky.

This post has strayed far from the previous post, but it shows that there
is no way to describe all the myriad complexities that might befall people
using dev nodes.  Despite that, dev nodes can be extremely useful.

Edward

-- 
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 leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Is it possible to add time in log pane?

2017-07-17 Thread Terry Brown
On Mon, 17 Jul 2017 13:32:03 -0700 (PDT)
zhaohe wang  wrote:

> I offten foget when I have saved some files. So if there are some
> time diplay in the log pane, I think it is so better.
> 
> wrote: base.py
> wrote: test_views.py
> saved: joyroost.leo
> wrote: test_views.py
> saved: joyroost.leo
> wrote: test_views.py
> saved: joyroost.leowrote: models.py
> 
> *for example:*
> 
> 07:38:20 wrote: base.py 07:38:20 wrote: test_views.py 07:38:20 saved: 
> joyroost.leo 07:38:20 wrote: test_views.py 07:38:20 saved:
> joyroost.leo 07:42:18 wrote: test_views.py 07:42:18 saved:
> joyroost.leowrote: models.py
> 
> Is it possible to add time in log pane? Thanks!

Just an implementation question - it would take up a bunch of screen
space, of course it could be toggled with a @setting, but would it work
for you if the time was shown as a popup tool tip when hovering the
mouse over the text in the log pane?

Cheers -Terry

-- 
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 leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Is it possible to add time in log pane?

2017-07-17 Thread zhaohe wang
I offten foget when I have saved some files. So if there are some time 
diplay in the log pane, I think it is so better.


wrote: base.py
wrote: test_views.py
saved: joyroost.leo
wrote: test_views.py
saved: joyroost.leo
wrote: test_views.py
saved: joyroost.leowrote: models.py


*for example:*

07:38:20 wrote: base.py 07:38:20 wrote: test_views.py 07:38:20 saved: 
joyroost.leo 07:38:20 wrote: test_views.py 07:38:20 saved: joyroost.leo 
07:42:18 wrote: test_views.py 07:42:18 saved: joyroost.leowrote: models.py


Is it possible to add time in log pane? Thanks!

-- 
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 leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: New backend for Leo Cacher

2017-07-17 Thread vitalije
Fixed at 8d6a7ab. My fault, sorry about that. Recently, I have switched to 
Python3, and now I am making Python2 crashers. 

Vitalije

-- 
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 leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: How does instant update work in Pharo?

2017-07-17 Thread Edward K. Ream
On Sunday, July 16, 2017 at 10:24:51 AM UTC-5, Edward K. Ream wrote:

> > developing with @button or @test already simulates instant reload 
pretty well.
> Today, right now, Leo devs and script writers can develop python code *more 
*easily in Leo than in SmallTalk.

After more thought, the first statement seems more accurate :-)  Leo and 
SmallTalk each have their own advantages.

Here are step-by-step instructions for developing code in Leo without 
having to reload Leo.

*tl;dr:* Read the summary.  But devs should consider reading all of this 
carefully ;-)

*1. Create a dev node*

This node (in the Leo outline) defines your development environment.  This 
can be an @test node, an @button node, or an @command node. Using a plain 
outline node would be less convenient because you won't be able to execute 
it so easily.

The *dev script* is the script in the dev node itself.  The *code under 
development *is the code exercised by the dev script.

*This is (by far) the most important step!* Once you say to yourself, "Ok, 
I'm going to be clever and develop my code using the Stupendous Aha 
",
 
everything else in this post is going to happen naturally.  It may not 
always be easy, but the programming process itself will lead you to the 
next action.  Otoh, If you *don't* create a custom dev environment you will 
have to reload Leo to test your new code. That will be much slower.

*2. Set up your dev node so you can execute it quickly*

There are several ways to run your dev script easily:

- Use a marked @test node and use run-marked-unit-tests-locally.
- Disable or ignore all other @test nodes and then use 
run-all-unit-tests-locally.
- Bind a keystroke to an @button or @command node.
- Run an @button or @command node the first time from the minibuffer, and 
thereafter re-execute it with Ctrl-P (repeat-complex-command.

Choose any way you like. What matters is being able to run your dev script 
with a single keystroke.



*2. Define or access the code under development*There are two main ways to 
do this:

A.  Define the code as (possibly cloned) children of the dev node, and 
access the code using @others in the top-level node.

B. Import a module. *Important*: typically your dev script will use 
imp.reload to ensure that imported module is up-to-date.

*3. Create new instances of objects*

You *must not *use existing Leo objects when testing Leo code.  This 
includes *all* objects accessible via c, g and p, either directly or 
indirectly.  For example, you must not use c, c.frame, c.frame.body, etc., 
etc., even if you have reloaded all of Leo's modules!

You can, however, use any Leo code when developing *other* (unmodified) 
code.  

You will seldom need to worry about reloading code if you use @others to 
define the code under test.

*4. Run the test, edit, repeat*

After creating the dev node you simply run the dev script until everything 
works :-)  The details depend on the code being developed.  Otoh, we can 
safely assume that devs can handle problems as they arise.

*Summary*

@test, @command or @button can be thought of as defining an (almost) 
pristine dev environment. This is another way of describing the Stupendous 
Aha.

Dev scripts should create a new, pristine environment every time it they 
are executed, using imp.reload as needed. Dev scripts should always create *new 
*objects for testing.  Dev scripts may use Leo's core objects provided they 
have not been modified.

SmallTalk does most of this automagically.  However, dev scripts have their 
own advantages:

- Dev scripts can access code using clones.
- Dev scripts can use outlines to organize the code under development.
- Dev scripts form a permanent record of completed work.
- Dev scripts can morph into unit tests.
- Dev scripts work for Python!

Dev scripts bring most of the advantages of SmallTalk to Leo. The initial 
cost of creating dev nodes pays off immediately.

All comments welcome.

Edward

-- 
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 leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: New backend for Leo Cacher

2017-07-17 Thread Terry Brown
I got

setting leoID from os.getenv('USER'): 'tbrown'
reading settings in 
/mnt/usr1/usr1_t/Package/leo/git/leo-editor/leo/config/leoSettings.leo
reading settings in /home/tbrown/.leo/myLeoSettings.leo

Leo 5.5, build 20170715081418, Sat Jul 15 08:14:18 CDT 2017
Git repo info: branch = master, commit = 14f589b8e8a3
Python 2.7.12, PyQt version 5.5.1
linux2
** isPython3: False
** caching enabled

sftp.py: can not import paramiko
reading settings in /mnt/edata/edata/edata.leo
redefining abbreviation html;;
from 
u'\n\n<|title|>\n\n\n\n\n<|content|>\n\n'
 to u'\n\n\n\n\n\n'
redefining abbreviation ,,
from u"{|{x='__NEXT_PLACEHOLDER'}|}" to u'__NEXT_PLACEHOLDER'
Found /help/aboutleo
redefining abbreviation html;;
from 
u'\n\n<|title|>\n\n\n\n\n<|content|>\n\n'
 to u'\n\n\n\n\n\n'
redefining abbreviation ,,
from u"{|{x='__NEXT_PLACEHOLDER'}|}" to u'__NEXT_PLACEHOLDER'
loadOnePlugin: can not load enabled plugin: leo.plugins.sftp
loadOnePlugin: can not load enabled plugin: leo.plugins.viewrendered
loadOnePlugin: can not load enabled plugin: leo.plugins.quickMove

Traceback (most recent call last):
  File "/home/tbrown/t/Package/leo/git/leo-editor/launchLeo.py", line 8, in 

leo.core.runLeo.run()
  File "/mnt/usr1/usr1_t/Package/leo/git/leo-editor/leo/core/runLeo.py", line 
63, in run
g.app.loadManager.load(fileName, pymacs)
  File "/mnt/usr1/usr1_t/Package/leo/git/leo-editor/leo/core/leoApp.py", line 
2099, in load
ok = lm.doPostPluginsInit()
  File "/mnt/usr1/usr1_t/Package/leo/git/leo-editor/leo/core/leoApp.py", line 
2701, in doPostPluginsInit
c = lm.loadLocalFile(fn, gui=g.app.gui, old_c=None)
  File "/mnt/usr1/usr1_t/Package/leo/git/leo-editor/leo/core/leoApp.py", line 
2938, in loadLocalFile
c = lm.openFileByName(fn, gui, old_c, previousSettings)
  File "/mnt/usr1/usr1_t/Package/leo/git/leo-editor/leo/core/leoApp.py", line 
2975, in openFileByName
ok = lm.readOpenedLeoFile(c, fn, readAtFileNodesFlag, theFile)
  File "/mnt/usr1/usr1_t/Package/leo/git/leo-editor/leo/core/leoApp.py", line 
3145, in readOpenedLeoFile
readAtFileNodesFlag=readAtFileNodesFlag)
  File 
"/mnt/usr1/usr1_t/Package/leo/git/leo-editor/leo/core/leoFileCommands.py", line 
839, in openLeoFile
silent=silent,
  File 
"/mnt/usr1/usr1_t/Package/leo/git/leo-editor/leo/core/leoFileCommands.py", line 
655, in getLeoFile
g.app.checkForOpenFile(c, fileName)
  File "/mnt/usr1/usr1_t/Package/leo/git/leo-editor/leo/core/leoApp.py", line 
1126, in checkForOpenFile
g.app.rememberOpenFile(fn)
  File "/mnt/usr1/usr1_t/Package/leo/git/leo-editor/leo/core/leoApp.py", line 
1164, in rememberOpenFile
d[tag] = aList
  File "/mnt/usr1/usr1_t/Package/leo/git/leo-editor/leo/core/leoCache.py", line 
848, in __setitem__
values(?,?);''', (key, data))
sqlite3.ProgrammingError: You must not use 8-bit bytestrings unless you use a 
text_factory that can interpret 8-bit bytestrings (like text_factory = str). It 
is highly recommended that you instead just switch your application to Unicode 
strings.

[2]+  Exit 1  python 
/home/tbrown/t/Package/leo/git/leo-editor/launchLeo.py 
/mnt/edata/edata/edata.leo

Cheers -Terry


-- 
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 leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Leo's run levels

2017-07-17 Thread Terry Brown
On Mon, 17 Jul 2017 01:41:00 -0300
"Xavier G. Domingo"  wrote:

> I think Terry's idea is great. I don't know how do Runlevels exactly 
> work in *nix OSs nor what is your idea on how to implement them in
> Leo, but it occurs to me that it could even be useful to have a
> *g.initState* ivar or similar that explicits the current
> initialization "phase" in which Leo is at any moment. This could be
> leveraged to add asserts all around the initialization code to check
> that Leo is in fact at the expected initState for that code. At the
> very least, it may help in the "migration" phase to the new startup
> code.
> 
> What do you think?
> 
> Xavier

Hmm, I meant my idea to be a thought experiment, maybe resulting in a
list of steps, not actual code.  OTOH, unix runlevels formalize a kind
of set up / tear down sequencing that might have some value.  Not sure,
shutdown of a whole computer's more complicated than Leo shutdown,
which can mostly be handled by the gc and OS without any effort on our
part.

But having a list of named stages might be a useful thing for any
startup redesign that does occur, to help with thinking about at what
stage things should happen.

Cheers -Terry

-- 
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 leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: New backend for Leo Cacher

2017-07-17 Thread Edward K. Ream
On Sun, Jul 16, 2017 at 3:28 PM, vitalije  wrote:

Commit 0e98b2073 contains new backend for leoCache.Cacher. New code is
> disabled by default by `SQLITE=False` switch in leo/core/leoCache.py
>

​Thanks for this.  I'll look at it asap.

Edward

-- 
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 leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Leo's run levels

2017-07-17 Thread Edward K. Ream
On Sun, Jul 16, 2017 at 11:41 PM, Xavier G. Domingo 
wrote:

​>​
 it occurs to me that it could even be useful to have a *g.initState* ivar
​.

This would be a good idea if it phases can be defined simply. We shall
see...

Edward

-- 
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 leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: A road to branch pollution: git stash goes back in time

2017-07-17 Thread Edward K. Ream
On Sun, Jul 16, 2017 at 11:15 PM, Xavier G. Domingo 
wrote:

>
> Anyway, for those of you that need to *continuously work with various git
> branches in parallel*, I've recently come across a better way of doing
> it: Git Worktrees .
>

​Thanks for this.  I'll keep it in mind.

Edward

-- 
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 leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: A road to branch pollution: git stash goes back in time

2017-07-17 Thread Edward K. Ream
On Sun, Jul 16, 2017 at 3:52 PM, vitalije  wrote:

> The recovered nodes are *not* a sign of problems (any more).  They could
>> be called a courtesy--a note that code is different in the new branch from
>> the previous branch.
>>
>> The acid test is to save all files (write-at-file-nodes) after switching
>> branches.  Any changed file is a serious error.
>>
>
> Yes, I see it now. Recovered nodes still appear from time to time, but no
> changed files after write-at-file-nodes. So, everything is in order :-)
>

​Excellent​. Thanks for the confirmation.

Edward

-- 
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 leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.