CMS 3D CMS Logo

Classes | Functions

reference_db Namespace Reference

Classes

class  ReferenceDB

Functions

def ExtractID

Function Documentation

def reference_db::ExtractID (   release)

Definition at line 7 of file reference_db.py.

00008                       :
00009         pattern = re.compile("^CMSSW_(\d+)_(\d+)_(\d+|\D)(_pre(\d+)|_patch(\d+))?")
00010         matching = pattern.match(release)
00011         version = 0
00012         if matching:
00013                 g = matching.groups()
00014                 if(g[2].isdigit()):
00015                         if(g[4] is not None and g[4].isdigit()):
00016                                         version = int(g[0]) * 1000000 + int(g[1]) * 10000 + int(g[2]) * 100 + int(g[4])
00017                         else:
00018                                 version = int(g[0]) * 1000000 + int(g[1]) * 10000 + int(g[2]) * 100
00019                 else:
00020                         version = int(g[0]) * 1000000 + int(g[1]) * 10000 +9999
00021                 if(version is not None):
00022                         return version