From 8c801b8d27db07d2bc95eb0e7b65e73a31f8a7bf Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Mon, 9 Jun 2008 21:48:52 +0200 Subject: [PATCH] Do not add multiple config entries --- Configuration.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Configuration.py b/Configuration.py index a8b4abf..e3ee664 100755 --- a/Configuration.py +++ b/Configuration.py @@ -108,14 +108,20 @@ class Configuration: f.write("watch %(expr)s\n" % w) - def addBreak(self, file, lineno, cond=None): - self.breakpoints += [ {"file" : file, "lineno" : lineno, "cond" : cond} ] + def addBreak(self, file, lineno, cond=None): + bp = {"file" : file, "lineno" : lineno, "cond" : cond} + if not bp in self.breakpoints: + self.breakpoints += [bp] def addInt(self, name, val): - self.ints += [{"name": name, "val": val}] + i = {"name": name, "val": val} + if not i in self.ints: + self.ints += [i] def addWatch(self, expr): - self.watches += [ {"expr" : expr.strip() } ] + w = {"expr" : expr.strip() } + if not w in self.watches: + self.watches += [w] def findInt(self, name): -- 2.39.5