frankenstein Documentation

frankenstein Documentation
Release 0.1.4
Dave Young
2016
Getting Started
1
Installation
1.1 Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3
3
3
2
Usage
5
3
Documentation
7
4
Tutorial
4.1 Placeholders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2 Dyanamic Placeholders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9
9
9
5
Installation
5.1 Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2 Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11
11
11
6
Usage
13
7
Documentation
15
8
Tutorial
8.1 Placeholders . . . . . . . . . . . . . . . . . . . . .
8.2 Dyanamic Placeholders . . . . . . . . . . . . . . .
8.2.1
Subpackages . . . . . . . . . . . . . . . .
frankenstein (subpackage) . . . . . . . . . .
frankenstein.commonutils (subpackage) . . .
8.2.2
Modules . . . . . . . . . . . . . . . . . . .
frankenstein.cl_utils (module) . . . . . . . .
frankenstein.utKit (module) . . . . . . . . .
8.2.3
Classes . . . . . . . . . . . . . . . . . . .
frankenstein.electric (class) . . . . . . . . .
Methods . . . . . . . . . . . . . . .
frankenstein.utKit.utKit (class) . . . . . . . .
Methods . . . . . . . . . . . . . . .
8.2.4
Functions . . . . . . . . . . . . . . . . . .
frankenstein.cl_utils.tab_complete (function)
8.3 Indexes . . . . . . . . . . . . . . . . . . . . . . . .
8.4 Todo . . . . . . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
17
17
17
17
18
18
18
18
18
18
18
19
19
19
19
19
19
19
i
Python Module Index
ii
21
frankenstein Documentation, Release 0.1.4
Project Templates Brought to Life.
Getting Started
1
frankenstein Documentation, Release 0.1.4
2
Getting Started
CHAPTER 1
Installation
The easiest way to install frankenstein us to use pip:
pip install frankenstein
Or you can clone the github repo and install from a local version of the code:
git clone [email protected]:thespacedoctor/frankenstein.git
cd frankenstein
python setup.py install
To upgrade to the latest version of frankenstein use the command:
pip install frankenstein --upgrade
1.1 Development
If you want to tinker with the code, then install in development mode. This means you can modify the code from your
cloned repo:
git clone [email protected]:thespacedoctor/frankenstein.git
cd frankenstein
python setup.py develop
Pull requests are welcomed!
1.2 Issues
Please report any issues here.
3
frankenstein Documentation, Release 0.1.4
4
Chapter 1. Installation
CHAPTER 2
Usage
frankenstein <pathToTemplate> <pathToDestination> [-s <pathToSettingsFile>]
-h, --help
-s, --settings
show this help message
the settings file
5
frankenstein Documentation, Release 0.1.4
6
Chapter 2. Usage
CHAPTER 3
Documentation
Documentation for frankenstein is hosted by Read the Docs (last stable version and latest version).
7
frankenstein Documentation, Release 0.1.4
8
Chapter 3. Documentation
CHAPTER 4
Tutorial
Todo
• add tutorial
4.1 Placeholders
The placeholder delimiters can be set in the yaml settings file. If you’re using frankenstein for the first time, a default
settings file is added to your home directory for you.
The default placeholders are %% and xxx.
4.2 Dyanamic Placeholders
Some placeholders are dynamic and will be pre-populated for you. There include:
• now-ymd: e.g. 20151001
• now-hms: e.g. 093103
• now-ymdhms: e.g. 20151001t093103
• now-date: e.g. October 1, 2015
• now-time e.g 9:31 am
• now-datetime e.g October 1, 2015 9:31 am
• now-year e.g 2015
9
frankenstein Documentation, Release 0.1.4
10
Chapter 4. Tutorial
CHAPTER 5
Installation
The easiest way to install frankenstein us to use pip:
pip install frankenstein
Or you can clone the github repo and install from a local version of the code:
git clone [email protected]:thespacedoctor/frankenstein.git
cd frankenstein
python setup.py install
To upgrade to the latest version of frankenstein use the command:
pip install frankenstein --upgrade
5.1 Development
If you want to tinker with the code, then install in development mode. This means you can modify the code from your
cloned repo:
git clone [email protected]:thespacedoctor/frankenstein.git
cd frankenstein
python setup.py develop
Pull requests are welcomed!
5.2 Issues
Please report any issues here.
11
frankenstein Documentation, Release 0.1.4
12
Chapter 5. Installation
CHAPTER 6
Usage
frankenstein <pathToTemplate> <pathToDestination> [-s <pathToSettingsFile>]
-h, --help
-s, --settings
show this help message
the settings file
13
frankenstein Documentation, Release 0.1.4
14
Chapter 6. Usage
CHAPTER 7
Documentation
Documentation for frankenstein is hosted by Read the Docs (last stable version and latest version).
15
frankenstein Documentation, Release 0.1.4
16
Chapter 7. Documentation
CHAPTER 8
Tutorial
Todo
• add tutorial
8.1 Placeholders
The placeholder delimiters can be set in the yaml settings file. If you’re using frankenstein for the first time, a default
settings file is added to your home directory for you.
The default placeholders are %% and xxx.
8.2 Dyanamic Placeholders
Some placeholders are dynamic and will be pre-populated for you. There include:
• now-ymd: e.g. 20151001
• now-hms: e.g. 093103
• now-ymdhms: e.g. 20151001t093103
• now-date: e.g. October 1, 2015
• now-time e.g 9:31 am
• now-datetime e.g October 1, 2015 9:31 am
• now-year e.g 2015
8.2.1 Subpackages
frankenstein
frankenstein.commonutils
17
frankenstein Documentation, Release 0.1.4
frankenstein (subpackage)
frankenstein.commonutils (subpackage)
8.2.2 Modules
frankenstein.cl_utils
frankenstein.utKit
CL utils for frankenstein
frankenstein.cl_utils (module)
CL utils for frankenstein
Author David Young
Date Created October 1, 2015
Usage: frankenstein <pathToTemplate> <pathToDestination> [-s <pathToSettingsFile>]
-h, --help
show this help message
-s, --settings
the settings file
frankenstein.cl_utils.main(arguments=None)
The main function used when ‘‘cl_utils.py‘‘ is run as a single script from the cl, or when installed as a cl
command
frankenstein.utKit (module)
class frankenstein.utKit.utKit(moduleDirectory)
Override dryx utKit
8.2.3 Classes
frankenstein.electric
frankenstein.utKit.utKit
The worker class for the electric module
Override dryx utKit
frankenstein.electric (class)
class frankenstein.electric(log, pathToTemplate, pathToDestination, settings=False, ignoreExisting=False)
The worker class for the electric module
Key Arguments:
• log – logger
• settings – the settings dictionary
• pathToTemplate – path to the template folder/file
• pathToDestination – path to where template should be cloned
• ignoreExisting - - ignore existing files in the destination for the template
__init__(log, pathToTemplate, pathToDestination, settings=False, ignoreExisting=False)
18
Chapter 8. Tutorial
frankenstein Documentation, Release 0.1.4
Methods
__init__(log, pathToTemplate, pathToDestination)
get()
do the frankenstein magic!
frankenstein.utKit.utKit (class)
class frankenstein.utKit.utKit(moduleDirectory)
Override dryx utKit
__init__(moduleDirectory)
Methods
__init__(moduleDirectory)
setupModule()
tearDownModule()
The setupModule method
The tearDownModule method
8.2.4 Functions
frankenstein.cl_utils.tab_complete
frankenstein.cl_utils.tab_complete (function)
frankenstein.cl_utils.tab_complete(text, state)
8.3 Indexes
• Module Index
• Full Index
8.4 Todo
• Todolist
8.3. Indexes
19
frankenstein Documentation, Release 0.1.4
20
Chapter 8. Tutorial
Python Module Index
f
frankenstein, 18
frankenstein.cl_utils, 18
frankenstein.commonutils, 18
frankenstein.utKit, 18
21
frankenstein Documentation, Release 0.1.4
22
Python Module Index
Index
Symbols
__init__() (frankenstein.electric method), 18
__init__() (frankenstein.utKit.utKit method), 19
E
electric (class in frankenstein), 18
F
frankenstein (module), 18
frankenstein.cl_utils (module), 18
frankenstein.commonutils (module), 18
frankenstein.utKit (module), 18
M
main() (in module frankenstein.cl_utils), 18
T
tab_complete() (in module frankenstein.cl_utils), 19
U
utKit (class in frankenstein.utKit), 18, 19
23