extralife_io

Holds all the file and internet input and output.

class eldonationtracker.extralife_IO.ParticipantConf

Bases: object

Holds Participant Configuaration info.

fields = {'currency_symbol': None, 'donation_sound': None, 'donors_to_display': None, 'extralife_id': None, 'team_id': None, 'text_folder': None, 'tracker_image': None}
get_CLI_values()

Return data required for a CLI-only run.

get_GUI_values()

Return values needed for the GUI.

get_if_in_team()

Return True if participant is in a team.

get_text_folder_only()

Return text folder data.

get_tracker_image()

Return the tracker image location on disk.

get_tracker_sound()

Return the donation sound image location on disk.

get_version()

Return version.

get_version_mismatch()

Return bool of whether there is a version mismatch.

load_JSON()

Load in the config file.

participant_conf_version = '1.0'
reload_JSON()

Reload JSON and update the fields.

update_fields()

Update fields with data from JSON.

version_mismatch = False
write_config(config, default)

Write config to file.

At this point, only called from GUI. Commandline user is expected to edit file manually.

eldonationtracker.extralife_IO.get_JSON(url, order_by_donations=False)

Grab JSON from server.

Connects to server and grabs JSON data from the specified URL.

eldonationtracker.extralife_IO.multiple_format(donors, message, horizontal, currency_symbol, how_many)

Create text for multi-donor output files.

eldonationtracker.extralife_IO.single_format(donor, message, currency_symbol)

Take donor, bool of whether it has a message, and a currency symbol. Then return formatted text for creating the output files.

eldonationtracker.extralife_IO.write_text_files(dictionary, text_folder)

Write info to text files.