Skip to content

Commit

Permalink
try moving main function to __main__ module
Browse files Browse the repository at this point in the history
  • Loading branch information
countvajhula committed Nov 27, 2024
1 parent 60ea3fc commit fcf659b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
15 changes: 1 addition & 14 deletions oldabe/money_in/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

from decimal import Decimal, getcontext
from decimal import Decimal
from typing import List, Tuple

from ..accounting import (
Expand Down Expand Up @@ -238,16 +238,3 @@ def process_payments_and_record_updates():
write_valuation(posterior_valuation)
ItemizedPaymentsRepo().extend(new_itemized_payments)
AdvancesRepo().extend(advances)


def main():
# Set the decimal precision explicitly so that we can
# be sure that it is the same regardless of where
# it is run, to avoid any possible accounting errors
getcontext().prec = 10

process_payments_and_record_updates()


if __name__ == "__main__":
main()
15 changes: 15 additions & 0 deletions oldabe/money_in/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from money_in import process_payments_and_record_updates
from decimal import getcontext


def main():
# Set the decimal precision explicitly so that we can
# be sure that it is the same regardless of where
# it is run, to avoid any possible accounting errors
getcontext().prec = 10

process_payments_and_record_updates()


if __name__ == "__main__":
main()

0 comments on commit fcf659b

Please sign in to comment.