Release coccinelle-0.2.3rc1
[bpt/coccinelle.git] / python / coccilib / org.py
index 6b2484a..7f96732 100644 (file)
@@ -2,10 +2,12 @@ def build_link(p, msg, color) :
        return "[[view:%s::face=%s::linb=%s::colb=%s::cole=%s][%s]]" % (p.file,color,p.line,p.column,p.column_end,msg)
 
 def print_todo(p, msg="", color="ovl-face1") :
+       if msg == "" : msg = "%s::%s" % (p.file,p.line)
        link = build_link(p, msg, color)
        print "* TODO %s" % (link)
 
 def print_link(p, msg="", color="ovl-face1") :
+       if msg == "" : msg = "%s::%s" % (p.file,p.line)
        print (build_link(p, msg, color))
 
 def print_safe_todo(p, msg="", color="ovl-face1") :
@@ -21,7 +23,10 @@ def print_safe_link(p, msg="", color="ovl-face1") :
 # will be deprecated.
 #
 def print_main(msg, p, color="ovl-face1") :
-       oldmsgfmt = "%s %s::%s" % (msg,p[0].file,p[0].line)
+       if msg == "" :
+               oldmsgfmt = "%s::%s" % (p[0].file,p[0].line)
+       else:
+               oldmsgfmt = "%s %s::%s" % (msg,p[0].file,p[0].line)
        print_todo(p[0], oldmsgfmt, color)
 
 def print_sec(msg, p, color="ovl-face2") :