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)))
[((502, 515), 'routines.config.load', 'config.load', ([], {}), '()\n', (513, 515), True, 'import routines.config as config\n'), ((537, 573), 'os.path.isdir', 'os.path.isdir', (['config.data_directory'], {}), '(config.data_directory)\n', (550, 573), False, 'import os\n'), ((601, 647), 'routines.helpers.remaining_space', 'helpers.remaining_space', (['config.data_directory'], {}), '(config.data_directory)\n', (624, 647), True, 'import routines.helpers as helpers\n'), ((794, 832), 'os.path.isdir', 'os.path.isdir', (['config.camera_directory'], {}), '(config.camera_directory)\n', (807, 832), False, 'import os\n'), ((851, 891), 'os.path.ismount', 'os.path.ismount', (['config.camera_directory'], {}), '(config.camera_directory)\n', (866, 891), False, 'import os\n'), ((936, 984), 'routines.helpers.remaining_space', 'helpers.remaining_space', (['config.camera_directory'], {}), '(config.camera_directory)\n', (959, 984), True, 'import routines.helpers as helpers\n'), ((1217, 1257), 'routines.helpers.none_to_null', 'helpers.none_to_null', (['camera_drive_space'], {}), '(camera_drive_space)\n', (1237, 1257), True, 'import routines.helpers as helpers\n'), ((360, 401), 'subprocess.check_output', 'subprocess.check_output', (["['uptime', '-s']"], {}), "(['uptime', '-s'])\n", (383, 401), False, 'import subprocess\n'), ((1155, 1193), 'routines.helpers.none_to_null', 'helpers.none_to_null', (['data_drive_space'], {}), '(data_drive_space)\n', (1175, 1193), True, 'import routines.helpers as helpers\n'), ((1097, 1131), 'routines.helpers.none_to_null', 'helpers.none_to_null', (['startup_time'], {}), '(startup_time)\n', (1117, 1131), True, 'import routines.helpers as helpers\n')]