Re: leo4sqlite plugin

2018-01-16 Thread T C
Thanks for your response.

I am not satisfied with the blob situation because temporary @image nodes
are created (I
was thinking that some people might then want to move these out from under
the 'temp' node
and into more permanent collections, etc., but this means the user has to
manually clear out
the 'temp' node or issue the command: 'sqlite-reset-temp' if they don't
want to keep them).

Another thing - c.p is changed and selected during certain operations and
then it stays there.
This does not seem optimal to me. I would prefer to end and begin with the
same position (for
most things), but I read about the complications of saving/using positions
and didn't take it
further.

Finally, I have not worked out a satisfactory way to handle automatically
purging files when
the blob view/render pane is hidden. I believe this should be an option,
not the default.I did
have something that worked by defining a keyboard shortcut - it just closed
the render pane
and deleted the files. I'll try to track it down or redo it, unless I can
find a better way.

*Yet another thing...TODO:* Add option for blob view -> render pane zoom:
default?

I'll work on my TODOs and await further instructions.

tscv11

On Tue, Jan 16, 2018 at 8:47 PM, Terry Brown  wrote:

> On Tue, 16 Jan 2018 19:42:42 -0800 (PST)
> tscv11  wrote:
>
> > Nice job, me!
>
> Yes, indeed, nice job :-)
>
> In terms of suggestions, your own todos make sense.  With plugins
> there's typically just the plugin, and no accompanying .leo file, so
> moving the content in the readme into the docstring will make it easier
> for people to see how to get started.  The docstring is what's seen
> when you select Plugins -> leo4sqlite.
>
> You could tweak it to run in Python 2 as well as 3, kind of a chore,
> and not essential - I'm guessing we've turned the corner and the
> majority of people run Leo in Python 3 now, although I'm not sure about
> that.
>
> I'll have to play a bit more with the BLOB commands.
>
> Cheers -Terry
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "leo-editor" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/leo-editor/MHzbc2AlGUg/unsubscribe.
> To unsubscribe from this group and all its topics, 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.
>

-- 
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: leo4sqlite plugin

2018-01-16 Thread Terry Brown
On Tue, 16 Jan 2018 19:42:42 -0800 (PST)
tscv11  wrote:

> Nice job, me!

Yes, indeed, nice job :-)

In terms of suggestions, your own todos make sense.  With plugins
there's typically just the plugin, and no accompanying .leo file, so
moving the content in the readme into the docstring will make it easier
for people to see how to get started.  The docstring is what's seen
when you select Plugins -> leo4sqlite.

You could tweak it to run in Python 2 as well as 3, kind of a chore,
and not essential - I'm guessing we've turned the corner and the
majority of people run Leo in Python 3 now, although I'm not sure about
that.

I'll have to play a bit more with the BLOB commands.

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: leo4sqlite plugin

2018-01-16 Thread tscv11
Nice job, me! Yes, I finally finished it, and no one can take that away 
from me,
whether I ever hear from any of them again or not, whether anyone even
looks at it or not, *I *know I did *good*. Well done, me, it was worth
the effort!

I think I'll work on a YAML database application next.
Sounds good, self.

tscv11

-- 
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: My javascript mistake

2018-01-16 Thread Terry Brown
Probably want to support JSX as well :-)

Cheers - Terry 

On January 16, 2018 5:20:15 PM CST, "Edward K. Ream"  
wrote:
>On Tuesday, January 16, 2018 at 7:00:43 AM UTC-6, Edward K. Ream wrote:
>
>> Packages such as node.js, vue.js, react, etc. establish their own
>"coding 
>conventions" that set de facto standards and minimize the problems and 
>deficiencies of "bare" javascript.
>
>babel.js  is a compiler that allows advanced
>syntax by 
>compiling to more basic syntax.  It seems like a good idea, but it
>means 
>that Leo's js importer will have to keep up.  The fix for #651 
> adds support for
>the 
>backtick string syntax.
>
>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.

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

-- 
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: Create custom menu items by referencing your existing buttons

2018-01-16 Thread lewis
It seemed like an unintended 'feature' to me :)

On Wednesday, January 17, 2018 at 3:29:50 AM UTC+11, Edward K. Ream wrote:
>
>
>
> On Sun, Jan 14, 2018 at 5:05 AM, lewis  > wrote:
>
>> I'm not sure if anyone is aware that you can create custom menu items by 
>> referencing your existing buttons.
>> Create an @menu>@item 'name' node with a matching @button 'name' already 
>> present in your working or myLeoSettings leo file. There is no need to have 
>> any body text in the @item node. All that's required is for the names to 
>> match, it will be recognised and show as a menu item.
>>
>
> ​Nice.  I rather doubt I knew this explicitly ;-)
>
> 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 usage tips

2018-01-16 Thread Edward K. Ream
On Tuesday, November 28, 2017 at 8:39:28 AM UTC-6, vitalije wrote:

I have just created a new issue 
> , and want to 
> discuss it here...
>
 

> If we make such list of tips I volunteer to provide some GUI to show a tip 
> every time Leo starts or on command show-tip that can be bound to some 
> unused key combination. 
>

Is this offer still on the table?  I would like to move forward on #597 
.

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: My javascript mistake

2018-01-16 Thread Edward K. Ream
On Tuesday, January 16, 2018 at 7:00:43 AM UTC-6, Edward K. Ream wrote:

> Packages such as node.js, vue.js, react, etc. establish their own "coding 
conventions" that set de facto standards and minimize the problems and 
deficiencies of "bare" javascript.

babel.js  is a compiler that allows advanced syntax by 
compiling to more basic syntax.  It seems like a good idea, but it means 
that Leo's js importer will have to keep up.  The fix for #651 
 adds support for the 
backtick string syntax.

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: My javascript mistake

2018-01-16 Thread Edward K. Ream
On Tuesday, January 16, 2018 at 7:00:43 AM UTC-6, Edward K. Ream wrote:

>
> P. S. A node of caution.  If I were designing a hothouse for malware, I 
> would choose something like the npm package warehouse.  A search for "npm 
> malware" yields this page 
> .
>   
> Presumably Joe Orr is aware of the risks.
>
> The node.js people do not seem even remotely concerned enough. Hiding 
> behind the halting problem is pathetic nonsense.
>

Later npm blog posts  indicate that the npm folks 
are taking reasonable steps to enforce a notion of trusted packages, 
independent of the halting problem ;-)

EKR

-- 
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: Letter of appreciation

2018-01-16 Thread tscv11
Okay, here is my first stab at making leo4sqlite a plugin. Everything seems 
to
work and it has all of the same commands, etc. Let me know what you think!

tscv11


-- 
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.
#@+leo-ver=5-thin
#@+node:tscv11.20180116135059.50: * @file leo4sqlite.py
#@+<< docstring >>
#@+node:tscv11.20180116135059.52: ** << docstring >>
'''
TODO

leo4sqlite.py
Import/export sqlite3 tables and insert, extract, view or open 'blobs' using Leo.

'''
#@-<< docstring >>
#@@language python
#@@tabwidth -4
__version__ = '0.6'
#@+<< version history >>
#@+node:tscv11.20180116135059.51: ** << version history >>
#@+at
# version history
# 
# leo4sqlite.py
# 
#  v0.5 - converting to plugin.
#  
#  v0.6 - plugin version nearly complete - added 'sqlite-clear-data', 'sqlite-reset-temp', and 'sqlite-purge-files'.
#@-<< version history >>
#@+<< imports >>
#@+node:tscv11.20180116135059.53: ** << imports >>
import leo.core.leoGlobals as g
from leo.core.leoQt import QtWidgets
import leo.commands.controlCommands as controlCommands

import subprocess
import sys, os, re
import sqlite3

from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QWidget
from PyQt5.QtWidgets import QInputDialog
from PyQt5.QtWidgets import QLineEdit
from PyQt5.QtWidgets import QFileDialog
from PyQt5.QtWidgets import QDesktopWidget
from PyQt5.QtGui import QIcon
#@-<< imports >>
#@+others
#@+node:tscv11.20180116135059.54: ** init
def init ():

ok = g.app.gui.guiName() in ('qt','qttabs')
if ok:
if 1: # Create the commander class *before* the frame is created.
g.registerHandler('before-create-leo-frame',onCreate)
else: # Create the commander class *after* the frame is created.
g.registerHandler('after-create-leo-frame',onCreate)
g.plugin_signon(__name__)   
return ok
#@+node:tscv11.20180116135059.55: ** onCreate
def onCreate (tag, keys):

c = keys.get('c')
c.__ = {}
if c:
theLeo4SQLiteController = Leo4SQLiteController
#@+node:tscv11.20180116135059.56: ** class Leo4SQLiteController
class Leo4SQLiteController:

#@+others
#@+node:tscv11.20180116135059.57: *3* init
def init (self, c):

ok = g.app.gui.guiName() in ('qt','qttabs')
if ok:
if 1: # Create the commander class *before* the frame is created.
g.registerHandler('before-create-leo-frame',onCreate)
else: # Create the commander class *after* the frame is created.
g.registerHandler('after-create-leo-frame',onCreate)
g.plugin_signon(__name__)   
c.__ = {}
return ok

#@-others
#@+node:tscv11.20180116135059.58: ** class InputDialogs
class InputDialogs(QWidget):

#@+others
#@+node:tscv11.20180116135059.59: *3* __init__
def __init__(self, c):
super().__init__()
self.title = 'leo4sqlite'
self.left = 10
self.top = 10
self.width = 640
self.height = 480
self.initUI(c)
#@+node:tscv11.20180116135059.60: *3* initUI
def initUI(self, c):
self.setWindowTitle(self.title)
self.setGeometry(self.left, self.top, self.width, self.height)
qtRectangle = self.frameGeometry()
centerPoint = QDesktopWidget().availableGeometry().center()
qtRectangle.moveCenter(centerPoint)
self.move(qtRectangle.topLeft())

self.pick_action(c)
 
self.show() 


#@+node:tscv11.20180116135059.61: *3* get_settings
def get_settings(self, c):

p_lst = c.find_h(r'@directory.*\\leo4sqlite-output')
c.selectPosition(p_lst[0])
nd_str = str(p_lst[0])
folder = re.sub(r'^

Re: Undoer class Problem

2018-01-16 Thread Edward K. Ream
On Mon, Jan 8, 2018 at 7:21 AM, Dev Eloper  wrote:

> Hello,
>
> I have undo granularity set to "word".  According to the embedded docs,
> this should occasionally trigger "
> ​​
> recognizeStartOfTypingWord".
>
> I want to modify this function so that undo act's a bit for familiar to me
> (i.e. Notepad++), but it never gets called.  Any tips?
>

​I did not write this code, and have no knowledge of it.  There is exactly
one call to
​recognizeStartOfTypingWord, in the section:

<< set newBead if the change does not continue a word >>​

The code starts out this way:

if old_start != old_end or new_start != new_end:
# The new and old characters are not contiguous.
newBead = True
else:
# code that calls ​​recognizeStartOfTypingWord.

This is all I know.  I would recommend adding this call:

g.trace(old_start, old_end, new_start, new_end)

above to see what is happening.  Please let us know what you discover.

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: The roadmap for 2018: visualization & services

2018-01-16 Thread Edward K. Ream
On Wed, Jan 3, 2018 at 2:48 PM, Offray Vladimir Luna Cárdenas <
off...@riseup.net> wrote:

> Hi,
>
> This reminds me of a blog post where I saw kind of a similar relationship
> between visualizations and outlining that was the AHA moment to conceive
> the development of Grafoscopio [1]. Several influences, like Leo and
> IPython are mentioned there.
>
> In the Pharo case, the GT Tools[2] and the Roassal agile visualization
> toolkit[3] provided smooth integration for such visualization integration.
> I don't know if something like that is available in the Qt toolkit for an
> enriched VR panel. We have proposed some kind of embedded minimal web
> browser or canvas, but I don't know if this is the path to follow and can
> help with the publishing using Leo Vue.
> [1] http://mutabit.com/offray/static/blog/output/posts/
> pharo-by-visualization.html
> [2] http://gtoolkit.org/
> [3] http://www.agilevisualization.com/
>

​Vacation got in the way of commenting.  There was a link in [1] to the
video, playing with live objects
.

The details aren't as important as the grand overview, which is that we get
complacent about how we use our tools.  It would be best if we could treat
our programs *as data to be analyzed*.

This is why I find Leo's clone-find commands so powerful.  Imo, the bug
discussed in the video would have yielded to cff and g.trace(g.callers()).

The challenge of the video is spot on.  We need to keep looking for better
tools.

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: Create custom menu items by referencing your existing buttons

2018-01-16 Thread Edward K. Ream
On Sun, Jan 14, 2018 at 5:05 AM, lewis  wrote:

> I'm not sure if anyone is aware that you can create custom menu items by
> referencing your existing buttons.
> Create an @menu>@item 'name' node with a matching @button 'name' already
> present in your working or myLeoSettings leo file. There is no need to have
> any body text in the @item node. All that's required is for the names to
> match, it will be recognised and show as a menu item.
>

​Nice.  I rather doubt I knew this explicitly ;-)

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.


My javascript mistake

2018-01-16 Thread Edward K. Ream
This post documents the biggest mistake I have made in the last decade or 
so.

This mistake is akin to my initial misunderstanding of emacs.  I didn't 
realize that tab completion makes it unnecessary to remember or type full 
emacs command names.  I would seen my error had I seen an emacs user in 
action. BH (LeoUser) opened my eyes with his prototype of Leo's minibuffer.

Similarly, javascript's real problems have blinded me to the huge amount of 
work done in the the javascript "space", namely the internet.  Joe Orr's 
LeoVue project has set me straight. Packages such as node.js, vue.js, 
react, etc. establish their own "coding conventions" that set de facto 
standards and minimize the problems and deficiencies of "bare" javascript.  
I would have seen my error had I paid more attention to what has been 
happening.

I have started my study of node.js and vue.js.  This will continue 
indefinitely.  Just today I have started to study the leovue/src folder.  
It's a new world.  I find it exciting.  It's going to be a hobby of mine 
while I continue to work on the desktop version of Leo.  I recommend close 
study of the code to anyone wanting to come up to speed on web technologies.

Edward

P. S. A node of caution.  If I were designing a hothouse for malware, I 
would choose something like the npm package warehouse.  A search for "npm 
malware" yields this page 
. 
 
Presumably Joe Orr is aware of the risks.

The node.js people do not seem even remotely concerned enough. Hiding 
behind the halting problem is pathetic nonesense. They might start by 
studying the notion of trusted notebooks 
 in the Jupyter 
world.

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: Excluding nodes in @file tree?

2018-01-16 Thread Edward K. Ream
On Tuesday, January 16, 2018 at 6:36:17 AM UTC-6, Pal Csanyi wrote:
>
> Hi,
>
> I'm new to Leo.
>
> I am trying to create a Bash script with Leo.
> I am using @file directive:
>
> @file NameOfBashScript
>  | - node1
>  | - node2
>  | - node3
>  |   | - node3.1
>  |   | - node3.2
>  | - node4
>  | - node5
>
> Here I wish to exclude from NameOfBashScript file the node3.2 .
> How can I do that?
>

Use a section reference.  Change the headline from "node3.2" to "<< node 
3.2 >>".

Then "disable" << node 3.2 >> using the if/fi construct:

if (0, or whatever the syntax is):
<< node 3.2 >>
fi

You can generalize this pattern:

if 0/whatever:
   << ignored nodes >>
if

The << ignored nodes >> node should contain just one @others line.  All 
children of the << ignored nodes >> node will fall in the range of the 
if/fi. Note that indentation is preserved, as is required by the similar 
Python construct.

HTH.

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.


Excluding nodes in @file tree?

2018-01-16 Thread Pal Csanyi
Hi,

I'm new to Leo.

I am trying to create a Bash script with Leo.
I am using @file directive:

@file NameOfBashScript
 | - node1
 | - node2
 | - node3
 |   | - node3.1
 |   | - node3.2
 | - node4
 | - node5

Here I wish to exclude from NameOfBashScript file the node3.2 .
How can I do that?

Best, Pal

-- 
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.