Changeset 648 for branches


Ignore:
Timestamp:
Oct 21, 2007 12:01:29 PM (12 years ago)
Author:
jpfasano
Message:

Added function to determine latest stable build number of a project.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/testScripts/NBsvnCommand.py

    r630 r648  
    22
    33import os
     4import urllib2
     5import re
    46
    57import NBlogMessages
     
    2325    retVal='Error'
    2426  return retVal
     27
     28
     29#------------------------------------------------------------------------
     30# Function which returns the latest stable version of a project
     31#------------------------------------------------------------------------
     32def latestStableVersion(project) :
     33  url='https://projects.coin-or.org/svn/'+project+'/stable'
     34  handle=urllib2.urlopen(url)
     35  html=handle.read()
     36  handle.close()
     37
     38  # In html code find the latest version number
     39  #   <li><a href="3.2/">3.2/</a></li>
     40  #   <li><a href="3.3/">3.3/</a></li>
     41  r=r'<li><a href="(\d*\.\d*)/">(\d*\.\d*)/</a></li>'
     42  findResult=re.findall(r,html)
     43  latestStableVersionRepeated2Times = findResult[-1:][0]
     44  latestStableVersion=latestStableVersionRepeated2Times[0]
     45  return latestStableVersion
     46 
     47 
     48 
Note: See TracChangeset for help on using the changeset viewer.