Python Documentation: entree.projects.base

module name

entree.projects.base

version

0.1

DESCRIPTION

.. module:: entree.projects.base
.. moduleauthor:: Julien Spronck
.. created:: Feb 2018

Module creating a base class for all projects

dependent modules

  • datetime
  • entree.utils
  • getopt
  • os
  • six
  • sys

variables

  • PROJECTS_PATH
  • TEMPLATE_ROOT

classes

  • ProjectBase(object)
    Class for each project.
    
    Class attributes:
        project_type (str): project type (e.g. flask)
        project_long_name (str): long name for a project (e.g. 'Large Flask')
        template_dir (str): path to the project template directory relative to
            the template root directory
        single_file (str): path to a single file that you want to create in
            single-file mode relative to the template root directory
        replace (dict, default=None): dictionary mapping template file
            names that should be replaced when creating the files. For
            example, {'unittest_py.template': 'test_project.py'}
        version (str): version number
    class attributes
    • project_long_name
    • project_type
    • replace
    • single_file
    • template_dir
    • version
    methods
    • usage(cls, exit_status)
      Displays the usage/help for this project
    • template_path(cls)
      Builds the template path based on the template root directory and the
      project template directory

      Returns:
      A string containing the full template path
    • single_file_path(cls)
      Builds the single-file path based on the template root directory and
      the project relative single-file path

      Returns:
      A string containing the full singe-file path
    • get_config(cls)
      Gets project-specific configuration
    • create_one(cls, rootdir, filename)
      Creates a single-file project

      Args:
      rootdir (str): the root directory
      filename (str): the file name
    • create_all(cls, rootdir, modname, partial=None, add_to_existing=False)
      Creates all project files and directories

      Args:
      rootdir (str): the root directory
      modname (str): the module name

      Keyword args:
      partial (str, default=None): name of the partial build that you
      want to use. Partial build names are defined in the config
      file
      add_to_existing (bool, default=False): True if you want to add
      files without creating a project directory (add to existing
      project)
    • main(cls, modname='')
      Main program

      Keyword args:
      modname (str, default=''): module/project name
This page was made with pytree 1.0
Index