Generate Unix Domain Socket

gen_unix_domain_socket is framework for generation Unix Domain Socket modules.

Developed in python code: 100%.

The README is used to introduce the modules and provide instructions on how to install the modules, any machine dependencies it may have and any other information that should be provided before the modules are installed.

Python package GitHub issues Documentation Status GitHub contributors

gen_unix_domain_socket

gen_unix_domain_socket package

Subpackages

gen_unix_domain_socket.pro package
Subpackages
gen_unix_domain_socket.pro.config package
Submodules
gen_unix_domain_socket.pro.config.pro_name module
Module
pro_name.py
Copyright
Copyright (C) 2018 Vladimir Roncevic <elektron.ronca@gmail.com> gen_unix_domain_socket 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_unix_domain_socket 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 ProName with attribute(s) and method(s). Defined API for project name with preparations for generation.
class gen_unix_domain_socket.pro.config.pro_name.ProName(verbose=False)[source]

Defined class ProName with attribute(s) and method(s). Defined API for project name with preparations for generation. It defines:

attributes:
GEN_VERBOSE - console text indicator for process-phase.
__verbose - enable/disable verbose option.
__pro_name - project name.
methods:
__init__ - initial constructor.
pro_name - property methods for set/get operations.
is_pro_name_ok - checking is project name ok.
__str__ - dunder method for ProName.
GEN_VERBOSE = 'GEN_UNIX_DOMAIN_SOCKET::PRO::CONFIG::PRO_NAME'
is_pro_name_ok()[source]

Checking is project name ok.

Returns:boolean status, True (not None) | False.
Return type:<bool>
Exceptions:None
pro_name

Property method for getting project name.

Returns:formatted project name | None.
Return type:<str> | <NoneType>
Exceptions:None
gen_unix_domain_socket.pro.config.template_dir module
Module
template_dir.py
Copyright
Copyright (C) 2018 Vladimir Roncevic <elektron.ronca@gmail.com> gen_unix_domain_socket 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_unix_domain_socket 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 TemplateDir with attribute(s) and method(s). Defined API for template directory for generation.
class gen_unix_domain_socket.pro.config.template_dir.TemplateDir(verbose=False)[source]

Defined class TemplateDir with attribute(s) and method(s). Defined API for template directory for generation. It defines:

attributes:
GEN_VERBOSE - console text indicator for process-phase.
__verbose - enable/disable verbose option.
__template_dir - project template dir.
methods:
__init__ - initial constructor.
template_dir - property methods for set/get operations.
is_template_dir_ok - checking is template dir ok.
__str__ - dunder method for TemplateDir.
GEN_VERBOSE = 'GEN_UNIX_DOMAIN_SOCKET::PRO::CONFIG::TEMPLATE_DIR'
is_template_dir_ok()[source]

Checking is project template dir ok.

Returns:boolean status, True (not None) | False.
Return type:<bool>
Exceptions:None
template_dir

Property method for getting template dir.

Returns:formatted template dir | None.
Return type:<str> | <NoneType>
Exceptions:None
Module contents
Module
__init__.py
Copyright
Copyright (C) 2018 Vladimir Roncevic <elektron.ronca@gmail.com> gen_unix_domain_socket 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_unix_domain_socket 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 ProConfig with attribute(s) and method(s). Defined project configuration container.
class gen_unix_domain_socket.pro.config.ProConfig(verbose=False)[source]

Defined class ProConfig with attribute(s) and method(s). Defined project configuration container. It defines:

attributes:
GEN_VERBOSE - console text indicator for process-phase.
TEMPLATES - templates key.
MODULES - modules key.
FORMAT - format for template file.
__verbose - enable/disable verbose option.
__config - configuration dictionary.
methods:
__init__ - initial constructor.
pro_name - property methods for set/get operations.
is_config_ok - checking is project configuration ok.
__str__ - dunder method for ProConfig.
FORMAT = 'template'
GEN_VERBOSE = 'GEN_UNIX_DOMAIN_SOCKET::PRO::CONFIG::PRO_CONFIG'
MODULES = 'modules'
TEMPLATES = 'templates'
config

Property method for getting project configuration.

Returns:formatted project configuration | None.
Return type:<dict> | <NoneType>
Exceptions:None
is_config_ok()[source]

Checking is project configuration ok.

Returns:boolean status, True (ok) | False.
Return type:<bool>
Exceptions:None
Submodules
gen_unix_domain_socket.pro.read_template module
Module
read_template.py
Copyright
Copyright (C) 2018 Vladimir Roncevic <elektron.ronca@gmail.com> gen_unix_domain_socket 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_unix_domain_socket 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_unix_domain_socket.pro.read_template.ReadTemplate(verbose=False)[source]

Bases: ats_utilities.config_io.base_check.FileChecking, gen_unix_domain_socket.pro.config.template_dir.TemplateDir

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.
read - read a template and return a string representation.
__str__ - dunder method for ReadTemplate.
GEN_VERBOSE = 'GEN_UNIX_DOMAIN_SOCKET::PRO::READ_TEMPLATE'
TEMPLATE_DIR = '/../conf/template/'
VERBOSE = 'ATS_UTILITIES'
read(config, uds_type, verbose=False)[source]

Read a templates and return a content.

Parameters:
  • config (<dict>) – parameter file name.
  • uds_type (<str>) – parameter UDS type.
  • verbose (<bool>) – enable/disable verbose option.
Returns:

template content list | empty list.

Return type:

<list>

Exceptions:

ATSTypeError | ATSBadCallError

gen_unix_domain_socket.pro.write_template module
Module
write_template.py
Copyright
Copyright (C) 2018 Vladimir Roncevic <elektron.ronca@gmail.com> gen_unix_domain_socket 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_unix_domain_socket 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 WriteTemplate with attribute(s) and method(s). Created API for write operation of template content.
class gen_unix_domain_socket.pro.write_template.WriteTemplate(verbose=False)[source]

Bases: ats_utilities.config_io.base_check.FileChecking

Defined class WriteTemplate with attribute(s) and method(s). Created API for write operation of template content. It defines:

attributes:
GEN_VERBOSE - console text indicator for process-phase.
methods:
__init__ - initial constructor.
write - write setup content to files.
__str__ - dunder method for WriteTemplate.
GEN_VERBOSE = 'GEN_UNIX_DOMAIN_SOCKET::PRO::WRITE_TEMPLATE'
VERBOSE = 'ATS_UTILITIES'
write(templates, pro_name, verbose=False)[source]

Write setup content to files.

Parameters:
  • templates (<list>) – templates and contents.
  • pro_name (<str>) – project name.
  • verbose (<bool>) – enable/disable verbose option.
Returns:

boolean status, True (success) | False.

Return type:

<bool>

Exception:

ATSTypeError | ATSBadCallError

Module contents
Module
__init__.py
Copyright
Copyright (C) 2018 Vladimir Roncevic <elektron.ronca@gmail.com> gen_unix_domain_socket 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_unix_domain_socket 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 UnixDomainSocket with attribute(s) and method(s). Generate module file generator_test.py by template and parameters.
class gen_unix_domain_socket.pro.UnixDomainSocket(verbose=False)[source]

Bases: ats_utilities.config_io.base_check.FileChecking, gen_unix_domain_socket.pro.config.ProConfig, gen_unix_domain_socket.pro.config.pro_name.ProName

Defined class UnixDomainSocket with attribute(s) and method(s). Generate module file generator_test.py by template and parameters. It defines:

attributes:
GEN_VERBOSE - console text indicator for process-phase.
PRO_STRUCTURE - project setup (template, module).
__reader - reader API.
__writer - writer API.
methods:
__init__ - initial constructor.
get_reader - getter for template reader.
get_writer - getter for template writer.
gen_setup - generate module file setup.py.
__str__ - dunder method for UnixDomainSocket.
GEN_VERBOSE = 'GEN_UNIX_DOMAIN_SOCKET::PRO::GEN_SETUP'
PRO_STRUCTURE = '/../conf/project.yaml'
VERBOSE = 'ATS_UTILITIES'
gen_setup(pro_name, verbose=False)[source]

Generate module generator_test.py.

Parameters:
  • pro_name (<str>) – project name.
  • verbose (<bool>) – enable/disable verbose option.
Returns:

boolean status, True (success) | False.

Return type:

<bool>

Exceptions:

ATSTypeError | ATSBadCallError

get_reader()[source]

Getter for template reader.

Returns:template reader object.
Return type:<ReadTemplate>
Exceptions:None
get_writer()[source]

Getter for template writer.

Returns:template writer object.
Return type:<WriteTemplate>
Exceptions:None
select_pro_type(verbose=False)[source]

Select project type.

Parameters:verbose (<bool>) – enable/disable verbose option.
Returns:template type | None.
Return type:<str> | <NoneType>
Exceptions:None

Module contents

Module
__init__.py
Copyright
Copyright (C) 2018 Vladimir Roncevic <elektron.ronca@gmail.com> gen_unix_domain_socket 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_unix_domain_socket 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 GenUnixDomainSocket with attribute(s) and method(s). Load a base info, create an CLI interface and run operation(s).
class gen_unix_domain_socket.GenUnixDomainSocket(verbose=False)[source]

Bases: ats_utilities.cli.cfg_cli.CfgCLI

Defined class GenUnixDomainSocket with attribute(s) and method(s). Load a base info, create an CLI interface and run operation(s). It defines:

attributes:
__metaclass__ - setting cooperative metaclasses.
GEN_VERBOSE - console text indicator for process-phase.
CONFIG - tool info file path.
LOG - tool log file path.
OPS - list of tool options.
logger - logger object API.
methods:
__init__ - initial constructor.
process - process and run operation.
__str__ - dunder method for GenUnixDomainSocket.
CONFIG = '/conf/gen_unix_domain_socket.cfg'
GEN_VERBOSE = 'GEN_UNIX_DOMAIN_SOCKET'
LOG = '/log/gen_unix_domain_socket.log'
OPS = ['-g', '--gen', '-v', '--verbose', '--version']
VERBOSE = 'ATS_UTILITIES'
process(verbose=False)[source]

Process and run operation.

Parameters:verbose (<bool>) – enable/disable verbose option.
Returns:boolean status, True (success) | False.
Return type:<bool>
Exceptions:None

Installation

Install Python2 Package Install Python3 Package

Navigate to release page download and extract release archive.

To install package type the following:

tar xvzf gen_unix_domain_socket-x.y.z.tar.gz
cd gen_unix_domain_socket-x.y.z/
# python2
pip install -r requirements.txt
python setup.py install_lib
python setup.py install_data
python setup.py install_egg_info
# pyton3
pip3 install -r requirements.txt
python3 setup.py install_lib
python3 setup.py install_data
python3 setup.py install_egg_info

You can use Docker to create image/container, or You can use pip to install:

# python2
pip install gen-unix-domain-socket
# python3
pip3 install gen-unix-domain-socket

GitHub docker checker

Dependencies

gen_unix_domain_socket requires next modules and libraries:

Framework structure

gen_unix_domain_socket is based on OOP:

https://raw.githubusercontent.com/vroncevic/gen_unix_domain_socket/dev/docs/gen_unix_domain_socket_flow.png

Framework structure:

gen_unix_domain_socket/
├── conf/
│   ├── gen_unix_domain_socket.cfg
│   ├── gen_unix_domain_socket_util.cfg
│   ├── project.yaml
│   └── template/
│       └── posix/
│           ├── uds_accept.template
│           ├── uds_bind.template
│           ├── uds_connect.template
│           ├── uds_fatal_error.template
│           ├── uds_listen.template
│           ├── uds_read.template
│           ├── uds_socket.template
│           ├── uds.template
│           ├── uds_unlink.template
│           └── uds_write.template
├── __init__.py
├── log/
│   └── gen_unix_domain_socket.log
├── pro/
│   ├── config/
│   │   ├── __init__.py
│   │   ├── pro_name.py
│   │   └── template_dir.py
│   ├── __init__.py
│   ├── read_template.py
│   └── write_template.py
└── run/
    └── gen_unix_domain_socket_run.py

Indices and tables