PyHatch Main Function¶
The _version.py
file can be executed with execfile to create a local variable __version__:
execfile('_version.py') # python 2.x
exec(open('_version.py').read()) # python 3.x
creates local __version__ variable.
Used to set version info throughout the project.
-
class
pyhatch.hatch_supt.
Hatch
(projName='MyProject', in_test_mode=False, mainPyFileName='main.py', mainDefinesClass='Y', mainClassName='MyClass', mainFunctionName='my_function', author='', proj_copyright='', proj_license='GPL-3', version='', email='', status='3 - Alpha', simpleDesc='', longDesc='', year=None, organization=None, github_user_name='')¶ Hatch is main administrative class that creates a new project.
Hatch gathers user data and builds new project with directory structure shown above.
Parameters: - projName – (str) proper name of project ex. ‘MyProject’. MUST start with capital letter.
- in_test_mode – (boolean) flag to indicate test mode or live mode
- mainPyFileName – (str) main file in code directory ex. “main.py”
- mainDefinesClass – (boolean) flag to indicate if mainPyFileName defines a class or function
- mainFunctionName – (str) name of function defined by mainPyFileName
- author – (str) author’s name, ex. ‘John Doe’
- proj_copyright – (str) copyright, ex. ‘Copyright (c) 2013 John Doe’
- proj_license – (str) license, ex. ‘GPL-3’
- version – (str) version, ex. ‘0.1.1’
- email – (str) author’s email ex. “johndoe@happypond.org”
- status – (str) common values = “3 - Alpha”, “4 - Beta”, “5 - Production/Stable”
- simpleDesc – (str) short/simple description of project
- longDesc – (str) long description of project
- year – (str) or (int) year for copyright
- organization – (str) name of organization for copyright
- github_user_name – (str) user name at GitHub
-
print_proj_license_error
()¶ Print Error Message for user input value of license
-
print_proj_status_error
()¶ Print Error Message for user input value of project status
-
save_project_below_this_dir
(save_dir)¶ Creates file layout of project