Skip to content

Commit

Permalink
Removed test badges
Browse files Browse the repository at this point in the history
  • Loading branch information
DAWacker committed Jul 29, 2013
1 parent 382c048 commit e4b3025
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 23 deletions.
10 changes: 0 additions & 10 deletions LemonadeMain.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,6 @@ def process_buy_upgrade(self, info):
self.upgrades[1]['level'][upgrade_index] += 1
self.upgrades[1]['capacity'][upgrade_index] += base_capacity

self.badges.award('First Upgrade',
'Purchase your very first upgrade')

return True

return False
Expand Down Expand Up @@ -463,10 +460,6 @@ def process_sales(self, max_sales):
if sales > max_sales:
sales = max_sales

if int(sales) >= 10:
self.badges.award('Double Digit Sales',
'Sold more than 10 cups in one day')

return int(sales)

def update_day_log(self, items):
Expand Down Expand Up @@ -585,9 +578,6 @@ def process_change(self, mini_game_key):
if self.profit > 0:
mini_game_success = self.count_game(mini_game_key, self.profit)
if mini_game_success:
self.badges.award('Right on the Money',
'Determined the correct amount of change')

# Give them the money if they added
self.money += self.profit
else:
Expand Down
7 changes: 7 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include *.py *.txt *.gif NEWS README
include activity *.svg *.info
include images *.gif
include olpcgames/COPYING
include olpcgames *.py
include badges.py
include badges *.png
15 changes: 2 additions & 13 deletions badges.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from sugar.datastore import datastore
#from sugar.activity import activity
from datetime import date
import json
import os
Expand All @@ -9,11 +8,9 @@ class badges:

def __init__(self, activity, bundle_id):

#activity_name = activity.get_bundle_name()
#bundle_id = activity.Activity.get_bundle_id()

self._id = bundle_id
ds_objects, num_objects = datastore.find({'activity': activity})
ds_objects, num_objects = datastore.find({'activity': activity,
'has_badges': True})

# Path for all badges
badge_path = os.path.expanduser('~/.local/share/badges')
Expand Down Expand Up @@ -78,11 +75,3 @@ def award(self, name, description):
# Save the new badge info to the DS object
self._list.metadata['badge_list'] = json.dumps(badge_json)
datastore.write(self._list)

def clear(self):
"""
Clears all of the badges that have been awarded by an activity
WARNING: badges will be lost forever, used to testing purposes
"""
self._list.destory()
datastore.delete(self._list.object_id)
Binary file removed badges/100 Sales.png
Binary file not shown.
Binary file removed badges/Double Tags.png
Binary file not shown.
Binary file removed badges/First Upgrade.png
Binary file not shown.
Binary file removed badges/More is Better.png
Binary file not shown.
Binary file removed badges/Right on the Money.png
Binary file not shown.

0 comments on commit e4b3025

Please sign in to comment.