Skip to content
Snippets Groups Projects
Unverified Commit cc3e6691 authored by Daniel's avatar Daniel
Browse files

DOC: Documentation.

parent 914b912d
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@
#
"""unauthenticated.
An Authentictor which suppresses any authentication and also ignores auth_token
An Authenticator which suppresses any authentication and also ignores auth_token
cookies.
"""
from __future__ import absolute_import, unicode_literals, print_function
......
......@@ -291,7 +291,8 @@ USAGE
"`password_method` of the connection is set to "
"`auth_token` and the respective configuration "
"from the pycaosdb.ini is effectively being "
"overridden."))
"overridden.\nTODO: Also allow passing the token "
"via environmenty variables."))
subparsers = parser.add_subparsers(
title="commands",
metavar="COMMAND",
......
......@@ -34,6 +34,12 @@ from caosdb.connection.encode import MultipartParam, multipart_encode
def _make_params(pos_args, opts):
"""Create and return option string components.
The return value is a dict with be something like `-O<key>`:`<value>` from `opts` and
`-p{0,1,2,3,...}`:`<value>` from `pos_args`.
"""
result = {}
for key, val in opts.items():
result["-O{key}".format(key=key)] = str(val)
......@@ -43,6 +49,8 @@ def _make_params(pos_args, opts):
def _make_multipart_request(call, pos_args, opts, files):
"""Return body and header for an HTTP request.
"""
parts = list()
params = _make_params(pos_args, opts)
......@@ -59,6 +67,7 @@ def _make_multipart_request(call, pos_args, opts, files):
def _make_form_request(call, pos_args, opts):
"""Return URL from call and argumewnts, and headers for urlencoding."""
form = dict()
form["call"] = call
......@@ -73,6 +82,8 @@ def _make_form_request(call, pos_args, opts):
def _make_request(call, pos_args, opts, files=None):
"""
Multipart if with files, otherwise url-encoded.
Return
------
path_segments, body, headers
......
......@@ -5,6 +5,8 @@
#
# Copyright (C) 2018 Research Group Biomedical Physics,
# Max-Planck-Institute for Dynamics and Self-Organization Göttingen
# Copyright (C) 2020 Indiscale GmbH <info@indiscale.com>
# Copyright (C) 2020 Timm Fitschen <f.fitschen@indiscale.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment