#!/usr/bin/python # -*- coding: utf-8 -*- # --------------------------------------------------------------------------------------------------------- # Author : Ulrich Carmesin # Source : gitea.ucarmesin.de # --------------------------------------------------------------------------------------------------------- """ This abstract class CliFcts defines the interface for the execution of any command-line-functions. It uses the following configuration .a) COMP.conf->artifact->cli->[system] : for structural attributes of the operating-system \n .c) COMP.conf->conn->[cli] : for connection-attributes and structural attributes, maybe specialized for the operating-system The attribute type resolves which technique is used, implemented in a specific tool-class: * cmd,bash,powersh ... for specific local operating-system * ssh,hadoop ... for specific remote operating-system The main tasks are: \n .1. executing the command-array - with attributes * conn.ip, host, port, user, password, ... for synchronous db-connection * conn.root, ... for path-definitions for file-implementations (csv, ) """ import basic.program import utils.config_tool class CliFcts(): """ This interface defines each necessary connection to any kind of database. The specific technique how to connect to the concrete DBMS has to be implemented in the specific tool. """ def __init__(self): self.comp = None pass def setComp(self, comp): self.comp = comp def execCommand(self, comp, command): """ method to execute the statement this method should only called by the class itself """ raise Exception(B.EXCEPT_NOT_IMPLEMENT)