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

def GenObject.setQuietWarn (   quiet = True)

Definition at line 25 of file GenObject.py.

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

Definition at line 30 of file GenObject.py.

Referenced by GenObject.GenObject.printTuple().

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

Variable Documentation

GenObject.filenameRE

Definition at line 21 of file GenObject.py.

GenObject.quietWarn

Definition at line 23 of file GenObject.py.