-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgensrclog.py
More file actions
25 lines (22 loc) · 768 Bytes
/
gensrclog.py
File metadata and controls
25 lines (22 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import commands
svninfo=commands.getoutput("svn info")
svndiff=commands.getoutput("svn diff")
fout=open("srclog.f90","w")
fout.write("!Warning: this is automatically generated file\n")
fout.write("subroutine srclog\n")
fout.write("implicit none\n")
fout.write("open(190,file=\"source-code.log\",status=\"replace\",form=\"formatted\")\n")
fout.write("write(190,'(\"Output of ''svn info''\")')\n")
t=svninfo.splitlines()
for s in t:
fout.write("write(190,'(\""+s+"\")')\n")
fout.write("write(190,*)\n")
fout.write("write(190,'(\"Output of ''svn diff''\")')\n")
t=svndiff.splitlines()
for s in t:
s=s.replace("'","''")
s=s.replace("\"","\"\"")
fout.write("write(190,'(\""+s+"\")')\n")
fout.write("close(190)\n")
fout.write("return\n")
fout.write("end\n")