Re: bean-bake fails (Windows bash)

2018-11-26 Thread mployby
Update: 

bean-bake --no-colons myledger.beancount 181126
works correctly on cygwin, but on direct windows installation it produces 
links with backward slashes.

For example
file:///c:/myledger/office/181126/view\year\2018\balsheet.html


Instead of 
file:///c:/myledger/office/181126/view/year/2018/balsheet.html

-- 
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 beancount+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/6b1ffbd1-2950-4ffc-a83d-6b64dd84478a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: bean-bake fails (Windows bash)

2018-11-26 Thread mployby
Guys hi,

Still trying to solve this, will appreciate any suggestions on why 
balsheet.html, income.html, index.html... and web.css are not generated.

Might be encoding problem related to "%5C", but not sure. 

-- 
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 beancount+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/7e73a851-a0f9-4df3-8c75-e2866f395fee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: bean-bake fails (Windows bash)

2018-11-19 Thread mployby
Have same issue, using "--no-colons" solved it partially, some of the 
pages/links are not being generated/not working.

Here is log with errors:
K:\at\office>bean-bake --no-colons at.beancount test
Bottle v0.12.13 server starting up (using WSGIRefServer())...
Listening on http://localhost:9475/
Hit Ctrl-C to quit.

INFO: Reloading...
127.0.0.1 - - [19/Nov/2018 21:45:19] "GET / HTTP/1.1" 303 0
ERROR   : Redirected: / -> /index
127.0.0.1 - - [19/Nov/2018 21:45:20] "GET /index HTTP/1.1" 200 5459
INFO: Operation: 'clamp'  Time: 
 3 ms
INFO: Operation: 'realize_opening'Time: 
 0 ms
INFO: Operation: 'realize'Time: 
 3 ms
INFO: Operation: 'realize_closing'Time: 
 2 ms
127.0.0.1 - - [19/Nov/2018 21:45:21] "GET /view/year/2017/balsheet HTTP/1.1" 
200 5464
127.0.0.1 - - [19/Nov/2018 21:45:22] "GET 
/view/year/2017/journal/Equity__Opening-Balances HTTP/1.1" 200 7765
127.0.0.1 - - [19/Nov/2018 21:45:23] "GET 
/view/year/2017/journal/Equity__Earnings__Current HTTP/1.1" 200 29585

127.0.0.1 - - [19/Nov/2018 21:46:03] "GET /view/year/2017/conversions 
HTTP/1.1" 200 2139
127.0.0.1 - - [19/Nov/2018 21:46:04] "GET /view/year/2017/openbal HTTP/1.1" 
200 3768
127.0.0.1 - - [19/Nov/2018 21:46:05] "GET /view/year/2017/journal/all 
HTTP/1.1" 303 0
ERROR   : Redirected: /view/year/2017/journal/all -> /view/year/2017/journal
/
127.0.0.1 - - [19/Nov/2018 21:46:06] "GET /view/year/2017/journal/ HTTP/1.1" 
200 330073
127.0.0.1 - - [19/Nov/2018 21:46:08] "GET 
/view/year/2017/journal/Income__Rewards HTTP/1.1" 200 2690
127.0.0.1 - - [19/Nov/2018 21:46:09] "GET 
/view/year/2017/journal/Expenses__Personal__Books HTTP/1.1" 200 2735

127.0.0.1 - - [19/Nov/2018 21:46:36] "GET /view/year/2017/equity/holdings 
HTTP/1.1" 200 2926
127.0.0.1 - - [19/Nov/2018 21:46:37] "GET /view/year/2017/income HTTP/1.1" 
200 7158
INFO: Operation: 'clamp'  Time: 
 0 ms
INFO: Operation: 'realize_opening'Time: 
 0 ms
INFO: Operation: 'realize'Time: 
16 ms
INFO: Operation: 'realize_closing'Time: 
 7 ms
127.0.0.1 - - [19/Nov/2018 21:46:38] "GET /view/year/2018/balsheet HTTP/1.1" 
200 5942
127.0.0.1 - - [19/Nov/2018 21:46:39] "GET 
/view/year/2018/journal/Equity__Opening-Balances HTTP/1.1" 200 12922

127.0.0.1 - - [19/Nov/2018 21:49:23] "GET /errors HTTP/1.1" 200 1350
127.0.0.1 - - [19/Nov/2018 21:49:24] "GET /resources/web.css HTTP/1.1" 200 
5034
INFO: Validating HTML output files & links.
INFO: Validating: 'test\errors.html'
INFO: Validating: 'test\index.html'
INFO: Validating: 'test\source.html'

INFO: Validating: 'test\view\year\2018\journal\Liabilities__AMEX.html'
INFO: Validating: 
'test\view\year\2018\journal\Liabilities__InkBCash.html'
INFO: Validation: 226 files processed
ERROR   : Validation error: Missing 
'test\view\year\2018\journal\..%5Cbalsheet.html'
ERROR   : Validation error: Missing 
'test\view\year\2018\journal\..%5Cincome.html'
ERROR   : Validation error: Missing 
'test\view\year\2018\journal\..%5Cindex.html'
ERROR   : Validation error: Missing 
'test\view\year\2018\journal\..%5Cequity%5Choldings.html'
ERROR   : Validation error: Missing 
'test\view\year\2018\journal\..%5Ctrial.html'
ERROR   : Validation error: Missing 
'test\view\year\2018\journal\..%5C..%5C..%5C..%5Cindex.html'
ERROR   : Validation error: Missing 
'test\view\year\2018\journal\..%5C..%5C..%5C..%5Cresources%5Cweb.css'
Output in 'test'


-- 
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 beancount+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/e97f0156-f07a-44cb-853a-5237f915bef7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: bean-bake fails (Windows bash)

2017-08-06 Thread Martin Blais
On Sun, Aug 6, 2017 at 7:33 AM,  wrote:

>
>
> On Monday, June 26, 2017 at 2:22:17 AM UTC+10, Martin Blais wrote:
>>
>>
>> Barring this freedom, you can hg update now, I just added an option for
>> you to replace the colon separator in filenames by something else
>> (--no-colons). Try this out and let me know if it works.
>> https://bitbucket.org/blais/beancount/commits/c0c87ed900e8da
>> 044d541bbb75cf3dd5a11ff314
>>
>
> Thanks for this, and sorry for the late reply - I was away. The error
> stays exactly the same.
>
> Looking in the diffs, from what I can gather - I'm not a Python coder - I
> think you're changes (i.e. added no-colons option) are not picked up
> because you are not passing the --no-colons argument when starting the
> server in bake_to_directory(). I.e. the web.scrape_webapp() at line 149 of
> bake.py should have extra web args passed:
>
> processed_urls, skipped_urls = web.scrape_webapp(webargs.filename,
>  callback,
>  webargs.port,
>  ignore_regexps,  
>quiet, *extra_args*)
>
> I think those extra arguments should be built by checking if --no-colons,
> --view and --first-month parameters are present. --first-month is of
> interest to me because Australian financial year starts in July.
>
> I'd appreciate if you can add this - I'm unsure how to do it myself.
>

Spot on.
Apologies for the sloppy fix, I should have done better testing.
Fixed now.

(I think this code needs review anyhow, all the options should be read and
processed in a single place. How these options are passed around has grown
a bit hacky in order to retrofit this "bake" feature and it needs a bit of
care.)



> Cheers,
> S.
>
> --
> 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 beancount+unsubscr...@googlegroups.com.
> To post to this group, send email to beancount@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/beancount/db289178-0a9f-43d8-871b-acf25d42be30%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 beancount+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhNie%3DtvvxcvgrMpJgOUT_tKJjwNvPtTVZ6qhyf-4UOrUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: bean-bake fails (Windows bash)

2017-08-06 Thread short . emini


On Monday, June 26, 2017 at 2:22:17 AM UTC+10, Martin Blais wrote:
>
>
> Barring this freedom, you can hg update now, I just added an option for 
> you to replace the colon separator in filenames by something else 
> (--no-colons). Try this out and let me know if it works.
>
> https://bitbucket.org/blais/beancount/commits/c0c87ed900e8da044d541bbb75cf3dd5a11ff314
>
 
Thanks for this, and sorry for the late reply - I was away. The error stays 
exactly the same.

Looking in the diffs, from what I can gather - I'm not a Python coder - I 
think you're changes (i.e. added no-colons option) are not picked up 
because you are not passing the --no-colons argument when starting the 
server in bake_to_directory(). I.e. the web.scrape_webapp() at line 149 of 
bake.py should have extra web args passed: 

processed_urls, skipped_urls = web.scrape_webapp(webargs.filename,  
   callback,
 webargs.port,  
   ignore_regexps, 
quiet, *extra_args*)

I think those extra arguments should be built by checking if --no-colons, 
--view and --first-month parameters are present. --first-month is of 
interest to me because Australian financial year starts in July.

I'd appreciate if you can add this - I'm unsure how to do it myself.

Cheers,
S.

-- 
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 beancount+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/db289178-0a9f-43d8-871b-acf25d42be30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: bean-bake fails (Windows bash)

2017-06-25 Thread Martin Blais
Might be. I thought this used to work. It's probably that. I have no way to
test.

The most optimal way to fix this (and likely many other problems with
computers in general) is to stop running Windows.

Barring this freedom, you can hg update now, I just added an option for you
to replace the colon separator in filenames by something else
(--no-colons). Try this out and let me know if it works.
https://bitbucket.org/blais/beancount/commits/c0c87ed900e8da044d541bbb75cf3dd5a11ff314






On Sun, Jun 25, 2017 at 8:45 AM,  wrote:

> Using Windows bash, bean-bake fails to bake:
>
> 127.0.0.1 - - [25/Jun/2017 22:43:02] "GET / HTTP/1.1" 303 0
>> ERROR   : Redirected: / -> /index
>> 127.0.0.1 - - [25/Jun/2017 22:43:02] "GET /index HTTP/1.1" 200 6658
>> INFO: Operation: 'realize_opening'
>> Time:  0 ms
>> INFO: Operation: 'realize'
>> Time:  1 ms
>> INFO: Operation: 'realize_closing'
>> Time:  1 ms
>> 127.0.0.1 - - [25/Jun/2017 22:43:02] "GET 
>> /view/tag/trip-chicago-2016/balsheet
>> HTTP/1.1" 200 5128
>> 127.0.0.1 - - [25/Jun/2017 22:43:02] "GET /view/tag/trip-chicago-2016/
>> journal/Equity:Earnings:Current HTTP/1.1" 200 7482
>> Traceback (most recent call last):
>>   File "/usr/local/bin/bean-bake", line 4, in 
>> from beancount.scripts.bake import main; main()
>>   File "/usr/local/lib/python3.5/dist-packages/beancount/scripts/bake.py"
>> , line 247, in main
>> bake_to_directory(opts, output_directory, opts.quiet, opts.full_mode)
>>   File "/usr/local/lib/python3.5/dist-packages/beancount/scripts/bake.py"
>> , line 153, in bake_to_directory
>> quiet)
>>   File "/usr/local/lib/python3.5/dist-packages/beancount/web/web.py",
>> line 1234, in scrape_webapp
>> url_lists = scrape.scrape_urls(url_format, callback, ignore_regexp)
>>   File "/usr/local/lib/python3.5/dist-packages/beancount/web/scrape.py",
>> line 114, in scrape_urls
>> callback(url, response, response_contents, html_root, skipped_urls)
>>   File "/usr/local/lib/python3.5/dist-packages/beancount/scripts/bake.py"
>> , line 116, in save_scraped_document
>> with open(output_filename, 'wb') as outfile:
>> OSError: [Errno 22] Invalid argument: 'example/view/tag/trip-
>> chicago-2016/journal/Equity:Earnings:Current.html'
>>
>
>
> Is this because Windows does not allow colons in file names?
>
> If so, can this be fixed so, say, the dots are used instead?
>
> S.
>
> --
> 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 beancount+unsubscr...@googlegroups.com.
> To post to this group, send email to beancount@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/beancount/45df2138-b6d9-4d9b-a2be-9632f6601afb%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 beancount+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhOd3BCDwi-HVtZd_jN0zE1t1YEmwDxOzTS-Jd-6evyF5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


bean-bake fails (Windows bash)

2017-06-25 Thread short . emini
Using Windows bash, bean-bake fails to bake:

127.0.0.1 - - [25/Jun/2017 22:43:02] "GET / HTTP/1.1" 303 0
> ERROR   : Redirected: / -> /index
> 127.0.0.1 - - [25/Jun/2017 22:43:02] "GET /index HTTP/1.1" 200 6658
> INFO: Operation: 'realize_opening'Time
> :  0 ms
> INFO: Operation: 'realize'Time
> :  1 ms
> INFO: Operation: 'realize_closing'Time
> :  1 ms
> 127.0.0.1 - - [25/Jun/2017 22:43:02] "GET 
> /view/tag/trip-chicago-2016/balsheet HTTP/1.1" 200 5128
> 127.0.0.1 - - [25/Jun/2017 22:43:02] "GET 
> /view/tag/trip-chicago-2016/journal/Equity:Earnings:Current HTTP/1.1" 200 
> 7482
> Traceback (most recent call last):
>   File "/usr/local/bin/bean-bake", line 4, in 
> from beancount.scripts.bake import main; main()
>   File "/usr/local/lib/python3.5/dist-packages/beancount/scripts/bake.py", 
> line 247, in main
> bake_to_directory(opts, output_directory, opts.quiet, opts.full_mode)
>   File "/usr/local/lib/python3.5/dist-packages/beancount/scripts/bake.py", 
> line 153, in bake_to_directory
> quiet)
>   File "/usr/local/lib/python3.5/dist-packages/beancount/web/web.py", 
> line 1234, in scrape_webapp
> url_lists = scrape.scrape_urls(url_format, callback, ignore_regexp)
>   File "/usr/local/lib/python3.5/dist-packages/beancount/web/scrape.py", 
> line 114, in scrape_urls
> callback(url, response, response_contents, html_root, skipped_urls)
>   File "/usr/local/lib/python3.5/dist-packages/beancount/scripts/bake.py", 
> line 116, in save_scraped_document
> with open(output_filename, 'wb') as outfile:
> OSError: [Errno 22] Invalid argument: 
> 'example/view/tag/trip-chicago-2016/journal/Equity:Earnings:Current.html'
>


Is this because Windows does not allow colons in file names?

If so, can this be fixed so, say, the dots are used instead?

S.

-- 
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 beancount+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/45df2138-b6d9-4d9b-a2be-9632f6601afb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.