def __init__(self): JSON_PATH = os.path.join( u"plugins", PLUGIN_NAME.strip().lower().replace(' ', '_') + '.json') self.dedrmprefs = JSONConfig(JSON_PATH) self.dedrmprefs.defaults['configured'] = False self.dedrmprefs.defaults['bandnkeys'] = {} self.dedrmprefs.defaults['adeptkeys'] = {} self.dedrmprefs.defaults['ereaderkeys'] = {} self.dedrmprefs.defaults['kindlekeys'] = {} self.dedrmprefs.defaults['androidkeys'] = {} self.dedrmprefs.defaults['pids'] = [] self.dedrmprefs.defaults['serials'] = [] self.dedrmprefs.defaults['adobewineprefix'] = "" self.dedrmprefs.defaults['kindlewineprefix'] = "" # initialise # we must actually set the prefs that are dictionaries and lists # to empty dictionaries and lists, otherwise we are unable to add to them # as then it just adds to the (memory only) dedrmprefs.defaults versions! if self.dedrmprefs['bandnkeys'] == {}: self.dedrmprefs['bandnkeys'] = {} if self.dedrmprefs['adeptkeys'] == {}: self.dedrmprefs['adeptkeys'] = {} if self.dedrmprefs['ereaderkeys'] == {}: self.dedrmprefs['ereaderkeys'] = {} if self.dedrmprefs['kindlekeys'] == {}: self.dedrmprefs['kindlekeys'] = {} if self.dedrmprefs['androidkeys'] == {}: self.dedrmprefs['androidkeys'] = {} if self.dedrmprefs['pids'] == []: self.dedrmprefs['pids'] = [] if self.dedrmprefs['serials'] == []: self.dedrmprefs['serials'] = []
def __init__(self): JSON_PATH = os.path.join(u"plugins", PLUGIN_NAME.strip().lower().replace(" ", "_") + ".json") self.dedrmprefs = JSONConfig(JSON_PATH) self.dedrmprefs.defaults["configured"] = False self.dedrmprefs.defaults["bandnkeys"] = {} self.dedrmprefs.defaults["adeptkeys"] = {} self.dedrmprefs.defaults["ereaderkeys"] = {} self.dedrmprefs.defaults["kindlekeys"] = {} self.dedrmprefs.defaults["androidkeys"] = {} self.dedrmprefs.defaults["pids"] = [] self.dedrmprefs.defaults["serials"] = [] self.dedrmprefs.defaults["adobewineprefix"] = "" self.dedrmprefs.defaults["kindlewineprefix"] = "" # initialise # we must actually set the prefs that are dictionaries and lists # to empty dictionaries and lists, otherwise we are unable to add to them # as then it just adds to the (memory only) dedrmprefs.defaults versions! if self.dedrmprefs["bandnkeys"] == {}: self.dedrmprefs["bandnkeys"] = {} if self.dedrmprefs["adeptkeys"] == {}: self.dedrmprefs["adeptkeys"] = {} if self.dedrmprefs["ereaderkeys"] == {}: self.dedrmprefs["ereaderkeys"] = {} if self.dedrmprefs["kindlekeys"] == {}: self.dedrmprefs["kindlekeys"] = {} if self.dedrmprefs["androidkeys"] == {}: self.dedrmprefs["androidkeys"] = {} if self.dedrmprefs["pids"] == []: self.dedrmprefs["pids"] = [] if self.dedrmprefs["serials"] == []: self.dedrmprefs["serials"] = []