File: thrift-gen-fix.awk

package info (click to toggle)
python-jaeger-client 4.8.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 920 kB
  • sloc: python: 5,656; makefile: 93; sh: 26; awk: 16
file content (18 lines) | stat: -rw-r--r-- 380 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
BEGIN {six=0}

/^$/ {
    if (six == 0) {
        print "import six";
        print "from six.moves import xrange";
    }
    six = 1
}

{
    gsub(/from ttype/, "from .ttype", $0);
    gsub(/self.__dict__.iteritems\(\)/, "six.iteritems(self.__dict__)", $0);
    if (package_prefix) {
        $0 = gensub(/[[:alnum:]_]+\.ttypes/, package_prefix ".\\0", "g", $0);
    }
    print
}