Skip to content

Commit

Permalink
Changed to use properties instead
Browse files Browse the repository at this point in the history
  • Loading branch information
benjhar committed Oct 12, 2019
1 parent f6c587f commit 11ae4df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion foldingathome/Donor.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def __init__(self, donorname, team=0):
self.work_units = self.donor["work_units"]
self.team_id = self.team["team"]

@property
def rank(self):
donors = self.team["donors"]
scores = []
Expand All @@ -36,4 +37,4 @@ def rank(self):
for i in scores:
order.append(max(scores))
scores.pop(scores.index(max(scores)))
return order.index(self.donor["credit"]) + 1
return order.index(self.donor["credit"]) + 1
2 changes: 2 additions & 0 deletions foldingathome/Team.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def __init__(self, team=0):
self.logo = self.team["logo"]
self.stats = self.team

@property
def highest_scorer(self):
donors = self.donors
users_and_scores = {}
Expand All @@ -40,6 +41,7 @@ def highest_scorer(self):
"id": id,
}

@property
def most_wus(self):
donors = self.donors
users_and_scores = {}
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
setup(
name="foldingathome",
packages=["foldingathome"],
version="0.1.4",
version="0.1.5",
license="MIT Licence",
description="A Python wrapper for the Folding@Home API.",
author="leet_hakker",
author_email="[email protected]",
url="https://github.com/thenamesweretakenalready/foldingathome/",
download_url="https://github.com/thenamesweretakenalready/foldingathome/archive/v0.1.4.tar.gz",
download_url="https://github.com/thenamesweretakenalready/foldingathome/archive/v0.1.5.tar.gz",
keywords=["API wrapper", "Python", "Folding@Home"],
install_requires=["requests"],
classifiers=[
Expand Down

0 comments on commit 11ae4df

Please sign in to comment.