File: asc2title.py

package info (click to toggle)
debian-reference 2.128
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 31,588 kB
  • sloc: python: 586; makefile: 572; sh: 526; sed: 80
file content (24 lines) | stat: -rwxr-xr-x 582 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python3
# vim: set sts=4 expandtab:
"""
asc2title - convert an AsciiDoc titles

Copyright (C) 2009 Osamu Aoki, GPL
"""

import sys, os, re, string

VERSION = '1.0.1'

if __name__ == '__main__':

    for line in sys.stdin.readlines():
        line=line[0:-1]
        if line[0:1] == "=":
            line = re.sub(r'^=+ +([^ ].*[^ ]) *=*',r'\1',line)
            print(line)
#    entityname=pop-$(echo $package |tr "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" "abcdefghijklmnopqrstuvwxyzabcdefghij"| \
#               tr -d " \!#\$%()=\-~^|\\/+*,.?;:@\`\"'&><")
# 32 char