File: org.py

package info (click to toggle)
coccinelle 1.3.0.deb-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 20,888 kB
  • sloc: ml: 96,585; ansic: 23,664; sh: 1,695; perl: 1,576; makefile: 1,002; python: 922; lisp: 832; cpp: 655; awk: 70; csh: 12
file content (36 lines) | stat: -rw-r--r-- 1,263 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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") :
        msg_safe=msg.replace("[","@(").replace("]",")")
        print_todo(p, msg_safe, color)

def print_safe_link(p, msg="", color="ovl-face1") :
        msg_safe=msg.replace("[","@(").replace("]",")")
        print_link(p, msg_safe, color)

#
# print_main, print_sec and print_secs
#
def print_main(msg, p, color="ovl-face1") :
        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") :
        print_link(p[0], msg, color)

def print_secs(msg, ps, color="ovl-face2") :
        for i in ps:
                print_link (i, msg, color)