Example #1
0
 def save(self):
     users = json.load(open("%s/users.json" % config.data_dir))
     if self.master_address not in users:
         users[self.master_address] = {}  # Create if not exist
     user_data = users[self.master_address]
     if self.master_seed:
         user_data["master_seed"] = self.master_seed
     user_data["sites"] = self.sites
     user_data["certs"] = self.certs
     utils.atomicWrite("%s/users.json" % config.data_dir, json.dumps(users, indent=2, sort_keys=True))
     self.log.debug("Saved")
Example #2
0
 def saveSettings(self):
     sites_settings = json.load(open("%s/sites.json" % config.data_dir))
     sites_settings[self.address] = self.settings
     utils.atomicWrite("%s/sites.json" % config.data_dir, json.dumps(sites_settings, indent=2, sort_keys=True))