Skip to content

Commit

Permalink
Remove debug print statements from __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jcxldn committed Mar 9, 2023
1 parent eed421b commit 131c913
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions xbox/webapi/common/ratelimits/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,6 @@ def __init__(self, *parsed_limits: ParsedRateLimit, type: LimitType):
srl = SingleRateLimit(limit.period, type, limit_num)
self.__limits.append(srl)

# DEBUG: print them
for i in self.__limits:
print(
"Added limit of type %s, limit %s, and limit %i"
% (i.get_limit_type(), i.get_time_period(), i._SingleRateLimit__limit)
)

def get_counter(self) -> int:
"""
This function returns the request counter with the **highest** value.
Expand Down Expand Up @@ -221,20 +214,10 @@ def get_reset_after(self) -> Union[datetime, None]:
# If dates_valid has any elements, return the one with the *later* timestamp.
# This means that if two or more limits have been exceeded, we wait for both to have reset (by returning the later timestamp)
if len(dates_valid) != 0:
dates_valid[0].isoformat
print(
"Valid dates BEFORE sorting: %s"
% list(map(lambda i: i.isoformat(), dates_valid))
)
# By default dates are sorted with the earliest date first.
# We will set reverse=True so that the first element is the later date.
dates_valid.sort(reverse=True)

print(
"Valid dates AFTER sorting: %s"
% list(map(lambda i: i.isoformat(), dates_valid))
)

# Return the datetime object.
return dates_valid[0]

Expand Down

0 comments on commit 131c913

Please sign in to comment.