Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
ptbcli
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Daniele Nicolodi
ptbcli
Commits
2875fd06
Commit
2875fd06
authored
1 year ago
by
Daniele Nicolodi
Browse files
Options
Downloads
Patches
Plain Diff
balance: Improve ledger validation errors reporting
parent
a60c6e5c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
balance.py
+5
-1
5 additions, 1 deletion
balance.py
with
5 additions
and
1 deletion
balance.py
+
5
−
1
View file @
2875fd06
import
click
import
sys
import
tomli
as
toml
import
petl
import
petlutils
...
...
@@ -10,6 +11,7 @@ from os import path
from
orders
import
list_designated_accounts
from
beancount
import
loader
from
beancount.parser.printer
import
print_errors
from
beancount.core
import
amount
,
data
,
inventory
...
...
@@ -42,7 +44,9 @@ def main():
ledger
=
path
.
normpath
(
path
.
expanduser
(
conf
[
'
ledger
'
]))
entries
,
errors
,
options
=
loader
.
load_file
(
ledger
)
assert
not
errors
if
errors
:
print_errors
(
errors
)
sys
.
exit
(
1
)
accounts
=
set
(
list_designated_accounts
(
entries
))
balances
=
cumulative_balances_by_year
(
entries
,
accounts
,
unpack
=
True
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment