pico: accepting ip with http://

This commit is contained in:
Jakub Jezek 2019-01-10 16:15:41 +01:00
parent 0ebcf78fee
commit be134b1b77
2 changed files with 8 additions and 1 deletions

View file

@ -124,6 +124,8 @@ class PicoClient(object):
def load(module_name):
ip = os.getenv("PICO_IP", '127.0.0.1')
if ip.startswith('http'):
ip = ip.replace("http://", "")
port = int(os.getenv("PICO_PORT", 4242))
client = PicoClient(
"http://{0}:{1}".format(ip, port)

View file

@ -40,7 +40,12 @@ if __name__ == '__main__':
module_name += ':app'
app = import_string(module_name)
kwargs = {"ip": os.getenv("PICO_IP", None),
ip = os.getenv("PICO_IP", None)
if ip and ip.startswith('http'):
ip = ip.replace("http://", "")
kwargs = {"ip": ip,
"port": int(os.getenv("PICO_PORT", None)),
"use_debugger": os.getenv("PICO_DEBUG", None),
"use_reloader": os.getenv("PICO_RELOADER", None),