parameters: (self, module_name, location=None, basename=None)
docstring: Initialize the module for a project.
  
          module-name is the name of the project module.
          location is the location (directory) of the project to initialize.
                   If not specified, standalone project will be initialized
docstring_summary: Initialize the module for a project.
docstring_tokens: Initialize the module for a project .
function: def initialize(self, module_name, location=None, basename=None):
          """Initialize the module for a project.
  
          module-name is the name of the project module.
          location is the location (directory) of the project to initialize.
                   If not specified, standalone project will be initialized
          """
          assert isinstance(module_name, basestring)
          assert isinstance(location, basestring) or location is None
          assert isinstance(basename, basestring) or basename is None
          if "--debug-loading" in self.manager.argv():
              print "Initializing project '%s'" % module_name
  
          # TODO: need to consider if standalone projects can do anything but defining
          # prebuilt targets. If so, we need to give more sensible "location", so that
          # source paths are correct.
          if not location:
              location = ""
  
          attributes = ProjectAttributes(self.manager, location, module_name)
          self.module2attributes[module_name] = attributes
  
          python_standalone = False
          if location:
              attributes.set("source-location", [location], exact=1)
          elif not module_name in ["test-config", "site-config", "user-config", "project-config"]:
              # This is a standalone project with known location. Set source location
              # so that it can declare targets. This is intended so that you can put
              # a .jam file in your sources and use it via 'using'. Standard modules
              # (in 'tools' subdir) may not assume source dir is set.
              attributes.set("source-location", self.loaded_tool_module_path_[module_name], exact=1)
              python_standalone = True
  
          attributes.set("requirements", property_set.empty(), exact=True)
          attributes.set("usage-requirements", property_set.empty(), exact=True)
          attributes.set("default-build", property_set.empty(), exact=True)
          attributes.set("projects-to-build", [], exact=True)
          attributes.set("project-root", None, exact=True)
          attributes.set("build-dir", None, exact=True)
  
          self.project_rules_.init_project(module_name, python_standalone)
  
          jamroot = False
  
          parent_module = None;
          if module_name == "test-config":
              # No parent
              pass
          elif module_name == "site-config":
              parent_module = "test-config"
          elif module_name == "user-config":
              parent_module = "site-config"
          elif module_name == "project-config":
              parent_module = "user-config"
          elif location and not self.is_jamroot(basename):
              # We search for parent/project-root only if jamfile was specified
              # --- i.e
              # if the project is not standalone.
              parent_module = self.load_parent(location)
          else:
              # It's either jamroot, or standalone project.
              # If it's jamroot, inherit from user-config.
              if location:
                  # If project-config module exist, inherit from it.
                  if self.module2attributes.has_key("project-config"):
                      parent_module = "project-config"
                  else:
                      parent_module = "user-config" ;
  
                  jamroot = True ;
  
          if parent_module:
              self.inherit_attributes(module_name, parent_module)
              attributes.set("parent-module", parent_module, exact=1)
  
          if jamroot:
              attributes.set("project-root", location, exact=1)
  
          parent = None
          if parent_module:
              parent = self.target(parent_module)
  
          if not self.module2target.has_key(module_name):
              target = b2.build.targets.ProjectTarget(self.manager,
                  module_name, module_name, parent,
                  self.attribute(module_name, "requirements"),
                  # FIXME: why we need to pass this? It's not
                  # passed in jam code.
                  self.attribute(module_name, "default-build"))
              self.module2target[module_name] = target
  
          self.current_project = self.target(module_name)
function_tokens: def initialize ( self , module_name , location = None , basename = None ) : assert isinstance ( module_name , basestring ) assert isinstance ( location , basestring ) or location is None assert isinstance ( basename , basestring ) or basename is None if "--debug-loading" in self . manager . argv ( ) : print "Initializing project '%s'" % module_name # TODO: need to consider if standalone projects can do anything but defining # prebuilt targets. If so, we need to give more sensible "location", so that # source paths are correct. if not location : location = "" attributes = ProjectAttributes ( self . manager , location , module_name ) self . module2attributes [ module_name ] = attributes python_standalone = False if location : attributes . set ( "source-location" , [ location ] , exact = 1 ) elif not module_name in [ "test-config" , "site-config" , "user-config" , "project-config" ] : # This is a standalone project with known location. Set source location # so that it can declare targets. This is intended so that you can put # a .jam file in your sources and use it via 'using'. Standard modules # (in 'tools' subdir) may not assume source dir is set. attributes . set ( "source-location" , self . loaded_tool_module_path_ [ module_name ] , exact = 1 ) python_standalone = True attributes . set ( "requirements" , property_set . empty ( ) , exact = True ) attributes . set ( "usage-requirements" , property_set . empty ( ) , exact = True ) attributes . set ( "default-build" , property_set . empty ( ) , exact = True ) attributes . set ( "projects-to-build" , [ ] , exact = True ) attributes . set ( "project-root" , None , exact = True ) attributes . set ( "build-dir" , None , exact = True ) self . project_rules_ . init_project ( module_name , python_standalone ) jamroot = False parent_module = None if module_name == "test-config" : # No parent pass elif module_name == "site-config" : parent_module = "test-config" elif module_name == "user-config" : parent_module = "site-config" elif module_name == "project-config" : parent_module = "user-config" elif location and not self . is_jamroot ( basename ) : # We search for parent/project-root only if jamfile was specified # --- i.e # if the project is not standalone. parent_module = self . load_parent ( location ) else : # It's either jamroot, or standalone project. # If it's jamroot, inherit from user-config. if location : # If project-config module exist, inherit from it. if self . module2attributes . has_key ( "project-config" ) : parent_module = "project-config" else : parent_module = "user-config" jamroot = True if parent_module : self . inherit_attributes ( module_name , parent_module ) attributes . set ( "parent-module" , parent_module , exact = 1 ) if jamroot : attributes . set ( "project-root" , location , exact = 1 ) parent = None if parent_module : parent = self . target ( parent_module ) if not self . module2target . has_key ( module_name ) : target = b2 . build . targets . ProjectTarget ( self . manager , module_name , module_name , parent , self . attribute ( module_name , "requirements" ) , # FIXME: why we need to pass this? It's not # passed in jam code. self . attribute ( module_name , "default-build" ) ) self . module2target [ module_name ] = target self . current_project = self . target ( module_name )