Skip to content
Snippets Groups Projects
Commit 95ed5f76 authored by Alexandar Mechev's avatar Alexandar Mechev
Browse files

Added auto-doc of sandbox module, updating Token_Handler with example usage

parent 4dad07fd
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,19 @@ class Token_Handler:
"""
def __init__(self, t_type="token", srv="https://picas-lofar.grid.sara.nl:6984", uname="", pwd="", dbn=""):
"""
>>> #Example creation of a token of token_type 'test'
>>> from GRID_LRT.get_picas_credentials import picas_cred
>>> pc=picas_cred() #Gets picas_credentials
>>>
>>> th=Token.Token_Handler( t_type="test", srv="https://picas-lofar.grid.sara.nl:6984", uname=pc.user, pwd=pc.password, dbn=pc.database ) #creates object to 'handle' Tokens
>>> th.add_overview_view()
>>> th.add_status_views() #Adds 'todo', 'done', 'locked' and 'error' views
>>> th.load_views()
>>> th.views.keys()
>>> th.reset_tokens(view_name='error') # resets all tokens in 'error' view
>>> th.set_view_to_status(view_name='done','processed')
"""
if t_type:
self.t_type = t_type
else:
......
......@@ -16,6 +16,7 @@ This package is built by Alexandar Mechev and the LOFAR e-infra group at Leiden
installing
token
staging
sandbox
Indices and tables
==================
......
.. _Staging:
Sandbox Module
=============
The Sandbox module creates a tar archive of the scripts to be distributed to the worker nodes at the launch of a PiCaS job. The location of the sandbox is stored in the PiCaS token and upon launch, it is downloaded and extracted. The sandbox is created from a configuration file which defines its name, location scrts repository and any additional processing scripts, such as prefactor.
.. _sbx_doc:
GRID_LRT.sandbox
--------------------
.. automodule:: GRID_LRT.sandbox
:members:
:undoc-members:
:inherited-members:
:show-inheritance:
......@@ -7,7 +7,11 @@ This module is responsible for interactions with CouchDB using the PiCaS token f
Token.py
==========
Location: GRID_LRT/Token.py
Imports:
from GRID_LRT.Token import Token_Handler
from GRID_LRT.Token import TokenSet
Class Documentation:
TokenHandler
------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment