projects
/
pygdb.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- adapted pygdb.vim
[pygdb.git]
/
Configuration.py
diff --git
a/Configuration.py
b/Configuration.py
index e3ee6647950b74d6b7efd58166ecf6f0fcca7889..1aeb258a48320eeeb1b27d190fa6aeb6310cd068 100755
(executable)
--- a/
Configuration.py
+++ b/
Configuration.py
@@
-22,7
+22,8
@@
class Configuration:
try:
cnt = 0
#Parse all lines
try:
cnt = 0
#Parse all lines
- for line in file(filename).readlines():
+ f = file(filename, "r")
+ for line in f.readlines():
cnt += 1
#Get command and tail
cnt += 1
#Get command and tail
@@
-38,30
+39,38
@@
class Configuration:
else:
cnt -= 1
print "Unkown command", cmd
else:
cnt -= 1
print "Unkown command", cmd
+ f.close()
return cnt
return cnt
+
except IOError:
return None
def store(self, filename):
except IOError:
return None
def store(self, filename):
+ try:
+ f = file(filename, "w")
- f = file(filename, "w")
+ for b in self.breakpoints:
+ self.__writeBreak(f, b)
-
for b in self.breakpoint
s:
-
self.__writeBreak(f, b
)
+
for w in self.watche
s:
+
self.__writeWatch(f, w
)
-
for w in self.watche
s:
-
self.__writeWatch(f, w
)
+
for s in self.int
s:
+
self.__writeInt(f, s
)
- for s in self.ints:
- self.__writeInt(f, s)
+ f.close()
+ return True
+
+ except IOError:
+ return False
def parseBreak(self, tail):
tail = tail.strip()
def parseBreak(self, tail):
tail = tail.strip()
- rx = re.compile("^[\w\._\-]+:\d+(\s+if\s+\S+.*)?$")
+ rx = re.compile("^[\w
/
\._\-]+:\d+(\s+if\s+\S+.*)?$")
if not rx.search(tail):
print "Wrong breakpoint format:", tail
if not rx.search(tail):
print "Wrong breakpoint format:", tail