Commit 7e4fc243 authored by Maude Le Jeune's avatar Maude Le Jeune
Browse files

doc last

parent 6ba207fb
......@@ -22,4 +22,6 @@ pipelet Package
task module <task>
tracker module <tracker>
utils module <utils>
web module <web>
treeview module <treeview>
:mod:`treeview` Module
-------------------
.. automodule:: pipelet.treeview
:members:
:undoc-members:
:show-inheritance:
:mod:`web` Module
-------------------
.. automodule:: pipelet.web
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pipelet.auth
:members:
:undoc-members:
:show-inheritance:
......@@ -33,3 +33,5 @@ __version__='9a228d498a98e442020758e6976a12c692c2c774'
__version__='9a228d498a98e442020758e6976a12c692c2c774'
__version__='9a228d498a98e442020758e6976a12c692c2c774'
__version__='6ba207fbc04582bf2fb6858b9a56a1094a3b050d'
......@@ -15,10 +15,8 @@ def check_access(auth_type, access_level):
- check the access level of an otherwise authenticated user
- perform Basic http authentication and check access rights
- perform Digest http authentication and check access rights
Parameters:
-----------
auth_type: either 'None', 'ACL', 'Basic', 'Digest'
access_level: the required access level.
auth_type is either 'None', 'ACL', 'Basic', 'Digest'
"""
realm = "pipeweb"
if auth_type == 'None':
......@@ -55,15 +53,8 @@ def check_access(auth_type, access_level):
return False
def get_credentials(access_level=1):
""" Get users/passwd from pipe data base.
Parameters
----------
access_level: int, 1 for read-only or 2 for read-write access
Returns
-------
dictionnary of user and passwd
""" Get users/passwd from pipe data base.
access_level is 1 for read-only or 2 for read-write access. return dictionnary of user and passwd
"""
db_file = cherrypy.request.app.root.which_sqlfile(cherrypy.request.path_info)
try:
......@@ -117,9 +108,7 @@ pipeauth.write_access = cherrypy.Tool('on_start_resource', write_access)
def acl_setup(db_file):
""" Set user/passwd table in pipe database.
Parameters
----------
db_file: string, pipe data base file
"""
conn = sqlite3.connect(db_file,check_same_thread=True)
with conn:
......@@ -130,12 +119,7 @@ def acl_setup(db_file):
def add_user(db_file, user, passwd, access_level=1):
""" Add user entry to data base.
Parameters
----------
db_file: string, pipe data base file
user: string, user name
passwd: string, user password
access_level: int, 1 for read-only or 2 for read-write access
"""
conn = sqlite3.connect(db_file,check_same_thread=True)
acl_setup(db_file)
......@@ -146,10 +130,7 @@ def add_user(db_file, user, passwd, access_level=1):
def del_user(db_file, user):
""" Delete user entry from data base.
Parameters
----------
db_file: string, pipe data base file
user: string, user name
"""
conn = sqlite3.connect(db_file,check_same_thread=True)
with conn:
......
......@@ -44,10 +44,6 @@ class TreeView:
def __init__(self, db_file, name):
""" Initialize a web instance.
Parameters
----------
db_file: string, file name of the pipe data base.
name: string, short name
"""
## string, pipeline short name
self.name = name
......@@ -115,13 +111,6 @@ class TreeView:
corresponds to the union.
Tag are set for leafs only. Upstream parents are
added to the list if recursive is set to True.
Parameters
----------
tag: string
date: string queued on
segment: segment name
recursive: show parents or not
"""
lstseg = []
recursive = eval(recursive)
......@@ -298,9 +287,7 @@ class TreeView:
Print the pipeline instances trough a tree view.
Parameters
----------
highlight: list of segid (optional), filter the printed seg by segid.
"""
conn = sqlite3.connect(self.db_file,check_same_thread=True)
conn.text_factory=str
......@@ -339,12 +326,7 @@ class TreeView:
def product(self, segid=None, status=None):
""" Products index.
Print the content of the product directory.
Parameters
----------
currdir: string, pipeline instance path.
status: string, product status ('done', 'queued', 'running', 'failed')
Print the content of the product directory. status in ('done', 'queued', 'running', 'failed')
"""
conn = sqlite3.connect(self.db_file,check_same_thread=True)
with conn:
......@@ -375,9 +357,7 @@ class TreeView:
Print the content of a segment directory (code files, parameters file, ...)
Parameters
----------
currdir: string, pipeline instance path.
"""
highlight = _get_fathers(self.db_file,segid)
conn = sqlite3.connect(self.db_file,check_same_thread=True)
......@@ -401,10 +381,7 @@ class TreeView:
""" Delete a pipeline instance.
Delete all segments and products directories of a given pipeline instance.
Parameters
----------
segid: string, list of pipe id '-' separated
The list of pipe id is '-' separated
"""
cherrypy.log.error_log.warning('called ONCE')
seglist = seglist.split("-")
......@@ -426,13 +403,7 @@ class TreeView:
@auth.pipeauth.write_access()
def del_lst_prod(self, segid, taskid):
""" Delete recursively a list of products.
Delete products directories of a given task id.
Parameters
----------
segid: integer
taskid: string, list of task id '-' separated
Delete products directories of a given task id. The list of task id is '-' separated
"""
cherrypy.log.error_log.warning('called ONCE')
tasklist = taskid.split("-")
......@@ -552,9 +523,7 @@ class TreeView:
Text files and pickle are printed directly.
Parameters
----------
filepath: string, file name.
"""
filepath = self.check_path(segid, filepath)
if download is not None:
......@@ -572,9 +541,7 @@ class TreeView:
def serve_pickle (self, filename):
""" Expose pickle file content
Parameters
----------
filename: string, file name.
"""
import cPickle as pickle
f = file(filename)
......
......@@ -71,14 +71,8 @@ class PipeIndex():
def which_sqlfile(self, path_info):
""" Return data base filename
Parameters
----------
path_info: string, path read from configuration file .pipelet.
path_info read from configuration file .pipelet.
Returns
-------
string, data base file name.
"""
try:
pipe = path_info.split('/')[1]
......@@ -123,12 +117,8 @@ class MyApp(cherrypy.Application):
def __init__(self, domain, domaindir, script_name="", config=None, pipeview=TreeView):
""" Initialize the web application.
Parameters
----------
domain: string
domaindir: string
script_name: the URL "mount point" for the application
config: a dict of {path: pathconf} pairs, where 'pathconf' is itself a dict of {key: value} pairs
script_name is the URL "mount point" for the application
config is a dict of {path: pathconf} pairs, where 'pathconf' is itself a dict of {key: value} pairs
"""
## string
self.domain = domain
......@@ -147,10 +137,6 @@ def start(config, fastcgi=False):
Store the PID in the file specified in config.
Parameters
----------
config: dict where internal config is stored
config_file: string, user config file
"""
from cherrypy.process.plugins import Daemonizer, PIDFile
......@@ -180,10 +166,7 @@ def stop(config):
Look for the PID in the file specified in config.
Parameters
----------
config: dict, where internal config is stored
config_file: string, user config file
"""
import signal
cherrypy.config.update(config)
......@@ -196,13 +179,7 @@ def update_config(pipename, pipepath, config_file, delete=False, view=None):
""" Add a new Pipeline entry to the config file.
If the config file does not exist, create a new one.
Parameters
----------
pipename: string, pipe short name
pipepath: string, pipe instance root path
config_file: string, user config file
delete: boolean, if True remove pipe from list
if delete is True remove pipe from list
"""
import ConfigParser
c = ConfigParser.ConfigParser()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment