File: updateGuideVersion.py

package info (click to toggle)
yoshimi 2.3.6-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 17,012 kB
  • sloc: cpp: 62,589; xml: 97; sh: 94; python: 45; makefile: 14
file content (25 lines) | stat: -rw-r--r-- 645 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
#!/usr/bin/env python

def scanfile(f):
    ID = f.readline()
    f.close()
    ID = ID.strip()
    pos = ID.find(' ')
    if (pos > 0):
        ID = ID[:pos]
    doc = open("../doc/yoshimi_user_guide/index.html","r+")
    line = "start"
    tofind = '<h1 style="text-align: center;">The Yoshimi User Guide V'
    while line != "":
        linepos=doc.tell()
        line = doc.readline()
        if line:
            if line.find(tofind) > 0:
                doc.seek(linepos)
                doc.write('    '+tofind+ID+'<!--'+'x'*(10-len(ID))+'--></h1>\n')
                line = ""


f = open("../src/version.txt","r+")
if f:
    scanfile(f)