parameters: (self, factory, default='File')
return_statement: return factory
docstring: Return a factory function for creating Nodes for this
          construction environment.
docstring_summary: Return a factory function for creating Nodes for this
          construction environment.
docstring_tokens: Return a factory function for creating Nodes for this construction environment .
function: def get_factory(self, factory, default='File'):
          """Return a factory function for creating Nodes for this
          construction environment.
          """
          name = default
          try:
              is_node = issubclass(factory, SCons.Node.FS.Base)
          except TypeError:
              # The specified factory isn't a Node itself--it's
              # most likely None, or possibly a callable.
              pass
          else:
              if is_node:
                  # The specified factory is a Node (sub)class.  Try to
                  # return the FS method that corresponds to the Node's
                  # name--that is, we return self.fs.Dir if they want a Dir,
                  # self.fs.File for a File, etc.
                  try: name = factory.__name__
                  except AttributeError: pass
                  else: factory = None
          if not factory:
              # They passed us None, or we picked up a name from a specified
              # class, so return the FS method.  (Note that we *don't*
              # use our own self.{Dir,File} methods because that would
              # cause env.subst() to be called twice on the file name,
              # interfering with files that have $$ in them.)
              factory = getattr(self.fs, name)
          return factory
function_tokens: def get_factory ( self , factory , default = 'File' ) : name = default try : is_node = issubclass ( factory , SCons . Node . FS . Base ) except TypeError : # The specified factory isn't a Node itself--it's # most likely None, or possibly a callable. pass else : if is_node : # The specified factory is a Node (sub)class.  Try to # return the FS method that corresponds to the Node's # name--that is, we return self.fs.Dir if they want a Dir, # self.fs.File for a File, etc. try : name = factory . __name__ except AttributeError : pass else : factory = None if not factory : # They passed us None, or we picked up a name from a specified # class, so return the FS method.  (Note that we *don't* # use our own self.{Dir,File} methods because that would # cause env.subst() to be called twice on the file name, # interfering with files that have $$ in them.) factory = getattr ( self . fs , name ) return factory