Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vavalomi committed Jun 8, 2022
1 parent 9c46503 commit 45e75e8
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
4 changes: 3 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#
import os
import sys
from datetime import datetime

src = os.path.abspath('..')
sys.path.insert(0, src)
Expand All @@ -26,6 +27,7 @@
author = about['__author__']
version = about['__version__']
release = about['__version__']
copyright = f"{datetime.now().year} {author}"


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -73,7 +75,7 @@
'analytics_id': 'UA-129284684-2',
'github_button': True,
'fixed_sidebar': True,
'extra_nav_links': {'Survey Solutions Documentation': 'https://support.mysurvey.solutions'}
'extra_nav_links': {'Survey Solutions Documentation': 'https://docs.mysurvey.solutions'}
}

html_static_path = ['_static']
Expand Down
1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Table of Contents
ssaw.settings
ssaw.users
ssaw.workspaces
ssaw.models

Indices and tables
==================
Expand Down
14 changes: 11 additions & 3 deletions docs/ssaw.export.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
Export
======

.. py:module:: ssaw.export
.. autoclass:: ExportApi()
:members:
:undoc-members:
The export module contains methods to find and download an already generated data package, or trigger and manage a new generation job.


.. py:class:: ExportApi
.. automethod:: get_list
.. automethod:: get
.. automethod:: get_info
.. automethod:: start
.. automethod:: cancel
7 changes: 0 additions & 7 deletions docs/ssaw.models.rst

This file was deleted.

12 changes: 12 additions & 0 deletions ssaw/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,17 @@ def viewer(self, username: Optional[str] = None, password: Optional[str] = None)
return (op + cont).viewer

def lock(self, user_name: Optional[str] = None, user_id: Optional[str] = None):
"""Lock user given either the username or guid.
Currently only works for the admin user!
"""
self._lock_unlock(lock=True, user_name=user_name, user_id=user_id)

def unlock(self, user_name: Optional[str] = None, user_id: Optional[str] = None):
"""Unlock user given either the username or guid.
Currently only works for the admin user!
"""
self._lock_unlock(lock=False, user_name=user_name, user_id=user_id)

def _lock_unlock(self, lock: bool, user_name: Optional[str] = None, user_id: Optional[str] = None):
Expand All @@ -118,6 +126,10 @@ def _lock_unlock(self, lock: bool, user_name: Optional[str] = None, user_id: Opt
raise ValueError("either user_name or user_id must be provided")

def change_password(self, password: str, user_name: Optional[str] = None, user_id: Optional[str] = None):
"""Change password for a user.
Currently only works for the admin user!
"""
if user_name:
try:
user_id = next(self.get_list(fields=["id"], user_name=user_name, take=1)).id
Expand Down

0 comments on commit 45e75e8

Please sign in to comment.