CMS 3D CMS Logo

Classes | Functions | Variables
GenObject Namespace Reference

Classes

class  GenObject
 

Functions

def setQuietWarn (quiet=True)
 
def warn (*args, **kwargs)
 

Variables

 filenameRE
 
 quietWarn
 

Function Documentation

◆ setQuietWarn()

def GenObject.setQuietWarn (   quiet = True)

Definition at line 27 of file GenObject.py.

27 def setQuietWarn (quiet = True):
28  global quietWarn
29  quietWarn = quiet
30 
31 

◆ warn()

def GenObject.warn ( args,
**  kwargs 
)
print out warning with line number and rest of arguments

Definition at line 32 of file GenObject.py.

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 
55 

References edm.print().

Referenced by GenObject.GenObject.printTuple().

Variable Documentation

◆ filenameRE

GenObject.filenameRE

Definition at line 23 of file GenObject.py.

◆ quietWarn

GenObject.quietWarn

Definition at line 25 of file GenObject.py.

GenObject.setQuietWarn
def setQuietWarn(quiet=True)
Definition: GenObject.py:27
edm::print
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
GenObject.warn
def warn(*args, **kwargs)
Definition: GenObject.py:32