Skip to content

Commit

Permalink
Added a book icon. Updated the tracker increment function for the new…
Browse files Browse the repository at this point in the history
… amount parameter
  • Loading branch information
Brian Knobbs committed Sep 16, 2014
1 parent 00ec619 commit a551afb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
27 changes: 26 additions & 1 deletion pychievements/icons.py
Expand Up @@ -46,7 +46,7 @@ def achieved(self, tracked_id=None, achievement=None):


############################################################################################
# Some built-in ASCII icons
# Some built-in unicode icons
unicodeCheckBox = Icon('\n\n\n', '\n\n\n')
unicodeCheck = Icon('\n\n\n', '\n\n\n')

Expand Down Expand Up @@ -158,3 +158,28 @@ def achieved(self, tracked_id=None, achievement=None):
''-.oo,oo.-''
"""
earth = Icon(colored.white(_EARTH_STR), colored.yellow(_EARTH_STR))

book = Icon(colored.white("""
_.-"\\
_.-" \\
,-" \\
( \ \\
\ \ \\
\ \ \\
\ \ _.-;
\ \ _.-" :
\ \,-" _.-"
\( _.-"
`--"
"""), colored.yellow("""
_.--._ _.--._
,-=.-":;:;:;\':;:;:;"-._
\\\:;:;:;:;:;\:;:;:;:;:;\\
\\\:;:;:;:;:;\:;:;:;:;:;\\
\\\:;:;:;:;:;\:;:;:;:;:;\\
\\\:;:;:;:;:;\:;::;:;:;:\\
\\\;:;::;:;:;\:;:;:;::;:\\
\\\;;:;:_:--:\:_:--:_;:;\\
\\\_.-" : "-._\\
\`_..--"--.;.--""--.._=>
"""))
4 changes: 2 additions & 2 deletions pychievements/trackers.py
Expand Up @@ -136,7 +136,7 @@ def _check_signals(self, tracked_id, achievement, old_level, old_achieved):
return new_goals
return False

def increment(self, tracked_id, achievement, *args, **kwargs):
def increment(self, tracked_id, achievement, amount=1, *args, **kwargs):
"""
Increments an achievement for a given ``tracked_id``. Achievement can be an ``Achievement``
class or a string of the name of an achievement class that has been registered with this
Expand All @@ -152,7 +152,7 @@ class or a string of the name of an achievement class that has been registered w
achievement = self.achievement_for_id(tracked_id, achievement)
cur_level = achievement.current[0]
achieved = achievement.achieved[:]
achievement.increment(*args, **kwargs)
achievement.increment(amount, *args, **kwargs)
self._backend.set_level_for_id(tracked_id, achievement.__class__, achievement.current[0])
return self._check_signals(tracked_id, achievement, cur_level, achieved)

Expand Down

0 comments on commit a551afb

Please sign in to comment.