Skip to content

Instantly share code, notes, and snippets.

@brad-anton
Created June 14, 2016 18:25
Show Gist options
  • Save brad-anton/a8a94a8e8bf5f69a3502f8433a182568 to your computer and use it in GitHub Desktop.
Save brad-anton/a8a94a8e8bf5f69a3502f8433a182568 to your computer and use it in GitHub Desktop.
def __check_preferences_json(self, preferences):
"""Pulls Extension information out of the preferences file
"""
extensions = []
with open(preferences, 'rb') as f:
prefs_json = json.load(f)
extensions_json = prefs_json['extensions']['settings']
for extension in extensions_json.iterkeys():
name = None
version = None
if 'manifest' in extensions_json[extension]:
name = extensions_json[extension]['manifest']['name']
version = extensions_json[extension]['manifest']['version']
#e = Extension(self.os.CHROME_NAME, name, version, None, extension)
e = Extension(name, version, None, extension)
extensions.append(e.todict())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment