gen_vhost.pro.read_template module¶
- Module
- read_template.py
- Copyright
- Copyright (C) 2017 Vladimir Roncevic <elektron.ronca@gmail.com> gen_vhost is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. gen_vhost is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
- Info
- Defined class ReadTemplate with attribute(s) and method(s). Created API for read a template file and return a content.
-
class
gen_vhost.pro.read_template.
ReadTemplate
(verbose=False)[source]¶ Bases:
ats_utilities.config_io.base_check.FileChecking
Defined class ReadTemplate with attribute(s) and method(s). Created API for read a template file and return a content. It defines:
attributes: GEN_VERBOSE - console text indicator for process-phase.TEMPLATE_DIR - template dir path.__template_dir - absolute file path of template dir.methods: __init__ - initial constructor.get_template_dir - getter for template directory object.read - read a template and return a string representation.__str__ - dunder method for ReadTemplate.-
GEN_VERBOSE
= 'GEN_VHOST::PRO::READ_TEMPLATE'¶
-
TEMPLATE_DIR
= '/../conf/template/'¶
-
VERBOSE
= 'ATS_UTILITIES'¶
-
get_template_dir
()[source]¶ Getter for template directory.
Returns: template directory path | None. Return type: <str> | <NoneType>
-
read
(template_module, verbose=False)[source]¶ Read template structure.
Parameters: - template_module (<str>) – template module name.
- verbose (<bool>) – enable/disable verbose option.
Returns: template content for setup module | None.
Return type: <str> | <NoneType>
Exceptions: ATSTypeError | ATSBadCallError
-