cernopendata / cernopendata-client

CERN Open Data command-line client
http://cernopendata-client.readthedocs.io/
GNU General Public License v3.0
10 stars 9 forks source link

Consistency between top-level CLI notion behind "protocol" and low-level Searcher notion behind "protocol" #105

Closed ParthS007 closed 3 years ago

ParthS007 commented 3 years ago

I mean do we even need to pass protocol=https to these functions in the searcher? For consistency, shouldn't we pass protocol=http and server=https... as we do in top-level CLI? In this way, the Searcher expectations about server/protocol would fully comply with the CLI top-level notion of what server/protocol values might be... I'm wondering because inside Seacher we only use protocol, do no manipulation:

$ git grep protocol cernopendata_client/searcher.py
cernopendata_client/searcher.py:167:    server=None, record_json=None, protocol=None, expand=None, verbose=N>
cernopendata_client/searcher.py:173:    :protocol: Protocol to be used in links [http,xrootd]
cernopendata_client/searcher.py:178:    :type protocol: str
cernopendata_client/searcher.py:208:    if protocol == "http":
cernopendata_client/searcher.py:213:    elif protocol == "https":
cernopendata_client/searcher.py:225:def get_file_info_remote(server, recid, protocol=None, filtered_files=No>
cernopendata_client/searcher.py:248:        if protocol == "http":
cernopendata_client/searcher.py:250:        elif protocol == "https":

The consistency between top-level CLI notion behind "protocol" and low-level Searcher notion behind "protocol", would avoid possible confusions later on.

Anyway, this could be also addressed later.

_Originally posted by @tiborsimko in https://github.com/cernopendata/cernopendata-client/pull/96#discussion_r527010670_