Skip to content

Commit

Permalink
Auto PEP-8
Browse files Browse the repository at this point in the history
  • Loading branch information
smiley committed Apr 10, 2019
1 parent 7dfd224 commit c1a0bb1
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 82 deletions.
12 changes: 8 additions & 4 deletions steamapi/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def from_api_response(api_json, associated_userid=None):
"""
if 'appid' not in api_json:
# An app ID is a bare minimum.
raise ValueError("An app ID is required to create a SteamApp object.")
raise ValueError(
"An app ID is required to create a SteamApp object.")

appid = api_json.appid
name = None
Expand Down Expand Up @@ -76,7 +77,8 @@ def achievements(self):
# No stat data -- at all. This is a hidden app.
return achievements_list
for achievement in self._schema.game.availableGameStats.achievements:
achievement_obj = SteamAchievement(self._id, achievement.name, achievement.displayName, userid)
achievement_obj = SteamAchievement(
self._id, achievement.name, achievement.displayName, userid)
achievement_obj._cache = {}
if achievement.hidden == 0:
store(achievement_obj, "is_hidden", False)
Expand Down Expand Up @@ -112,7 +114,8 @@ def __str__(self):
return self.name

def __hash__(self):
# Don't just use the ID so ID collision between different types of objects wouldn't cause a match.
# Don't just use the ID so ID collision between different types of
# objects wouldn't cause a match.
return hash(('app', self.id))


Expand All @@ -139,7 +142,8 @@ def __init__(self, linked_appid, apiname, displayname, linked_userid=None):
self.unlock_percentage = 0.0

def __hash__(self):
# Don't just use the ID so ID collision between different types of objects wouldn't cause a match.
# Don't just use the ID so ID collision between different types of
# objects wouldn't cause a match.
return hash((self.id, self._appid))

@property
Expand Down
9 changes: 6 additions & 3 deletions steamapi/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

class Enum(object):
def __init__(self):
raise TypeError("Enums cannot be instantiated, use their attributes instead")
raise TypeError(
"Enums cannot be instantiated, use their attributes instead")


class CommunityVisibilityState(Enum):
Expand All @@ -23,9 +24,11 @@ class OnlineState(Enum):
LOOKING_TO_TRADE = 5
LOOKING_TO_PLAY = 6


try:
get_ipython
# We're inside IPython. Define all of IPython's custom function/method names so we could special-case them.
# We're inside IPython. Define all of IPython's custom function/method
# names so we could special-case them.
IPYTHON_PEEVES = ["trait_names", "getdoc"]
IPYTHON_MODE = True
except NameError:
Expand All @@ -36,7 +39,7 @@ class OnlineState(Enum):

# Unindented so that the docstring won't be overly indented.
API_CALL_DOCSTRING_TEMPLATE = \
"""
"""
{name}
Parameters:
Expand Down
Loading

0 comments on commit c1a0bb1

Please sign in to comment.