# Path: test/framework/config.py



import os, socket
from enum import Enum
from .framework import config

def public_cli_url(api_type):
    if api_type != ApiType.SCRIPT:
        purl = os.environ.get('JENKINS_URL')
        if purl:
            return purl.rstrip('/') + '/jnlpJars/jenkins-cli.jar'
        purl = os.environ.get('HUDSON_URL')
        if purl:
            return purl.rstrip('/') + '/jnlpJars/hudson-cli.jar'
        # If neither JENKINS nor HUDSON URL is set, assume jenkins for testing
        return "http://" + socket.getfqdn() + ':' + repr(8080) + '/jnlpJars/jenkins-cli.jar'
    else:
        return script_dir()


proxied_public_url = "http://myproxy.mydom/jenkins"


def proxied_public_cli_url(api_type):
    # Not required to be a real url
    if api_type != ApiType.SCRIPT:
        # If neither JENKINS nor HUDSON URL is set, assume jenkins for testing
        cli = '/jnlpJars/hudson-cli.jar' if os.environ.get('HUDSON_URL') else '/jnlpJars/jenkins-cli.jar'
        return proxied_public_url + cli
    else:
        return script_dir()


def script_dir():
    sdir = os.environ.get(SCRIPT_DIR_NAME)

# Path: test/framework/config.py



# Path: test/cfg.py
import os, socket
from enum import Enum
from .framework import config


def public_cli_url(api_type):
    if api_type != ApiType.SCRIPT:
        purl = os.environ.get('JENKINS_URL')
        if purl:
            return purl.rstrip('/') + '/jnlpJars/jenkins-cli.jar'
        purl = os.environ.get('HUDSON_URL')
        if purl:
            return purl.rstrip('/') + '/jnlpJars/hudson-cli.jar'
        # If neither JENKINS nor HUDSON URL is set, assume jenkins for testing
        return "http://" + socket.getfqdn() + ':' + repr(8080) + '/jnlpJars/jenkins-cli.jar'
    else:
        return script_dir()


proxied_public_url = "http://myproxy.mydom/jenkins"


def proxied_public_cli_url(api_type):
    # Not required to be a real url
    if api_type != ApiType.SCRIPT:
        # If neither JENKINS nor HUDSON URL is set, assume jenkins for testing
        cli = '/jnlpJars/hudson-cli.jar' if os.environ.get('HUDSON_URL') else '/jnlpJars/jenkins-cli.jar'
        return proxied_public_url + cli
    else:
        return script_dir()


def script_dir():
    sdir = os.environ.get(SCRIPT_DIR_NAME)

    return config.job_script_dir if sdir is None else sdir.rstrip('/')