def update(self):
raise(AssertionError("<STR_LIT>"))<EOL>new_ids = []<EOL>old_ids = []<EOL>for chain in self.chains:<EOL><INDENT>if (self.verbose): print(self.pre, "<STR_LIT>", chain, chain.get__id(), chain.get_address(), chain._id)<EOL>old_ids.append(chain.get__id())<EOL><DEDENT>devices = []<EOL>for dic in self.datamodel.camera_collection.get():<EOL><INDENT>if (self.verbose): print(self.pre, "<STR_LIT>", dic)<EOL>if (dic["<STR_LIT>"] == DataModel.RTSPCameraRow.__name__):<EOL><INDENT>devices.append(dic)<EOL><DEDENT><DEDENT>devices_by_id={}<EOL>for dic in devices: <EOL><INDENT>_id = dic["<STR_LIT>"]<EOL>new_ids.append(_id)<EOL>devices_by_id[_id] = dic<EOL><DEDENT>if (self.verbose):<EOL><INDENT>print(self.pre, "<STR_LIT>", new_ids)<EOL>print(self.pre, "<STR_LIT>", old_ids)<EOL><DEDENT>add_list = list(set(new_ids).difference(set(old_ids))) <EOL>rem_list = list(set(old_ids).difference(set(new_ids))) <EOL>if (self.verbose):<EOL><INDENT>print(self.pre, "<STR_LIT>", add_list)<EOL>print(self.pre, "<STR_LIT>", rem_list)<EOL><DEDENT>for i, chain in enumerate(self.chains):<EOL><INDENT>if (chain.get__id() in rem_list):<EOL><INDENT>chain_ = self.chains.pop(i)<EOL>if (self.verbose): print(self.pre, "<STR_LIT>", chain_)<EOL>chain_.close()<EOL><DEDENT><DEDENT>for new_address in add_list:<EOL><INDENT>dic = devices_by_id[new_address]<EOL>chain = ManagedFilterchain( <EOL>livethread  = self.livethread,<EOL>openglthreads<EOL>= self.gpu_handler.openglthreads,<EOL>address     = DataModel.RTSPCameraRow.getMainAddressFromDict(dic),<EOL>slot        = dic["<STR_LIT>"],<EOL>_id         = dic["<STR_LIT>"],<EOL>msreconnect = <NUM_LIT>,<EOL>verbose = True<EOL>)<EOL>if (self.verbose): print(self.pre, "<STR_LIT>", chain)<EOL>self.chains.append(chain)<EOL><DEDENT>
Reads all devices from the database.  Creates new filterchains and removes old ones

        TODO: currently this is broken: if user changes any other field than the ip address, the cameras don't get updated