File: remove_docstring_types.sh

package info (click to toggle)
sardana 3.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 53,360 kB
  • sloc: python: 82,335; makefile: 118; sh: 61; javascript: 24
file content (19 lines) | stat: -rw-r--r-- 449 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

function remove_docstring_types {
    # Remove most standard docstring type information
    sed -r -i \
        -e '/[ ]+.*"""$/s/:type [^:]+: [^"]+//g' \
        -e '/ :type [^:]+: .*/d' \
        -e '/[ ]+.*"""$/s/:rtype: [^"]+//g' \
        -e '/ :rtype: .+/d' \
        $1
}

DOCTYPED_MODULES=$(rgrep -Icl "    :r\?type" src/sardana)

for MODULE in ${DOCTYPED_MODULES[@]}
do
    echo $MODULE
    remove_docstring_types $MODULE
done