original_docstring: Creates a part out of a template file
  
      Will resolve a part file based on its name, by looking through both package's
      static directory, and through user defined configuration path.
  
      The template file will feature a section (which name is the same as the file name)
      and will be parsed, and then added to the buildout file *as is*. It will also be
      named with the ``.part.cfg`` extension.
  
      Args:
          name: name of the template file (without extension)
          config_path: directory where to look for the template file
  
      Returns:
          dict representation of a part
  
      Raises:
          FileNotFoundError if no template can be found.
      
docstring: Creates a part out of a template file
  Will resolve a part file based on its name, by looking through both package's
  static directory, and through user defined configuration path.
  
  The template file will feature a section (which name is the same as the file name)
  and will be parsed, and then added to the buildout file *as is*. It will also be
  named with the ``.part.cfg`` extension.
  
  name of the template file (without extension)
  config_path: directory where to look for the template file
  
  dict representation of a part
  
  FileNotFoundError if no template can be found.
docstring_tokens: Creates a part out of a template file Will resolve a part file based on its name by looking through both package ' s static directory and through user defined configuration path . The template file will feature a section ( which name is the same as the file name ) and will be parsed and then added to the buildout file * as is * . It will also be named with the ` ` . part . cfg ` ` extension . name of the template file ( without extension ) config_path : directory where to look for the template file dict representation of a part FileNotFoundError if no template can be found .
code: def build_part_template(name, config_path):
      '''Creates a part out of a template file
  
      Will resolve a part file based on its name, by looking through both package's
      static directory, and through user defined configuration path.
  
      The template file will feature a section (which name is the same as the file name)
      and will be parsed, and then added to the buildout file *as is*. It will also be
      named with the ``.part.cfg`` extension.
  
      Args:
          name: name of the template file (without extension)
          config_path: directory where to look for the template file
  
      Returns:
          dict representation of a part
  
      Raises:
          FileNotFoundError if no template can be found.
      '''
      template_name = '{}.part.cfg'.format(name)
      template_path = os.path.join(os.path.expanduser(config_path))
  
      try:
          template_file = open(template_path, 'r')
      except FileNotFoundError:
          try:
              template_path = os.path.join(os.path.dirname(__file__), 'templates', template_name)
              template_file = open(template_path, 'r')
          except FileNotFoundError:
              template_file = None
  
      if not template_file:
          raise FileNotFoundError('Missing template file {}.part.cfg in {}'.format(name, config_path))
  
      res = parse(open(template_path, 'r'), name)
      # make items order predictible
      for k,v in res.items():
          if isinstance(v, dict):
              res[k] = OrderedDict(sorted(v.items(), key=lambda t: t[0]))
      return res
code_tokens: def build_part_template ( name , config_path ) : template_name = '{}.part.cfg' . format ( name ) template_path = os . path . join ( os . path . expanduser ( config_path ) ) try : template_file = open ( template_path , 'r' ) except FileNotFoundError : try : template_path = os . path . join ( os . path . dirname ( __file__ ) , 'templates' , template_name ) template_file = open ( template_path , 'r' ) except FileNotFoundError : template_file = None if not template_file : raise FileNotFoundError ( 'Missing template file {}.part.cfg in {}' . format ( name , config_path ) ) res = parse ( open ( template_path , 'r' ) , name ) for k , v in res . items ( ) : if isinstance ( v , dict ) : res [ k ] = OrderedDict ( sorted ( v . items ( ) , key = lambda t : t [ 0 ] ) ) return res
short_docstring: Creates a part out of a template file
  Will resolve a part file based on its name, by looking through both package's
  static directory, and through user defined configuration path.
short_docstring_tokens: Creates a part out of a template file Will resolve a part file based on its name by looking through both package ' s static directory and through user defined configuration path .
comment: '''Creates a part out of a template file
  
      Will resolve a part file based on its name, by looking through both package's
      static directory, and through user defined configuration path.
  
      The template file will feature a section (which name is the same as the file name)
      and will be parsed, and then added to the buildout file *as is*. It will also be
      named with the ``.part.cfg`` extension.
  
      Args:
          name: name of the template file (without extension)
          config_path: directory where to look for the template file
  
      Returns:
          dict representation of a part
  
      Raises:
          FileNotFoundError if no template can be found.
      '''$SEP$# make items order predictible