Leo console mode: launch specifics

2018-01-06 Thread Matt Wilkie
I'm attempting to create script that launches Leo with console gui (#637
)

I can do this from the command line with `launchLeo.py --gui=console` but
in setup.py `console_scripts` can't use parameters. There's no way for me
to pass `--gui=console` to the run command . So I'm trying to figure out
how to do that from a new function in `runLeo.py` instead and am stuck.

Here's my experiment branch:
https://github.com/leo-editor/leo-editor/tree/setup-console-mode

>From which the below should start Leo in console mode but doesn't:

python launchLeo-console.py

This is the run function it fires:

def run_console(fileName=None, pymacs=None, gui='console', *args,
**keywords):
"""Initialize and run Leo in console mode"""
assert g.app
# g.trace('runLeo.py', fileName, args, keywords)
g.app.loadManager = leoApp.LoadManager()
g.app.loadManager.load(fileName, pymacs)

What am I missing? Thanks!

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 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 BLOB API

2018-01-06 Thread tscv11
Let me know if you want to look at my script in its' current incarnation.

When it comes to blobs it will:

1. insert
2. extract
3. view
4. open

(not sure how 'edit' should be different from 'open')

If you give me a better idea of how you'd like it done, I'll try adding the 
choice to
save outlines with the blobs.

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


Noobie to try Leo on Mac OS for thoughts IDE

2018-01-06 Thread andyjim
 

I want an IDE/organizer for thoughts, ideas, journaling, writing.  I have 
hundreds of past files of journals/thoughts to parse and organize plus my 
ongoing thinking/journaling addiction.  Only thing I know of that may be 
close is Zettelkasten, but I haven’t dug into that yet, and don’t know if 
there’s a mature app for it.  I may be barking up the wrong tree here but 
thought I'd give Leo a try. 


Not only am I a noobie to Mac, I am not a programmer and not a Linux user. 
Quite a case (refugee from Windows and don't think I'll go back).  I do not 
know whether Leo will suit my needs but nothing else does and I’d like to 
give it a shake, though it seems the learning curve will be steep for me.


So my first challenge is getting it installed in High Sierra.  I see what 
is for me a complex and somewhat cryptic guide for installing on MacOs 10.7 
(I know nothing of Homebrew, for example). Is this the most current 
information on a Mac installation?  Will that guide get me through it?


Perhaps someone here just needs to gently steer me away from Leo as 
unsuitable for my needs or my noobie-ism.  Or perhaps someone will say 
‘You’ve come to the right place and here’s how to get started!’


Happy New Year!


Andy

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

2018-01-06 Thread Edward K. Ream
On Sat, Jan 6, 2018 at 4:33 PM, Edward K. Ream  wrote:

> On Thu, Jan 4, 2018 at 3:59 PM, Chris George  wrote:
>
>> Clean git clone install.
>>
>> npm install
>>
>> npm run dev
>>
>> Success!
>>
>
> ​Glad to hear it.  I did the same, and got this cryptic message:
> ​ [snip]
>

​Well, following the "monkey see, monkey do" principle, this works for me:

npm run dev --scripts-prepend-node-path

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: Jump to git diff from log

2018-01-06 Thread Terry Brown

Just want to make sure there's no confusion here - this issue has
nothing to do with the new "Jump to git diff from log" functionality,
it's a query / bug report about an old and unrelated plugin, gitarchive.

I responded here:

https://groups.google.com/d/msg/leo-editor/rTEEdO9V2L8/SESvuYboEAAJ

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: Jump to git diff from log

2018-01-06 Thread T C
Leo Log Window
Leo 5.6, build 20171031115424, Tue Oct 31 11:54:24 CDT 2017
Not running from a git repo
Python 3.5.3, PyQt version 5.6.0
Windows 10 AMD64 (build 10.0.15063) SP0
isPython3: True
caching enabled
leoID='6834'
load dir: C:\Users\TSC\Desktop\leo-editor\leo\core
global config dir: C:\Users\TSC\Desktop\leo-editor\leo\config
home dir: C:\Users\TSC
reading settings in
C:\Users\TSC\Desktop\leo-editor\leo\config\leoSettings.leo
reading settings in C:\Users\TSC\.leo\myLeoSettings.leo
nodeActions: Init
reading settings in
C:\Users\TSC\Documents\Leo\Leo4SQLite\leo4sqlite.blobs.leo
reading: C:\Users\TSC\Documents\Leo\Leo4SQLite\leo4sqlite.blobs.leo
read 2 files in 0.03 seconds
read outline in 0.34 seconds
NOTE: embedded layout in @settings/@data free-layout-layout overrides saved
layout default (mod)

git-dump prints *many *lines like the following:

wrote 6834.20171231062511.1
wrote 6834.20180102163531.1

but during this Leo freezes and must be shut down.

git-log shows:
f C:\Users\TSC/.leo/dump/6834.20180105210311.1

Traceback (most recent call last):

  File "C:\Users\TSC\Desktop\leo-editor\leo\core\leoKeys.py", line
2646, in callAltXFunction
func(event)

  File "C:\Users\TSC\Desktop\leo-editor\leo\plugins\gitarchive.py",
line 57, in git_dump_f
dbdirname = bname + "_" + hashlib.md5(c.mFileName).hexdigest()

TypeError: Unicode-objects must be encoded before hashing


On Sat, Jan 6, 2018 at 1:45 PM, Edward K. Ream  wrote:

> On Wed, Jan 3, 2018 at 10:51 PM, tscv11  wrote:
>
> I hope this isn't too out of place. I just want to ask how to use
>> the gitarchive plugin. It crashes Leo with a perpetual loop when
>> I try to use it.
>>
>
> ​Please create an issue for this, giving as much detail as you can.
>
> Edward
>
> --
> 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/rTEEdO9V2L8/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: Leo Vue

2018-01-06 Thread Edward K. Ream
On Thu, Jan 4, 2018 at 3:59 PM, Chris George  wrote:

> Clean git clone install.
>
> npm install
>
> npm run dev
>
> Success!
>

​Glad to hear it.  I did the same, and got this cryptic message:

npm WARN lifecycle The node binary used for scripts is C:\Program
Files\nodejs\node.exe but npm is using C:\PROGRA~1\nodejs\node.exe itself.
Use the `--scripts-prepend-node-path` option to include the path for the
node binary npm was executed with.

> leo-vue@1.4.0 dev c:\leo.repo\leovue
> node build/dev-server.js

c:\leo.repo\leovue\node_modules\semver\semver.js:293
throw new TypeError('Invalid Version: ' + version);
^

TypeError: Invalid Version: c:\leo.repo\leovue>C:\Progra~1\nodejs\npm
--version
5.6.0
at new SemVer (c:\leo.repo\leovue\node_modules\semver\semver.js:293:11)
at Range.test (c:\leo.repo\leovue\node_modules\semver\semver.js:1036:15)
at Function.satisfies
(c:\leo.repo\leovue\node_modules\semver\semver.js:1085:16)
at module.exports (c:\leo.repo\leovue\build\check-versions.js:26:17)
at Object. (c:\leo.repo\leovue\build\dev-server.js:1:90)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! leo-vue@1.4.0 dev: `node build/dev-server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the leo-vue@1.4.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!
C:\Users\edreamleo\AppData\Roaming\npm-cache\_logs\2018-01-06T22_30_17_218Z-debug.log

My PATH contains C:\Program Files\nodejs;

Any suggestions?

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 BLOB API

2018-01-06 Thread Terry Brown
On Sat, 6 Jan 2018 15:42:18 -0600
"Edward K. Ream"  wrote:

> > For Leo handling BLOBs would mean managing a collection of PDF / SVG /
> > bitmap (image formats) / spreadsheet / etc. kind of files, with the
> > option to view them (possibly in a pane in Leo, but in an external
> > viewer is fine too), edit them (most likely in an external app.),
> > store the updated version, etc.
> 
> ​I don't understand why this is something that Leo needs to special
> case.
> 
> If a blob can be visualized, then the VR plugin would be the natural
> place to do so.  For example, VR already supports svg, and other
> formats.

It's more a question of BLOB management than visualization.  Leo lets
you manage hundreds or thousands of little bits of text.  That's
impressive.  So can that same management extend to keeping track of
binary formats.  Currently the nearest is probably:
file:///some/path/somedata.xlsx as a link in body text, but the user's
responsible for managing the file and transporting it with the outline
etc. etc.  BLOB management might reduce that burden enough to make
Leo an even complete information management environment.  Another step
on the road to LeoOS :-)

If it was a herculean task you'd have to question the bang for buck,
but I think some basic functionality can be stood up fairly easily.

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: Jump to git diff from log

2018-01-06 Thread Edward K. Ream
On Wed, Jan 3, 2018 at 10:51 PM, tscv11  wrote:

I hope this isn't too out of place. I just want to ask how to use
> the gitarchive plugin. It crashes Leo with a perpetual loop when
> I try to use it.
>

​Please create an issue for this, giving as much detail as you can.

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 BLOB API

2018-01-06 Thread Edward K. Ream
On Sat, Jan 6, 2018 at 10:41 AM, Terry Brown  wrote:

For Leo handling BLOBs would mean managing a collection of PDF / SVG /
> bitmap (image formats) / spreadsheet / etc. kind of files, with the
> option to view them (possibly in a pane in Leo, but in an external
> viewer is fine too), edit them (most likely in an external app.), store
> the updated version, etc.
>

​I don't understand why this is something that Leo needs to special case.

If a blob can be visualized, then the VR plugin would be the natural place
to do so.  For example, VR already supports svg, and other formats.

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: cross-platform file references - how to deal with?

2018-01-06 Thread Edward K. Ream
On Wed, Jan 3, 2018 at 5:03 PM, jkn  wrote:

sorry to be a pain, but I think this (os_path_expandExpression() in
> leoGlobals.py) does not work for multiple occurrences of path expressions.
>

​...

​

> Shall I raise an issue for this?
>

​Yes, of course.

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.


Leo BLOB API

2018-01-06 Thread Terry Brown
tscv11 has been bringing up the idea of BLOBs in Leo, something that's
come up before but never moved forward.

Binary Large OBject (BLOB) is the term used by databases for binary
assets which don't fit in any of the regular text / int / real
number kind of fields.

For Leo handling BLOBs would mean managing a collection of PDF / SVG /
bitmap (image formats) / spreadsheet / etc. kind of files, with the
option to view them (possibly in a pane in Leo, but in an external
viewer is fine too), edit them (most likely in an external app.), store
the updated version, etc.

Rather than a single collection of BLOBs, there should be a list of
collections of BLOBs (i.e. a @settings -> @data node).

Each blob would have an ID, which would be a simple string, which can
be anything the user wants, so if you want to include slashes and think
of it was a virtual file system with folders, you can.

We'd also need some kind of a file type info. to select the right
viewers / editors.

Base level of the API would be something like

  g.blob.view(id)
  g.blob.edit(id)
  g.blob.add(id, filepath)
  g.blob.delete(id)

but we could also have a list of blobs associated with each node, in
v.u, and some kind of in body link like blob://myblob-ID, etc.

tscv11 has been working on storing BLOBs in sqlite.  I think we could
support multiple BLOB collection storage backends, so the @data node
listing BLOB collections might look like:

  sqlite:/path/to/some/sqlite.db
  dir:/path/to/a/directory/hierarchy/containing/blobs
  zip:/path/to/a/zip/file/containing/blobs

Backends that can store multiple BLOBs in one file are nice, like
sqlite, zipfile, etc.  Because then you only need to copy one file
around.  Such formats may need some sort of g.blob.repack(collection_id)
to handle addition of updated values for BLOBs.  I'm not sure how sqlite
and Python's zipfile actually handle updates, but Python's tarfile I
think would just append the new values, making the file grow ever
larger.

Sqlite would have the additional benefit that it could be combined with
Vitalije's sqlite outline format work to store the outline and the
BLOBs in the same file - it's always nice if everything can be
transported in a single file.

One reason I'd like to support multiple collection formats and not
just sqlite is that I'm not sure sqlite's BLOB storage is the most
efficient space wise.  I made a simple test adding /usr/bin/* to a
sqlite DB and ~760 Mb of files created a 1.2 Gb DB file.  Also a dir:
based backend would be good for pointing into a DropBox kind of folder,
and designing the API to allow different backends would allow for cloud
storage etc.

Thoughts?

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.