Skip to content

Instantly share code, notes, and snippets.

@abl
Created April 12, 2013 22:10
Show Gist options
  • Save abl/5375570 to your computer and use it in GitHub Desktop.
Save abl/5375570 to your computer and use it in GitHub Desktop.
#Beginning after the blank line 685 of pebble/pebble.py
if restype == 1:
apps["banks"], apps_installed = unpack("!II", data[1:9])
apps["apps"] = []
appinfo_size = 78
offset = 9
for i in xrange(apps_installed):
app = {}
try:
app["id"], app["index"], app["name"], app["company"], app["flags"], app["version"] = \
unpack("!II32s32sIH", data[offset:offset+appinfo_size])
app["name"] = app["name"].replace("\x00", "")
app["company"] = app["company"].replace("\x00", "")
apps["apps"] += [app]
except:
if offset+appinfo_size > len(data):
log.warn("Couldn't load bank %d; remaining data = %s" % (i,repr(data[offset:])))
else:
raise
offset += appinfo_size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment