CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions | Variables
GenObject Namespace Reference

Classes

class  GenObject
 

Functions

def setQuietWarn
 
def warn
 

Variables

tuple filenameRE = re.compile(r'.+/Validation/Tools/')
 
 quietWarn = False
 

Function Documentation

def GenObject.setQuietWarn (   quiet = True)

Definition at line 26 of file GenObject.py.

26 
27 def setQuietWarn (quiet = True):
28  global quietWarn
29  quietWarn = quiet
30 
def setQuietWarn
Definition: GenObject.py:26
def GenObject.warn (   args,
  kwargs 
)
print out warning with line number and rest of arguments

Definition at line 31 of file GenObject.py.

References print().

31 
32 def warn (*args, **kwargs):
33  """print out warning with line number and rest of arguments"""
34  if quietWarn: return
35  frame = inspect.stack()[1]
36  filename = frame[1]
37  lineNum = frame[2]
38  #print filename, filenameRE
39  filename = filenameRE.sub ('', filename)
40  #print "after '%s'" % filename
41  blankLines = kwargs.get('blankLines', 0)
42  if blankLines:
43  print('\n' * blankLines)
44  spaces = kwargs.get('spaces', 0)
45  if spaces:
46  print(' ' * spaces, end=' ')
47  if len (args):
48  print("%s (%s): " % (filename, lineNum), end=' ')
49  for arg in args:
50  print(arg, end=' ')
51  print()
52  else:
53  print("%s (%s):" % (filename, lineNum))
54 
def warn
Definition: GenObject.py:31
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

Variable Documentation

tuple GenObject.filenameRE = re.compile(r'.+/Validation/Tools/')

Definition at line 22 of file GenObject.py.

GenObject.quietWarn = False

Definition at line 24 of file GenObject.py.