Skip to content

Commit

Permalink
Merge pull request #203 from djotaku/fix-teamupdates
Browse files Browse the repository at this point in the history
Fixing team info not updating
  • Loading branch information
djotaku authored Nov 24, 2022
2 parents d8f6312 + 0b2d9a0 commit 49ed33e
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linttest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10.5
- name: Set up Python 3.10.8
uses: actions/setup-python@v1
with:
python-version: 3.10.5
python-version: 3.10.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windowsbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10.5
- name: Set up Python 3.10.8
uses: actions/setup-python@v1
with:
python-version: 3.10.5
python-version: 3.10.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion eldonationtracker/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

__version__ = "7.4.8"
__version__ = "7.4.9"

base_api_url: str = "https://www.extra-life.org/api"
api_version_suffix: str = "?version=1.2"
Expand Down
24 changes: 22 additions & 2 deletions eldonationtracker/api/participant.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,24 @@ def __init__(self, config):
self._donors_to_display) = self.config.get_cli_values()
donor_drive_participant.Participant.__init__(self, self._extralife_id, self._text_folder, self._currency_symbol,
self._team_id, self._donors_to_display, base_api_url)
if self.team_id:
self._my_team = team.Team(self.team_id, self.text_folder, self.currency_symbol, self.donors_to_display,
self._base_api_url)

def set_config_values(self) -> None:
"""Set participant values, create URLs, and create Team."""
# urls
self._participant_url = f"{self._base_api_url}/participants/{self.donor_drive_id}"
self._donation_url = f"{self.participant_url}/donations"
self._participant_donor_url = f"{self.participant_url}/donors"
self._badge_url = f"{self.participant_url}/badges"
self._milestone_url = f"{self.participant_url}/milestones"
self._incentive_url = f"{self.participant_url}/incentives"
self._activity_url = f"{self.participant_url}/activity"

if self.team_id:
self._my_team = team.Team(self.team_id, self.text_folder, self.currency_symbol, self.donors_to_display,
self._base_api_url)

def output_participant_data(self) -> None: # pragma: no cover
"""Format participant data and write to text files for use by OBS or XSplit.
Expand Down Expand Up @@ -92,13 +110,15 @@ def output_milestone_data(self) -> None: # pragma: no cover
}
self.write_text_files(milestone_output)

def output_incentive_data(self) -> None: # pragma: no cover
def output_incentive_data(self) -> None: # pragma: no cover
"""Write out the incentive data to a text file."""
if not self.incentives:
return
for incentive in self.incentives:
incentive_folder = f"{self.text_folder}incentives/{incentive.incentive_id}"
incentive_dictionary = {"amount": str(incentive.amount), "description": incentive.description, "quantity": str(incentive.quantity), "quantity_claimed": str(incentive.quantity_claimed)}
incentive_dictionary = {"amount": str(incentive.amount), "description": incentive.description,
"quantity": str(incentive.quantity),
"quantity_claimed": str(incentive.quantity_claimed)}

extralife_io.write_text_files(incentive_dictionary, incentive_folder)
if incentive.incentive_image_url:
Expand Down
4 changes: 2 additions & 2 deletions eldonationtracker/ui/call_main_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from PyQt5.QtWidgets import (QApplication, QInputDialog, QMainWindow,
QMessageBox)

import eldonationtracker.api.participant as participant
import eldonationtracker.utils.update_available
from eldonationtracker import file_logging
from eldonationtracker.api import participant as participant
from eldonationtracker.ui import (call_about, call_logs, call_settings,
call_tracker)
from eldonationtracker.ui import main_gui as design
Expand All @@ -27,7 +27,7 @@ class ELDonationGUI(QMainWindow, design.Ui_MainWindow):
"""The main ui Window."""

def __init__(self):
"""Setup the GUI.
"""Set up the GUI.
Set up QTimers:
1) to allow the text on the GUI to update without blocking the user from interacting with the GUI.
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ coverage==6.4.1
dill==0.3.5.1
distlib==0.3.4
docutils==0.18.1
donordrivepython==1.4.4
donordrivepython==1.4.5
filelock==3.7.1
identify==2.5.1
idna==3.3
Expand Down

0 comments on commit 49ed33e

Please sign in to comment.