import os
import subprocess

import routines.config as config
import routines.helpers as helpers

def get_static_info():
    """ Outputs data concerning the computer in the C-AWS station
    """
    startup_time = None
    data_drive_space = None
    camera_drive_space = None
    
    # Get system startup time
    try:
        startup_time = (subprocess
            .check_output(["uptime", "-s"]).decode().rstrip())
    except: pass

    # Get data and camera drive space
    if config.load() == True:
        if os.path.isdir(config.data_directory):
            free_space = helpers.remaining_space(config.data_directory)

            if free_space != None:
                data_drive_space = round(free_space, 2)

        if (config.camera_directory != None and os.path.isdir(
            config.camera_directory) and os.path.ismount(
            config.camera_directory)):

            free_space = helpers.remaining_space(config.camera_directory)
            if free_space != None:
                camera_drive_space = round(free_space, 2)

    print(str(helpers.none_to_null(startup_time)) + "\n"
        + str(helpers.none_to_null(data_drive_space)) + "\n"
        + str(helpers.none_to_null(camera_drive_space)))
[(21, 'routines.config.load', 'config.load', True, 'import routines.config as config\n'), (22, 'os.path.isdir', 'os.path.isdir', False, 'import os\n'), (23, 'routines.helpers.remaining_space', 'helpers.remaining_space', True, 'import routines.helpers as helpers\n'), (28, 'os.path.isdir', 'os.path.isdir', False, 'import os\n'), (29, 'os.path.ismount', 'os.path.ismount', False, 'import os\n'), (32, 'routines.helpers.remaining_space', 'helpers.remaining_space', True, 'import routines.helpers as helpers\n'), (38, 'routines.helpers.none_to_null', 'helpers.none_to_null', True, 'import routines.helpers as helpers\n'), (16, 'subprocess.check_output', 'subprocess.check_output', False, 'import subprocess\n'), (37, 'routines.helpers.none_to_null', 'helpers.none_to_null', True, 'import routines.helpers as helpers\n'), (36, 'routines.helpers.none_to_null', 'helpers.none_to_null', True, 'import routines.helpers as helpers\n')]