Provide general information about the system, user etc.
Check if user.name and user.email is set globally in git
Returns: | boolean |
---|
Check if git is installed
Returns: | boolean |
---|
Update user settings with the settings of an existing PyScaffold project
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | updated command line parameters as argparse.Namespace |
Functionality for working with a git repository
Adds recursively a directory structure to git
Parameters: |
|
---|
Initialize a git repository
Parameters: |
|
---|
Check if a folder is a git repository
Parameters: | folder – path as string |
---|
Command-Line-Interface of PyScaffold
Main entry point of PyScaffold
Parameters: | args – command line parameters as list of strings |
---|
Parse command line parameters
Parameters: | args – command line parameters as list of strings |
---|---|
Returns: | command line parameters as argparse.Namespace |
Shell commands like git, django-admin.py etc.
Bases: object
Shell command that can be called with flags like git(‘add’, ‘file’)
Parameters: | command – command to handle |
---|
Decorator to convert given CalledProcessError to an exit message
This avoids displaying nasty stack traces to end-users
Command for django-admin.py
Command for git
Functionality to generate and work with the directory structure of a project
Checks which files exist in a directory structure
Parameters: |
|
---|---|
Returns: | returns a dictionary of dictionaries where keys representing files exists in the filesystem. |
Creates a standard Django project with django-admin.py
Parameters: | args – command line parameters as argparse.Namespace |
---|
Manifests a directory structure in the filesystem
Parameters: |
|
---|
Creates the project structure as dictionary of dictionaries
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | structure as dictionary of dictionaries |
Removes files existing in del_struct from structure orig_struct
Parameters: |
|
---|---|
Returns: | directory structure as dictionary of dictionaries |
Set default arguments for some parameters
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | command line parameters as argparse.Namespace |
Templates for all files of a project’s scaffold
Template of AUTHORS.rst
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Finds proper license name for the license defined in txt
Parameters: | txt – license name as string |
---|---|
Returns: | license name as string |
Template of .coveragerc
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Retrieve the template by name
Parameters: | name – name of template |
---|---|
Returns: | template as string.Template |
Template of .gitattributes
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Template of .gitignore
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Template of empty .gitignore
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Template of __init__.py
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Template of LICENSE.txt
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Template of MANIFEST.in
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Template of .pre-commit-config.yaml
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Template of README.rst
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Template of requirements.txt
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Template of setup.py
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Template of conf.py
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Template of index.rst
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Template of license.rst
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Template of Sphinx’s Makefile
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Template of tox.ini
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Template of .travis.yml
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Template of travis_install.sh
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Template of _version.py
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Template of versioneer.py
Parameters: | args – command line parameters as argparse.Namespace |
---|---|
Returns: | file content as string |
Miscellaneous utilities and tools
Bases: type
Metaclass to keep track of generated instances of a class
Captures the instances of a given class during runtime
param cls: class to capture return: dynamic list with references to all instances of cls
Contextmanager to change into a directory
Parameters: | path – path to change into as string |
---|
Decorator to convert given exceptions to exit messages
This avoids displaying nasty stack traces to end-users
Parameters: | exception_list – list of exceptions to convert |
---|
Converts a git description to a PEP440 conforming string
Parameters: | ver_str – git version description |
---|---|
Returns: | PEP440 version description |
Check if string is a valid package name
Parameters: | string – package name as string |
---|---|
Returns: | boolean |
Calculate the Levenshtein distance between two strings
Parameters: |
|
---|---|
Returns: | distance between s1 and s2 as integer |
Generate a Python syntax list string with an indention
Parameters: |
|
---|---|
Returns: | string |
Try to make a valid package name identifier from a string
Parameters: | string – invalid package name as string |
---|---|
Returns: | valid package name as string or RuntimeError |
Safely retrieve the value of a namespace’s attribute
Parameters: |
|
---|---|
Returns: | value of the attribute or None |
Safely set an attribute of a namespace object
The new attribute is set only if the attribute did not exist or was None.
Parameters: |
|
---|
Decode a Python 2 str object to unicode for compatibility with Python 3
Parameters: | string – Python 2 str object or Python 3 str object |
---|---|
Returns: | Python 2 unicode object or Python 3 str object |
Encode a Python 2 unicode object to str for compatibility with Python 3
Parameters: | string – Python 2 unicode object or Python 3 str object |
---|---|
Returns: | Python 2 str object or Python 3 str object |