Skip to content

Commit

Permalink
cleaning up the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mletter1 committed Jun 18, 2020
1 parent f4f9799 commit dfd07b5
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 29 deletions.
3 changes: 2 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SPHINXPROJ = Slycat
SOURCEDIR = source
BUILDDIR = build
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
Expand Down
8 changes: 5 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ def __getattr__(cls, name):
# -- Project information -----------------------------------------------------

project = 'Slycat'
copyright = '2020, Matthew Letter'
copyright = """2013, Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain
rights in this software"""
author = 'Matthew Letter'

# The full version, including alpha/beta/rc tags
Expand All @@ -66,15 +68,15 @@ def __getattr__(cls, name):
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
63 changes: 38 additions & 25 deletions packages/slycat/web/server/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2629,32 +2629,45 @@ def post_remote_browse(hostname, path):

def get_remote_file(hostname, path, **kwargs):
"""
Uses an existing remote session to retrieve a remote file. The remote
session must have been created using :http:post:`/api/remotes`. Use
:http:post:`/api/remotes/(hostname)/browse(path)` to lookup remote file paths.
The returned file may be optionally cached on the server and retrieved
using :http:get:`/api/projects/(pid)/cache/(key)`.
:param hostname: connection host name
:param path: path to file
:param kwargs:
Query Parameters
:param cache: – Optional cache identifier.
Set to project to store the retrieved file in a project cache.
:param project: – Project identifier. Required when cache is set to project.
:param key: – Cached object key. Must be specified when cache is set to project.
:return: file
Status Codes
200 OK – The requested file is returned in the body of the response.
404 Not Found – The session doesn’t exist or has timed-out.
400 Bad Request – “Can’t read directory” The remote path
is a directory instead of a file.
400 Bad Request – “File not found” The remote path doesn’t exist.
400 Bad Request – “Access denied” The session user doesn’t have
permissions to access the file.
Uses an existing remote session to retrieve a remote file. The remote
session must have been created using :http:post:`/api/remotes`. Use
:http:post:`/api/remotes/(hostname)/browse(path)` to lookup remote file paths.
The returned file may be optionally cached on the server and retrieved
using :http:get:`/api/projects/(pid)/cache/(key)`.
Parameters
----------
hostname: string
connection host name
path: string
path to file
kwargs: json
cache: –
Optional cache identifier.
Set to project to store the retrieved file in a project cache.
project: uuid
Project identifier. Required when cache is set to project.
key: uuid
Cached object key. Must be specified when cache is set to project.
Returns
-------
file: binary
the file that was asked for
Raises
------
200 OK
The requested file is returned in the body of the response.
404 Not Found
The session doesn’t exist or has timed-out.
400 Bad Request
“Can’t read directory” The remote path is a directory instead of a file.
400 Bad Request
“File not found” The remote path doesn’t exist.
400 Bad Request
“Access denied” The session user doesn’t have permissions to access the file.
"""

sid = get_sid(hostname)
with slycat.web.server.remote.get_session(sid) as session:
return session.get_file(path, **kwargs)
Expand Down

0 comments on commit dfd07b5

Please sign in to comment.