New issue 220: bean-query fails importing readline on native Windows
https://bitbucket.org/blais/beancount/issues/220/bean-query-fails-importing-readline-on

Jeff Brantley:

When running natively on Windows, bean-query fails to launch because 
beancount.query.shell uses readline, which is unavailable.

I have experimented with the following options:
1. Make readline optional by catching ImportError and setting the value of a 
file-level variable has_readline, then condition the body of each file-level 
function using readline on whether has_readline. I was able to run a sample 
query this way, and Windows CMD naturally provides program-scoped history 
across multiple bean-query runs until I exit the CMD instance, which is similar 
to the python shell behavior.

2. Install pyreadline (pip install pyreadline) and run bean-query without 
modification. This worked, too, and resulted in history persisting across 
instances of CMD.

Question: does beancount provide any facility for explicitly-saved (e.g., with 
a nickname) queries for later recall, or is the readline-style history the sole 
mechanism? I guess one could at least write a wrapper script that does a 
one-shot call to bean-query...

So, I see the following options:
1. Adopt approach #1. Simple. Impact could be mitigated by writing wrapper 
scripts to invoke bean-query with favorite queries. Does beancount have a 
feature for saved queries?

2. Depend on pyreadline explicitly on Windows. I haven't looked into whether a 
conditional dependency is difficult. FWIW, the project is abandoned.

3. Do approach #1, but log a warning about it with a suggestion to install 
pyreadline, leaving it to the user's discretion.

@blais , would you like to weigh in? I'm happy to do the work.


-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20180224225059.34989.27181%40celery-worker-108.ash1.bb-inf.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to