[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/metacode umldoc.py umltool.py
From: |
Asko Soukka |
Subject: |
[Gzz-commits] gzz/metacode umldoc.py umltool.py |
Date: |
Tue, 07 Jan 2003 03:48:29 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Asko Soukka <address@hidden> 03/01/07 03:48:29
Modified files:
metacode : umldoc.py umltool.py
Log message:
replaced asserts with umlException, rst-loop won't break with them
anymore
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/umldoc.py.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/umltool.py.diff?tr1=1.16&tr2=1.17&r1=text&r2=text
Patches:
Index: gzz/metacode/umldoc.py
diff -u gzz/metacode/umldoc.py:1.12 gzz/metacode/umldoc.py:1.13
--- gzz/metacode/umldoc.py:1.12 Thu Jan 2 04:36:33 2003
+++ gzz/metacode/umldoc.py Tue Jan 7 03:48:29 2003
@@ -119,7 +119,11 @@
#the second pass, compile and embed diagrams
for path in sys.argv[1:]:
- run_embed(path)
+ try:
+ run_embed(path)
+ except umltool.umlException, e:
+ print 'umlException exception occurred:', e.value
+ break
if not loop: break
print "\n\nUMLdoc finished. Press Enter to recompile.\n"+ \
Index: gzz/metacode/umltool.py
diff -u gzz/metacode/umltool.py:1.16 gzz/metacode/umltool.py:1.17
--- gzz/metacode/umltool.py:1.16 Sun Jan 5 11:11:34 2003
+++ gzz/metacode/umltool.py Tue Jan 7 03:48:29 2003
@@ -88,6 +88,12 @@
stack.append(new)
return stack[0][1]
+class umlException(Exception):
+ def __init__(self, value):
+ self.value = value
+ def __str__(self):
+ return self.value
+
class namedEl:
def docontents(self, l):
global curList
@@ -240,7 +246,7 @@
elif s == "return":
pass
else:
- assert 0, "Must have call or return, not '"+s+"'"
+ raise umlException("Must have call or return, not '"+s+"'")
return l
def setupCode(self):
return self.repl(
@@ -505,7 +511,7 @@
if mat:
self.role = mat.group(1)
continue
- assert 0, "Invalid assoc adorn "+el
+ raise umlException("Invalid assoc adorn "+el)
def setupCode(self):
s = """
picture %%.multi, %%.role;
@@ -575,7 +581,9 @@
self.var = var or randomVar()
self.name = ""
ends = s.split()
- assert len(ends) == 2
+ #assert len(ends) == 2
+ if len(ends) != 2:
+ raise umlException("len(ends) != 2")
self.start = ends[0]
self.end = ends[1]
def setupCode(self):
@@ -708,7 +716,7 @@
elif key == "left-of": type = leftOf
elif key == "right-of": type = rightOf
else:
- assert 0, "Unknown key! "+key
+ raise umlException("Unknown key! "+key)
return type
def setupCode(self):
"The code to set up the metapost objects for user geometry code"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz/metacode umldoc.py umltool.py,
Asko Soukka <=