| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
|
| | |
|
| |
| |
| |
| | |
and reply #ifdev HAVE_ with #if HAVE_
|
| | |
|
| |
| |
| |
| | |
kudos to @spacefrogg
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
|\ |
|
| |\
| | |
| | | |
Fix generation of API documentation and prepare for publishing on ledger-cli.org
|
| | | |
|
| | | |
|
| |/ |
|
|/ |
|
| |
|
|
|
|
| |
This is needed to avoid a possible divide by zero.
|
| |
|
| |
|
|
|
|
| |
For details see https://www.boost.org/doc/libs/1_81_0/libs/filesystem/doc/deprecated.html
|
|
|
|
| |
minimizing use of deprecated API where possible.
|
| |
|
| |
|
| |
|
|
|
|
| |
[skip ci]
|
|
|
|
| |
Code clean-up
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Setters for types wrapped in boost::optional, such as item_t::note were
broken, e.g. setting a note on a transaction resulted in garbled data
that would cause Python to throw utf-8 errors when retrieving the note.
(But setters that accessed strings directly, e.g. "payee" on a transaction
worked fine.)
This change alters the from-python conversion for optional-wrapped
types based on the example at
https://stackoverflow.com/questions/36485840/wrap-boostoptional-using-boostpython
and a test case to verify the behavior.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Ledger's expression parser considers quoted_rfc4180 to be an
amount (quantity 4180 of commodity "quoted_rfc").
Fixes #2007.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
1. Remove references to modules (exceptions, StringIO) no longer needed for Pythn3
2. Use assertEqual instead of assertEquals
3. Clear journal files with a close_journal_files() function that uses the then-current underlying python_session pointer. Calling session.close_journal_files() sometimes leads to segfaults because python_session has changed after it was injected into the python module (as "session") on module startup.
|
|
|
|
|
|
| |
Added ledger.session.error_context()
to py_session.cc to get the error context
message when exceptions are thrown.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In `ledger xml` export, include the `<posting>`-specific payee (from the
`Payee:` tag) as `<payee>`. This data is already included under
`<metadata>` as `<value key="Payee">`, but that is more specific to
Ledger's implementation; if in the future there is another way to set
the payee (or perhaps an option to have the Payee tag in one's own
language), that field wouldn't be a reliable method of getting this
info.
Example:
2022-01-01 Transaction-level payee
a 10
b ; Payee: Posting-level payee
Relevant XML output:
<transaction>
<date>2022-01-01</date>
<payee>Transaction-level payee</payee>
<postings>
<posting>
<account ref="0000558defd6f260">
<name>a</name>
</account>
<post-amount>
<amount>
<quantity>10</quantity>
</amount>
</post-amount>
<total>
<amount>
<quantity>10</quantity>
</amount>
</total>
</posting>
<posting>
<payee>Posting-level payee</payee>
<account ref="0000558defd6f960">
<name>b</name>
</account>
<post-amount>
<amount>
<quantity>-10</quantity>
</amount>
</post-amount>
<note> Payee: Posting-level payee</note>
<metadata>
<value key="Payee">
<string>Posting-level payee</string>
</value>
</metadata>
<total>
<amount>
<quantity>0</quantity>
</amount>
</total>
</posting>
</postings>
</transaction>
|
|
|
|
|
|
| |
to ensure access macros are only called on "legacy" unicode string
objects that are "ready".
See https://docs.python.org/3/c-api/unicode.html#c.PyUnicode_READY
|
|
|
|
|
|
| |
Add test to python/demo.py
Fixes #2132
|
|
|
|
| |
Add test to python/demo.py
|
| |
|
|
|
|
|
|
|
|
| |
replacing it with APIs introduced in Python 3.3 to ensure ledger's
Python bindings continue to function when the legacy Unicode API is
removed in Python 3.12.
For details see https://docs.python.org/3.10/c-api/unicode.html
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before, `ledger python -- -c 'raise RuntimeError'` would terminate
messily via SIGABRT, printing the following:
terminate called after throwing an instance of 'int'
[1] 2151711 abort (core dumped) ledger python -c 'raise RuntimeError'
This change makes the python subcommand throw a standard C++ exception
rather than just a plain int, which is never caught and triggers the
SIGABRT. Now, the process prints the uncaught Python exception as
usual and then exits with exit code 1.
|
| |
|
| |
|