import socket

hostname = socket.gethostname()
PROD_HOST="pa_web"

if hostname == PROD_HOST:
    PA_JOB_MANAGER_HOST="192.168.0.2"
    DB_URL = 'postgresql+psycopg2://pa:for_now_pa@192.168.0.2:55432/pa'
elif hostname == "lappy":
    PA_JOB_MANAGER_HOST="localhost"
    DB_URL = 'postgresql+psycopg2://pa:for_now_pa@localhost:5432/pa'
else:
    PA_JOB_MANAGER_HOST="localhost"
    DB_URL = 'postgresql+psycopg2://pa:for_now_pa@mara.ddp.net:55432/pa'

PA_JOB_MANAGER_PORT=55430

THUMBSIZE=256

def CreateSelect(name, selected, list, js=""):
    str  = f'<select id="{name}" name="{name}" style="color:#5bc0de;border:1px solid #5bc0de;"'
    str += f'class="sm-txt form-control form-conrol-info" onChange="{js};this.form.submit()">'
    for el in list:
        str += '<option '
        if el == selected:
            str += 'selected '
        str += f'>{el}</option>'
    str += '</select>'
    return str
