Re: Pyzo as a live Leo explorer

2020-04-18 Thread 'tfer' via leo-editor
Got another warning after Leo starts:

Leo 6.3-devel, devel branch, build cbb73524c3

2020-04-15 04:24:37 -0500

Note on using QApplication.exec_():

The GUI event loop is already running in the pyzo kernel, and exec_()

does not block. In most cases your app should run fine without the need

for modifications. For clarity, this is what the pyzo kernel does:

- Prevent deletion of objects in the local scope of functions leading to 
exec_()

- Prevent system exit right after the exec_() call


Tom 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/82eb552e-2a7b-492c-95b1-1c114c0976b2%40googlegroups.com.


Re: Query about promote-child-bodies script

2020-04-18 Thread lewis
Using 
p.b = '\n'.join(result)

Here is the output result:

"Model", "C1", "C2", "C3"

"CSM1", 30, 40, 50

"CSM2", 30, 45, 60
"CSM3", 30, 55, 70


Which as expected adds an extra leading newline between the text for each 
node. Except in the case of the last node which I added manually, by 
 insert-node command.
Note that it is the *different behaviour of the manually added nodes* which 
I can't explain.

Regards
Lewis

On Saturday, April 18, 2020 at 11:10:04 PM UTC+10, Thomas Passin wrote:
>
>
> You need to include the separators you want, in this case a newline:
>
> p.b = '\n'.join(result)
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/a1212a54-69a6-4c69-90e7-cc3b23584b8e%40googlegroups.com.


Re: Viewrendered3 Updates

2020-04-18 Thread Matt Wilkie
That is very inspiring Thomas!

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/58bd16ed-9325-483c-8a17-85e1fee9084f%40googlegroups.com.


Re: Qt is changing their licensing policies

2020-04-18 Thread Matt Wilkie

>
>  ...in the event of a one-year freeze on free releases, Phoronix now 
>> reports, "several individuals and projects are already expressing 
>> interest in a Qt fork should it come to it 
>> ."
>>  
>>
>>
>
> Heh.  A one-year reprieve from the dreaded software rot.
>

A prominent Qgis developer, one of the largest and most successful open 
source Qt based programs I'm aware of, pointed out they're currently 2 
years behind current Qt on Windows because there haven't been any 
compelling reasons to upgrade, and the bugs that have been filed in their 
areas of concern aren't being dealt with on the Qt side anyway.
-- https://lists.osgeo.org/pipermail/qgis-developer/2020-April/060854.html

-matt

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/17f4ad07-5f26-4536-b099-a61fb517b0d1%40googlegroups.com.


Re: Pyzo as a live Leo explorer

2020-04-18 Thread 'tfer' via leo-editor
Though I'm using a conda env, pip is not conda related.  From what I've 
seen, they must not have a complete requirement clause in their setup.py as 
the pip install, if done before the pip install -e . for leo, doesn't load 
in any pytq stuff so it won't run until leo does that for you.

I'm curious, is your shell in IPython instance, (try? to see if it has 
magics)?  I did not get that until I change Leo's requirement to "notebook".

Having Ipython running adds a lot of inspection stuff.

On Saturday, April 18, 2020 at 6:41:37 PM UTC-4, Thomas Passin wrote:
>
>
>
> On Saturday, April 18, 2020 at 4:58:58 PM UTC-4, tfer wrote:
>>
>> Okay, I'm playing with this, getting interesting results:
>>
>  [snip]
>
>> pip install pyzo
>>
>
> I installed Pyzo using the standalone installer.  I don't know if that 
> would make any difference in what you are doing or not.  But at least it 
> doesn't depend  directly on Conda. 
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ca175c59-44ad-4074-9e95-1885974d7918%40googlegroups.com.


Re: Pyzo as a live Leo explorer

2020-04-18 Thread Thomas Passin


On Saturday, April 18, 2020 at 4:58:58 PM UTC-4, tfer wrote:
>
> Okay, I'm playing with this, getting interesting results:
>
 [snip]

> pip install pyzo
>

I installed Pyzo using the standalone installer.  I don't know if that 
would make any difference in what you are doing or not.  But at least it 
doesn't depend  directly on Conda. 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/73a35fb9-5aa6-46c3-a4c4-8ac4a5f47a83%40googlegroups.com.


Re: Pyzo as a live Leo explorer

2020-04-18 Thread Thomas Passin
I have found that it's better to configure the Pyzo shell for "none- No Gui 
Support" if you want to launch Leo in the way I illustrated above.  
Otherwise I have had circumstances in which Pyzo's handling of PyQt5 seems 
to interfered with Leo's.

I don't know how this would play with Ipython/Jupiter.

On Wednesday, April 8, 2020 at 12:25:56 PM UTC-4, Thomas Passin wrote:
>
>
> On Wednesday, April 8, 2020 at 11:37:18 AM UTC-4, Matt Wilkie wrote:
>>
>> Thanks for the extra detail Thomas. 
>>
>> Something like this function in runLeo.py 
>>  
>> to add command line argument might be used to invoke no-docks:
>>
>> def run_console(*args, **keywords): 
>>"""Initialize and run Leo in console mode gui""" 
>>import sys 
>>sys.argv.append('--gui=console') 
>>run(*args, **keywords)
>>
>
> I wouldn't be using --gui=console to use docks, but this worked like a 
> charm (no def: needed) -
>
> import leo 
>
> import sys
>
> sys.argv.append('--use-docks')
>
> leo.run()
>
>
> Then CTRL-ENTER in Pyzo.
>
>
> Thanks for the idea!
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/cef2f842-2064-4786-a848-42a529d21e08%40googlegroups.com.


Re: Pyzo as a live Leo explorer

2020-04-18 Thread 'tfer' via leo-editor
Okay, I'm playing with this, getting interesting results.

   - Working on Windows 10
   - Using Miniconda
   - Using powershell instance(s) in Conemu
  1. setup posh-git to integrate git into powershell
 - easiest installed with scoop from the extras bucket
  2. setup conda to integrate it into powershell
 - involves running: conda init
  - Making a conda env and then customizing:
   

   1. conda create --name lpik_3.7 python=3.7 ipykernel
  1. initials indicating:
1. l - leo
2. p - pyzo
3. i - IPython
4. k - kernel, (an ipykernel, registered to run Juypter 
Notebooks)
 2. pip install -e .
  1. run inside the repository directory, this set up the env so Leo 
 will have the packages it needs
 2. Note: in setup.py, I've commented out the 'nbformat' and 
 replaced it with 'notebook'
1. This gives the env the packages to run IPython, and Jupyter 
Notebooks
 3. pip install pyzo
  4. Now when you follow Matt's instructions, and open the shell, it 
  will have IPython interpreter running in it
  5. Pressing F5, Leo will start
 1. Once you close any blocking dialog boxes, (like Tips, or This 
 file may already Open ...), you'll get the IPython prompt back in the 
pyzo 
 shell.
  - back there, you can use the magic command - 'notebook' to start a 
  Juypter Notebook
 - even though I've registered this env with step 1. above, it is 
 not showing in the kernel options, so the notebook is not what we want 
yet
  
Note: I get this warning in the shell when starting Leo:

>>> (executing file "launchLeo.py")

Qt WebEngine seems to be initialized from a plugin. Please set 
Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute before 
constructing QGuiApplication.


Not sure how to do what it is asking.


Tom

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/59d76826-408f-4fea-8e44-19c0ef5930ac%40googlegroups.com.


Re: Quiet time is over

2020-04-18 Thread Thomas Passin
Possibly fitting in with this, I have just discovered SourceTrails, a 
static code analyzer that works with Python code (as well as Java, C, and 
C++):

https://www.sourcetrail.com/

Sourcetrails can work with quite a few editor/IDEs by means of an 
intermediate server, including Sublime Text, atom, and QT Creator.  So it 
should be feasible to get Leo to work with it too.

On Tuesday, April 14, 2020 at 9:53:28 AM UTC-4, Edward K. Ream wrote:
>
> I have enjoyed taking a break to look at broader issues. My conclusions:
>
>
> I want to create new, Leonine, tools for studying and adapting code. I am 
> most interested in studying pyzo's gui code and Leo's key-handling code. 
> The goal in each case will be to simplify and improve the corresponding 
> code in Leo.
>
>
> Initially, such tools are likely to be bespoke scripts. Later, these 
> scripts *might *evolve into Leonine commands.
>
>
> The tools themselves will likely be the primary product of the work. There 
> is no guarantee that Leo's code will ever change.
>
>
> *Initial ideas*
>
>
> How could we meld Leo's and pyzo's code bases? We could start with Leo's 
> code, or pyzo's code, or we could start with a clean slate. Each way has 
> advantages. For example, we could investigate snippets in code in what 
> amounts to a unit test.
>
>
> We can think of Leo outlines as an "executable" graph. Bespoke scripts 
> would define "meaning" and "appearance" of this graph. Other scripts could 
> define *projections* of a Leo outline onto another (part of) the Leo 
> outline. For example, a script, similar to Leo's clone-find or find-all 
> commands, might summarize the messages which pass between pyzo's gui code. 
> The summary would appear as a single node (find-all) or a tree of nodes 
> (clone-find).
>
>
> By default, pytest presents its coverage data as a single html page. It 
> might be possible to restructure that data by Leo nodes.
>
>
> *Summary*
>
>
> Melding code bases is difficult to impossible :-) It's a juicy problem, 
> for which Leonine scripts have unique advantages. Scripts can define 
> *projections 
> *of an outline. Such projections distill information and might form the 
> basis of still more scripts.
>
>
> Absent significant new tools, the Leonine and pyzoic code bases will 
> likely remain separate. Only strong scripts, similar to unit tests with 
> full coverage, could ensure that changes to Leo's code won't subtly alter 
> the meaning of existing settings and appearance.
>
>
> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/7df74f83-c813-445b-987b-ba8bb3631c45%40googlegroups.com.


Re: Query about promote-child-bodies script

2020-04-18 Thread Thomas Passin


On Saturday, April 18, 2020 at 5:41:36 AM UTC-4, lewis wrote:
>
> After using a leo script_A to convert a list of lines into separate nodes 
> for each line of p.b.
> I have a script_B that reads child nodes, and copies all the body text 
> lines back to the parent. It is based on @button promote-child-bodies, from 
> LeoDocs.
>

You need to include the separators you want, in this case a newline:

p.b = '\n'.join(result)

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/d6d1b694-b70c-4544-b049-4740316b9210%40googlegroups.com.


Query about promote-child-bodies script

2020-04-18 Thread lewis
After using a leo script_A to convert a list of lines into separate nodes 
for each line of p.b.
I have a script_B that reads child nodes, and copies all the body text 
lines back to the parent. It is based on @button promote-child-bodies, from 
LeoDocs.

result = [p.b]
b = c.undoer.beforeChangeNodeContents(p)
for child in p.children():
result.append(f'{child.b}' )# copy body only
p.b = ''.join(result)
c.undoer.afterChangeNodeContents(p,'promote-child-bodies',b)


Here is a sample of CSV to which I apply the script_A, creating 3 nodes

"Model", "C1", "C2", "C3"
"CSM1", 20, 40, 50
"CSM2", 30, 45, 60


After manually adding a fourth node, containing body text: "CSM3", 40, 55, 
70
I run script_B which reads the new node and adds the new body text but it 
is not on a new line.

"Model", "C1", "C2", "C3"
"CSM1", 20, 40, 50
"CSM2", 30, 45, 60"CSM3", 40, 55, 70

Is it possible that when the nodes are created with script_A, hidden 
characters are added? I tried using show-invisibles but I only see spaces. 
Using /n adds new blank lines between all and is not suitable.
Any ideas on how to move it to the next line?

Regards
Lewis

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/d09fa220-2eef-4119-ae7e-86aed94ef248%40googlegroups.com.