src/py/aggregators/csvaggregator.py
def appendToDemoCSV_Info(destinationPath:str)->AggregatorFileInfo:
    """Generates some info on the file, wether it exists, has the right extensions etc.
    This is purely for UI purposes and can be skipped."""

    #Check if our extension is CSV
    if destinationPath[-3:] != 'csv':
        return AggregatorFileInfo(False, False, 'File should have a *.csv extension.')

    #Does the file exist?
    if not os.path.exists(destinationPath):
        return AggregatorFileInfo(False,True,'The selected file will be created on first export.')

    #If it exists get some information from the file
    try:
        with open(destinationPath, newline='') as csvfile:
            reader = csv.reader(csvfile, delimiter=',', quotechar='"')
            rows = [r for r in reader]
    except:
        #if it cannot be read for some other reason.
        return AggregatorFileInfo(True,True,'File exists but is corrupt and can\'t be loaded. It will be overwritten on export.')

    return __getInfo(rows)
Generates some info on the file, wether it exists, has the right extensions etc.
    This is purely for UI purposes and can be skipped.
Generates some info on the file, wether it exists, has the right extensions etc.
This is purely for UI purposes and can be skipped.
Generates some info on the file wether it exists has the right extensions etc . This is purely for UI purposes and can be skipped .
def appendToDemoCSV_Info(destinationPath:str)->AggregatorFileInfo:
    if destinationPath[-3:] != 'csv':
        return AggregatorFileInfo(False, False, 'File should have a *.csv extension.')
    if not os.path.exists(destinationPath):
        return AggregatorFileInfo(False,True,'The selected file will be created on first export.')
    try:
        with open(destinationPath, newline='') as csvfile:
            reader = csv.reader(csvfile, delimiter=',', quotechar='"')
            rows = [r for r in reader]
    except:
        return AggregatorFileInfo(True,True,'File exists but is corrupt and can\'t be loaded. It will be overwritten on export.')
    return __getInfo(rows)
def appendToDemoCSV_Info ( destinationPath : str ) -> AggregatorFileInfo : if destinationPath [ - 3 : ] != 'csv' : return AggregatorFileInfo ( False , False , 'File should have a *.csv extension.' ) if not os . path . exists ( destinationPath ) : return AggregatorFileInfo ( False , True , 'The selected file will be created on first export.' ) try : with open ( destinationPath , newline = '' ) as csvfile : reader = csv . reader ( csvfile , delimiter = ',' , quotechar = '"' ) rows = [ r for r in reader ] except : return AggregatorFileInfo ( True , True , 'File exists but is corrupt and can\'t be loaded. It will be overwritten on export.' ) return __getInfo ( rows )
Generates some info on the file, wether it exists, has the right extensions etc.
Generates some info on the file wether it exists has the right extensions etc .
"""Generates some info on the file, wether it exists, has the right extensions etc.
    This is purely for UI purposes and can be skipped.""" #Check if our extension is CSV #Does the file exist? #If it exists get some information from the file #if it cannot be read for some other reason.
destinationPath
str