New plugin history_tracer

113 views
Skip to first unread message

vitalije

unread,
Sep 28, 2019, 2:22:21 PM9/28/19
to leo-e...@googlegroups.com
I finally got around to pack and publish my new plugin history_tracer.

In order to be useful one must have installed leo-ver-serv utility. I'll try to make it available as a binary file for Ubuntu 18.04 and Windows 10.

It should be straightforward to install from source if one already has installed cargo, a Rust building and package management tool.

Here is described how to install cargo. If you have cargo installed then installation of leo-ver-serv would be quite easy.
cargo install leo-ver-serv

For Ubuntu 18.04 pre-built binary can be found here size 9.2M, sha1sum: 6dc40bdf73cdd8df540900a254dfcde99f701e28

After installation, leo-ver-serv should be run with the following command:

leo-ver-serv ~/.leo/.leoRecentFiles.txt 8087

The first argument should be a filename of a file containing list of absolute paths to known Leo files. One suitable file that can be used is ~/.leo/.leoRecentFiles.txt which contains list of recently used Leo files. Only files whose names are listed in this file will have their history tracked. The second argument is a port number. The same port number must be in your settings @int history-tracer-port which by default has value 8087.

Once you have leo-ver-serv running, you can start Leo and every time you are inactive for more than 5 seconds, history_tracer plugin will send a snapshot of current outline to leo-ver-serv and that version will be recorded. If you wish to see previous versions you can open:
http://localhost:8087/ in your browser.

Vitalije

Brian Theado

unread,
Sep 28, 2019, 4:10:03 PM9/28/19
to leo-editor
Vitalije,

I'm see a blank @file history_tracer.py. Did you forget a 'git add'?

Brian

On Sat, Sep 28, 2019 at 2:22 PM vitalije <vita...@gmail.com> wrote:
I finally got around to pack and publish my new plugin history_tracer.

In order to be useful one must have installed leo-ver-serv utility. I'll try to make it available as a binary file for Ubuntu 18.04 and Windows 10.

It should be straightforward to install from source if one already has installed cargo, a Rust building and package management tool.

Here is described how to install cargo. If you have cargo installed then installation of leo-ver-serv would be quite easy.
cargo install leo-ver-serv

For Ubuntu 18.04 pre-built binary can be found here size 9.2M, sha1sum: .9ca502f10ad4c35b1f538a0a1dbfe17ad4724155.

After installation, leo-ver-serv should be run with the following command:

leo-ver-serv ~/.leo/.leoRecentFiles.txt 8087

The first argument should be a filename of a file containing list of absolute paths to known Leo files. One suitable file that can be used is ~/.leo/.leoRecentFiles.txt which contains list of recently used Leo files. Only files whose names are listed in this file will have their history tracked. The second argument is a port number. The same port number must be in your settings @int history-tracer-port which by default has value 8087.

Once you have leo-ver-serv running, you can start Leo and every time you are inactive for more than 5 seconds, history_tracer plugin will send a snapshot of current outline to leo-ver-serv and that version will be recorded. If you wish to see previous versions you can open:
http://localhost:8087/ in your browser.

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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/761e1d6a-8dab-4af8-b048-c2a5a503af29%40googlegroups.com.

vitalije

unread,
Sep 28, 2019, 4:17:29 PM9/28/19
to leo-editor
Good catch. I forgot to add it.
Rev d8fc8bc contains the plugin.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-e...@googlegroups.com.

Brian Theado

unread,
Sep 28, 2019, 9:24:28 PM9/28/19
to leo-editor
Thanks. It worked for me. Looks just as impressive as your demo a few months back. Nice work!

To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/746cb984-8185-4973-abb2-420531bf4a2c%40googlegroups.com.

Edward K. Ream

unread,
Sep 29, 2019, 6:58:30 AM9/29/19
to leo-editor
On Sat, Sep 28, 2019 at 1:22 PM vitalije <vita...@gmail.com> wrote:
I finally got around to pack and publish my new plugin history_tracer.

Many thanks for this.  I have just created #1358 to memorialize your contribution.  This will ensure that link to all issues in the 6.1 release notes will include your work.

I've bookmarked this email and added history_tracer.py to my local leoSettings.leo file.  I'll take a look at it soon.

Edward

Edward K. Ream

unread,
Sep 30, 2019, 6:06:27 PM9/30/19
to leo-editor
On Sat, Sep 28, 2019 at 1:22 PM vitalije <vita...@gmail.com> wrote:
I finally got around to pack and publish my new plugin history_tracer.
... 
If you have cargo installed then installation of leo-ver-serv would be quite easy.
cargo install leo-ver-serv

On windows I get this:

    Updating crates.io index
  Installing leo-ver-serv v0.1.7
error: failed to compile `leo-ver-serv v0.1.7`, intermediate artifacts can be found at `C:\Users\EDREAM~1\AppData\Local\Temp\cargo-installzk33CR`

Caused by:
  failed to download `fossil-delta v0.1.6`

Caused by:
  unable to get packages from source

Caused by:
  failed to unpack package `fossil-delta v0.1.6`

Caused by:
  failed to unpack entry at `fossil-delta-0.1.6/src/test-data/file-b.txt`

Caused by:
  failed to unpack `C:\Users\edreamleo\.cargo\registry\src\github.com-1ecc6299db9ec823\fossil-delta-0.1.6\src\test-data\file-b.txt`

Edward

vitalije

unread,
Sep 30, 2019, 7:28:59 PM9/30/19
to leo-e...@googlegroups.com
I am travelling and can't do much about this at the moment. From the log I see that it complains about missing text test files. They aren't essential. Try adding any text files on those paths. They only serve for testing and I should have added them to the repository, but I had forgotten. When I get back I'll add them to git.

Vitalije

Instead of cargo install leo-ver-serv, you can clone the repo, put some dummy text files on those paths and try:
cargo build
inside the repo.

Chris George

unread,
Sep 30, 2019, 8:20:07 PM9/30/19
to leo-editor
It installed flawlessly on Linux.

Chris

On Mon, Sep 30, 2019 at 4:29 PM vitalije <vita...@gmail.com> wrote:
I am travelling and can't do much about this at the moment. From the log I see that it complains about missing text test files. They aren't essential. Try adding any text files on those paths. They only serve for testing and I should have added them to the repository, but I had forgotten. When I get back I'll add them to git.

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+...@googlegroups.com.

vitalije

unread,
Oct 1, 2019, 1:13:27 AM10/1/19
to leo-editor
Here is the Windows10 version: leo-ver-serv-v0.1.7.exe sha1:  0d79fd1864d31f190ed3b33e708778ebc4fd8ee6

This morning I've successfully built it with the `cargo install leo-ver-serv` command on Windows10 laptop.

Vitalije

Edward K. Ream

unread,
Oct 3, 2019, 10:25:35 AM10/3/19
to leo-editor


On Tuesday, October 1, 2019 at 12:13:27 AM UTC-5, vitalije wrote:

This morning I've successfully built it with the `cargo install leo-ver-serv` command on Windows10 laptop.

Still fails for me, as before.

I downloaded leo-ver-serv-v0.1.7.exe and ran it.

I run it as follows from a .bat file containing:

c:\bin\leo-ver-serv-v0.1.7.exe C:\Users\edreamleo\leo-ver-server-files.txt 8087

c:\users\edreamleo\leo-ver-server-files.txt contains:

C:\leo.repo\leo-editor\leo\core\leoPy.leo
c
:\Users\edreamleo\ekr.leo

The http://localhost:8087/public/index.html web page appears, but is empty. In particular, the Leo file dropdown box is empty.

Hmm.  I'm having trouble allowing access to localhost on Mozilla Firefox. I just temporarily disabled the noscript tool, but still no joy.  I see the same with the Chrome browser.

Any suggestions?

Edward

vitalije

unread,
Oct 3, 2019, 11:22:03 AM10/3/19
to leo-editor
Try to write leo-ver-server-files.txt using unix new lines. Does leo-ver-serv.exe produces any output in console?
Vitalije

Edward K. Ream

unread,
Oct 3, 2019, 3:35:53 PM10/3/19
to leo-editor
On Thu, Oct 3, 2019 at 10:22 AM vitalije <vita...@gmail.com> wrote:
Try to write leo-ver-server-files.txt using unix new lines. Does leo-ver-serv.exe produces any output in console?

No output in console.  Browser view unchanged.

Edward

Brian Theado

unread,
Oct 3, 2019, 8:24:36 PM10/3/19
to leo-editor
Did you actually make a change to your outline? Body edits don't count. Iirc Vitalije's code doesn't send anything unless a command is executed.

--
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+...@googlegroups.com.

vitalije

unread,
Oct 4, 2019, 5:09:55 AM10/4/19
to leo-editor
Things one should know about leo-ver-serv and history_tracer.py.
  1. leo-ver-serv should be running before Leo opens and the port it listens on should match the one from Leo settings (by default 8087)
  2. if leo-ver-serv is running correctly it should populate the Leo files combo-box on http://localhost:8087/public/index.html
    if this is not the case something is wrong and it is best to check browser's console for errors.
  3. front-end is tested on Google-chrome and on Mozilla Firefox.
  4. if list of Leo files in combo-box matches the content of the file you used when starting leo-ver-serv, initially all files will look empty, until Leo sends its first snapshot for each of these files.
  5. history_tracer plugin binds a handler on 'command2' which is executed after any Leo command, and this handler just records the time of the last executed command. Every 5 seconds, plugin checks if there passed more than 5 seconds since last command and if it is it creates snapshot and posts it to leo-ver-serv. 
  6. whenever snapshot is sent from Leo, in the console Leo prints a log message about snapshot
  7. whenever snapshot is successfully accepted and recorded by leo-ver-serv it should print single line log message about it.
  8. after the first recorded snapshot for the given Leo file, this file becomes visible in the front end. Of course one must reload page or to change Leo file to actually see new version.
If anything is not working according to this specification, please let me know which step is not working.

HTH Vitalije

Edward K. Ream

unread,
Oct 4, 2019, 7:38:29 AM10/4/19
to leo-editor
On Fri, Oct 4, 2019 at 4:09 AM vitalije <vita...@gmail.com> wrote:
Things one should know about leo-ver-serv and history_tracer.py.
  1. leo-ver-serv should be running before Leo opens and the port it listens on should match the one from Leo settings (by default 8087)
  2. if leo-ver-serv is running correctly it should populate the Leo files combo-box on http://localhost:8087/public/index.html
    if this is not the case something is wrong and it is best to check browser's console for errors.
Failed to execute ‘postMessage’ on ‘DOMWindow’: The target origin provided (‘https://hangouts.google.com’) does not match the recipient window’s origin (‘https://mail.google.com’).

Edward

vitalije

unread,
Oct 4, 2019, 8:38:49 AM10/4/19
to leo-editor


On Friday, October 4, 2019 at 1:38:29 PM UTC+2, Edward K. Ream wrote:

Failed to execute ‘postMessage’ on ‘DOMWindow’: The target origin provided (‘https://hangouts.google.com’) does not match the recipient window’s origin (‘https://mail.google.com’).

Edward

I don't know what is this. Perhaps you clicked in the link inside gmail and it is blocked. Try to copy and paste link in the new empty tab.
If you didn't click link inside gmail message, then you perhaps have installed some add-on which interferes with the page. I know postMessage is part of add-on API used in browser add-ons and extensions, but leo-ver-serv doesn't use this.

Vitalije 
Reply all
Reply to author
Forward
0 new messages