# Path: vcontrol/rest/helpers/get_allowed.py
# def get_allowed():
#     rest_url = ""
#     if "ALLOW_ORIGIN" in os.environ:
#         allow_origin = os.environ["ALLOW_ORIGIN"]
#         host_port = allow_origin.split("//")[1]
#         host = host_port.split(":")[0]
#         port = str(int(host_port.split(":")[1])+1)
#         rest_url = host+":"+port
#     else:
#         allow_origin = ""
#     return allow_origin, rest_url


from ..helpers import get_allowed
import os
import subprocess
import web


class UploadCommandR:
    """
    This endpoint is for getting uploading a file to a Vent machine to be
    processed.
    """

# Path: vcontrol/rest/helpers/get_allowed.py
# def get_allowed():
#     rest_url = ""
#     if "ALLOW_ORIGIN" in os.environ:
#         allow_origin = os.environ["ALLOW_ORIGIN"]
#         host_port = allow_origin.split("//")[1]
#         host = host_port.split(":")[0]
#         port = str(int(host_port.split(":")[1])+1)
#         rest_url = host+":"+port
#     else:
#         allow_origin = ""
#     return allow_origin, rest_url


# Path: vcontrol/rest/commands/upload.py
from ..helpers import get_allowed
import os
import subprocess
import web



class UploadCommandR:
    """
    This endpoint is for getting uploading a file to a Vent machine to be
    processed.
    """

    allow_origin, rest_url = get_allowed.get_allowed()