17 lines
533 B
Python
17 lines
533 B
Python
|
from verein import Verein
|
||
|
|
||
|
TABLE_HEADING = "account_name,total_balance,available_balance,redeemed"
|
||
|
|
||
|
|
||
|
def export_vereine(vereine: [Verein], export_filename: str):
|
||
|
export_string: str = TABLE_HEADING + '\n'
|
||
|
for verein in vereine:
|
||
|
export_string += line_for_verein(verein) + '\n'
|
||
|
|
||
|
with open(export_filename, 'w') as export_file:
|
||
|
export_file.writelines(export_string)
|
||
|
|
||
|
|
||
|
def line_for_verein(verein: Verein):
|
||
|
return f'{verein.account_name},{verein.total_balance},{verein.available_balance},{verein.redeemed}'
|