Automatic backups

37 views
Skip to first unread message

Dan

unread,
Feb 17, 2019, 3:32:19 PM2/17/19
to Event and Task Manager
In the new version the json file that holds all the items will automatically be backed once every day as a compressed file if the json file has changed since the last backup. By default, only the 10 most recent of these daily backups are kept.  My json file is about 400k and the compressed version around 50k.

By the way, the new version is now at the alpha stage with almost all of the basic functionality in place. I'm using it myself exclusively for testing and debugging so there is hope for an eventual release.

-Dan  

lawquest

unread,
Feb 22, 2019, 1:27:05 PM2/22/19
to Event and Task Manager
Is existing data to be easily incorporated into the new etm?

Daniel Graham

unread,
Feb 22, 2019, 1:40:00 PM2/22/19
to eventandt...@googlegroups.com
John,

The current version of etm already has an “export to json” command bound to Shift-J that will export your items to etm_db.json in your etm data directory. The new version has an “import from json” command that will create a new etm TinyDB database (also a json file) or purge the database if it already exists and populate it with the imported items. It’s easy and only takes a few seconds.  

-- Dan

lawquest

unread,
Feb 22, 2019, 2:28:27 PM2/22/19
to Event and Task Manager
Cool.  I have several years of date I will need to  import in, I believe, several different files. 

Let me know when you think it safe for me to migrate to the new etm.  

Thx

John


On Sunday, February 17, 2019 at 12:32:19 PM UTC-8, Dan wrote:

Dan

unread,
Feb 23, 2019, 9:45:47 PM2/23/19
to Event and Task Manager
John,

All the time spent accounting in the new version will be based on the @i index entry which is a colon delimited heirarchy, e.g., account:project. The import process takes this entry from the current @k keyword entry. 

I recall that you have been a maverick and have used the current @c entries for this even though no heirarchy is supported. The import process will move the @c entries into @l location. If you could remind me of the form that your current @c entries take, I might be able to provide an import option that would handle them correctly.

Assuming index entries take the form account: project,  the default report will grouped and sorted by month, then account and  finally project. Please let me know if this would work for you.

lawquest

unread,
Feb 24, 2019, 1:32:30 AM2/24/19
to Event and Task Manager





Thanks much,

Almost all, if not all, my data entries are one of the following formats:

* 341 continued Vanguard @s 2019-02-21 1:30pm @c Vanguard Gold, LLC Creditor's Committee    309301  Represent UCC 
  @z US/Pacific

or

~ travel to Hawthorne.  Appear for oral argument @s 2019-02-19 12am @e 6h @c Smith, Dr.     268604       Jackson v Smth (Lyon County) 
  @z US/Pacific

I plan to see if I can find a spare computer and try the new etm on that one rather than risk my work computer. I used to have one. If only I can find it.

John

Daniel Graham

unread,
Feb 24, 2019, 9:16:37 AM2/24/19
to eventandt...@googlegroups.com
The new version is completely separate from the old and will not affect your current installation in any way. Details below.  All you need is python 3.6 or later. (An earlier version of python 3 might work but is untested.)

1) Create a new data directory for the new etm, say ~/.etm-mv. (Analogous to ~/.etm)
2) Clone the new version from github. Instructions: https://help.github.com/en/articles/cloning-a-repository
3) Open a terminal window, cd to the directory containing the clone and create a virtual environment there. Details: https://realpython.com/python-virtual-environments-a-primer/.

$ python3 -m venv env 
$ . env/bin/activate 
$ pip install -U -r requirements.txt
$ python3 etm ~/.etm-mv

In the last step use whatever directory you chose in (1). The reason for the virtual environment is that it installs the requirements from “requirements.txt” that you do not already have inside the virtual environment and does not touch any other part of your system. Want to drop the new version? Just delete the program directory and the data directory and you’re back where you started. Beware: much of what you use - timers, accounting reports, … - are not yet available. The important views and the data entry and editing processes, however, are all in place.

-- Dan

Sebastian Cyprych

unread,
Feb 27, 2019, 5:42:12 PM2/27/19
to eventandt...@googlegroups.com
Dear Dan

Curious, I tried to run the new version of etm.

> 1) Create a new data directory for the new etm, say ~/.etm-mv.
> 2) Clone the new version from github.
> 3) Open a terminal window, cd to the directory containing the clone and
> create a virtual environment there
>
> $ python3 -m venv env
> $ . env/bin/activate
In fact, I did `$ source env/bin/activate`.

> $ pip install -U -r requirements.txt
> $ python3 etm ~/.etm-mv

Unfortunately, I ran to problems installing `ujson` (just lack of `python3-dev`
package).
But it seems, that you use `ruamel.yaml` which misses in requirements.

$ python3 etm ~/.etm-mv
Traceback (most recent call last):
File "etm", line 18, in <module>
from etmMVC.model import setup_logging, logger, about
File "./etmMVC/model.py", line 9, in <module>
from ruamel.yaml import YAML
ModuleNotFoundError: No module named 'ruamel'

after `pip install -U ruamel.yaml`
I get another error:

$ python3 etm ~/.etm-mv
Traceback (most recent call last):
File "etm", line 67, in <module>
for x in expansions:
TypeError: 'NoneType' object is not iterable

so, I see, that `expansions` MUST be configured in `~/.etm-mv/cfg.yaml` file.
So, I've added your suggestion:

expansions:
tennis: @e 1h30m @a 30m: d @i personal:exercise

Now, I have:

$ python3 etm ~/.etm-mv
Traceback (most recent call last):
File "etm", line 43, in <module>
settings = options.Settings(etmdir).settings
...
File "./etm-mvc/env/lib/python3.6/site-packages/ruamel/yaml/scanner.py", line 1803, in _gather_comments
self.fetch_more_tokens()
File "./etm-mvc/env/lib/python3.6/site-packages/ruamel/yaml/scanner.py", line 321, in fetch_more_tokens
self.reader.get_mark(),
ruamel.yaml.scanner.ScannerError: while scanning for the next token
found character '@' that cannot start any token
in "/home/seba/.etm-mv/cfg.yaml", line 58, column 11

where `line 58, column 11` is the beginning of `@e` from ' tennis: @e 1h30m @a 30m: d @i personal:exercise'.
Changing the line to ' tennis: xxx' solves the problem and etm starts.

Tested on Ubuntu Linux, Python 3.6.7

I hope that my test will help.
Have a nice coding.

----
Sebastian

Daniel Graham

unread,
Feb 27, 2019, 6:31:21 PM2/27/19
to eventandt...@googlegroups.com
Dear Sebastian,

You are a prince! Thanks so much for the comments. I’ve added ruamel.yaml to requirements.txt, fixed the expansions bug and put the commented tennis example in single guotes which ruamel wants with funny characters like @. 

I only hit on using ruamel recently and decided to use it because it allows comments and restores them, if necessary, with changes.

I’ll commit the fixes tonight.

-- Dan

lawquest

unread,
Mar 3, 2019, 3:38:54 PM3/3/19
to Event and Task Manager
Sorry old boy, but I don't use Microsoft products and github is owned by Microsoft.  I will just wait until I can download the new etm some other way.

John

Dan

unread,
Mar 3, 2019, 4:19:50 PM3/3/19
to Event and Task Manager
No problem. I don't like MS much myself but I'm not much worried about them sabotaging github. $7.5 billion is a lot to pay for that when developers can just walk away. A recent article about what developers currently think about the acquisition suggests a 'wait and see' attitude: https://www.theverge.com/2018/6/18/17474284/microsoft-github-acquisition-developer-reaction.

For the foreseeable future, the new etm's home will be on github. I pay nothing for this and thus am not enriching MS. I am currently committing changes there a half dozen times a day. For anyone interested in following or contributing to the development, github is the place.

lawquest

unread,
Mar 11, 2019, 12:50:13 AM3/11/19
to Event and Task Manager
Click on this to better understand why I don't trust Microsoft.


John
Reply all
Reply to author
Forward
0 new messages