ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/TWikiIB/makeExternalInfo.py
Revision: 1.1
Committed: Mon Sep 7 09:46:41 2009 UTC (15 years, 7 months ago) by geonmo
Content type: text/x-python
Branch: MAIN
CVS Tags: HEAD
Log Message:
New integration build page using TWiki

File Contents

# Content
1 #!/usr/bin/env python
2
3 # make sure this is first to trap also problems in includes later
4
5 import os, sys, time, re
6
7
8
9 class makeExternalInfo(object):
10
11 def __init__(self, externalInfo,packagename,day,arch):
12 import config
13 self.externalInfo = open(config.siteInfo['IBPath']+externalInfo,'w')
14 self.packagename = packagename
15 self.day =day
16 self.arch = arch
17 self.externalInfo.write('%META:TOPICINFO{author="GunmoRyu" date="1249052809" format="1.1" version="1.1"}%\n')
18 self.externalInfo.write('%META:TOPICPARENT{name="'+packagename+'"}%\n')
19 self.externalInfo.write('---+*'+self.packagename+' External Tools Versions Information*\n')
20 self.externalInfo.write('---------------------\n')
21 self.externalInfo.write('| *Package* | *Version* |\n')
22 def __del__(self):
23 self.externalInfo.write('-- Main.GunmoRyu - 31 Jul 2009\n')
24 self.externalInfo.close()
25
26
27 # --------------------------------------------------------------------------------
28
29 def analyzeLogFile(self, lines):
30
31 externalRe = re.compile('^<TR><TD>(\w+)</TD><TD>( \w+|\w+-\w+)</TD></TR>$')
32 for line in lines:
33 external = re.match(externalRe,line.replace('.','_'))
34 if external :
35 self.externalInfo.write('| !'+external.group(1)+' | '+ external.group(2)+' |\n')
36
37 # --------------------------------------------------------------------------------
38
39 def makeLog(self):
40
41
42 url = 'https://macms01.cern.ch/ap/ignominy/'+self.arch+'/'+self.packagename+'/igRun/versions'
43 lines = []
44 page = os.popen('wget --no-check-certificate -nv -o /dev/null -O- '+url)
45
46 try:
47 lines = page.readlines()
48 page.close()
49 except:
50 self.externalInfo.write("no log\n")
51 return
52
53 self.analyzeLogFile(lines)
54
55 return
56
57
58
59 if __name__ == '__main__' :
60 pass
61
62
63
64