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 24 of file GenObject.py.

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

Definition at line 29 of file GenObject.py.

Referenced by GenObject.GenObject.printTuple().

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

Variable Documentation

GenObject.filenameRE

Definition at line 20 of file GenObject.py.

GenObject.quietWarn

Definition at line 22 of file GenObject.py.