Main Page
Namespaces
Classes
Package Documentation
RecoLuminosity
LumiDB
python
RegexValidator.py
Go to the documentation of this file.
1
import
re
2
class
RegexValidator
(
object
):
3
def
__init__
(self, pattern, statement=None):
4
self.
pattern
= re.compile(pattern)
5
self.
statement
= statement
6
if
not
self.
statement
:
7
self.
statement
=
"must match pattern %s"
% self.
pattern
8
9
def
__call__
(self, string):
10
match = self.pattern.search(string)
11
if
not
match:
12
raise
ValueError(self.
statement
)
13
return
string
14
RegexValidator.RegexValidator.statement
statement
Definition:
RegexValidator.py:5
RegexValidator.RegexValidator
Definition:
RegexValidator.py:2
RegexValidator.RegexValidator.pattern
pattern
Definition:
RegexValidator.py:4
RegexValidator.RegexValidator.__init__
def __init__(self, pattern, statement=None)
Definition:
RegexValidator.py:3
RegexValidator.RegexValidator.__call__
def __call__(self, string)
Definition:
RegexValidator.py:9
resolutioncreator_cfi.object
object
Definition:
resolutioncreator_cfi.py:4
Generated for CMSSW Reference Manual by
1.8.11