Add auto inference of host scheme in CLI (#2240)

* Add auto inference of host scheme in CLI

* update changelog
main
Maxim Zhiltsov 5 years ago committed by GitHub
parent 072482ffe8
commit f138859c1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -30,6 +30,7 @@ filters and searching the nearest frame without any annotations (<https://github
- Nuclio became an optional component of CVAT (<https://github.com/openvinotoolkit/cvat/pull/2192>)
- A key to remove a point from a polyshape [Ctrl => Alt] (<https://github.com/openvinotoolkit/cvat/pull/2204>)
- Updated `docker-compose` file version from `2.3` to `3.3`(<https://github.com/openvinotoolkit/cvat/pull/2235>)
- Added auto inference of url schema from host in CLI, if provided (<https://github.com/openvinotoolkit/cvat/pull/2240>)
### Deprecated
-

@ -182,8 +182,13 @@ class CVAT_API_V1():
""" Build parameterized API URLs """
def __init__(self, host, https=False):
prefix = 'https' if https else 'http'
self.base = '{}://{}/api/v1/'.format(prefix, host)
if host.startswith('https://'):
https = True
if host.startswith('http://') or host.startswith('https://'):
host = host.replace('http://', '')
host = host.replace('https://', '')
scheme = 'https' if https else 'http'
self.base = '{}://{}/api/v1/'.format(scheme, host)
@property
def tasks(self):

Loading…
Cancel
Save