From: Stefan Huber Date: Mon, 9 Jun 2008 19:48:52 +0000 (+0200) Subject: Do not add multiple config entries X-Git-Tag: v0.99.0~26 X-Git-Url: https://git.sthu.org/?a=commitdiff_plain;h=8c801b8d27db07d2bc95eb0e7b65e73a31f8a7bf;p=pygdb.git Do not add multiple config entries --- 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):