import os
import csv
from Application import *

class InputTechnicalAnalysis(object):
    '''
    InputTechnicalAnalysis loads the input file TechnicalIndicators.csv
    '''
    
    Inputs = []
    
    def __init__(self):
        self._rootPath = Application.getRootDirectory() # Get application root directory
        self._inputPath = self._rootPath + '/settings/input_TechnicalIndicators.csv' # Set path to data folder
        print('Loading technical analysis settings...')
        self._initializeObject()
    
    def _initializeObject(self):
        self._loadInput()
    
    def _loadInput(self):
        inputFileCSV = csv.reader(open(self._inputPath, newline=''))
        for row in inputFileCSV:
            i = 0
            thisInput = Input()
            thisInput.listArgs = [None] * (len(row) - 1)
            for col in row:
                if i == 0:
                    thisInput.type = col
                else:
                    thisInput.listArgs[i - 1] = col
                i = i + 1
                #thisInput.listArgs.ravel()
            self.Inputs.append(thisInput) 

class Input(object):
    type = ''
    listArgs = []

            