From afd5fac0aac8d13f204bb5ab140c0904bb3d38cf Mon Sep 17 00:00:00 2001 From: Nadja Reitzenstein Date: Thu, 28 Apr 2022 17:55:41 +0200 Subject: [PATCH] updates --- Pipfile | 18 ++++++++++++++++++ README.md | 14 ++++++++++++++ fabapi/api.py | 7 +++++++ fabapi/connect.py | 6 +++--- fabapi/user_system.py | 12 ++++++++++++ pycapnp | 2 +- 6 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 Pipfile create mode 100644 README.md create mode 100644 fabapi/api.py create mode 100644 fabapi/user_system.py diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..6a49e65 --- /dev/null +++ b/Pipfile @@ -0,0 +1,18 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +pkgconfig = "*" +pytest = "*" +sphinx-multiversion = "*" +tox = "*" +Jinja2 = "*" +Cython = "*" +Sphinx = "*" + +[dev-packages] + +[requires] +python_version = "3.10" diff --git a/README.md b/README.md new file mode 100644 index 0000000..0c7a637 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# FabAccess for Python + +Small library to give access to the FabAccess API for administration and development + +## Setup + +Clone this repo with the option `--recursive` for submodules or run `git submodule update --init` if you did not +clone recursively. + +Installing dependencies using pipenv: + +```shell +$ pipenv +``` \ No newline at end of file diff --git a/fabapi/api.py b/fabapi/api.py new file mode 100644 index 0000000..82dd6f3 --- /dev/null +++ b/fabapi/api.py @@ -0,0 +1,7 @@ +import os +import capnp + +path = os.path.dirname(os.path.abspath(__file__)) + +connection_capnp = capnp.load(path + '/schema/connection.capnp') +authenticationsystem = capnp.load(path + '/schema/authenticationsystem.capnp') \ No newline at end of file diff --git a/fabapi/connect.py b/fabapi/connect.py index 3e20351..9c01dbe 100644 --- a/fabapi/connect.py +++ b/fabapi/connect.py @@ -2,9 +2,9 @@ import asyncio import socket import ssl -import capnp -connection_capnp = capnp.load('schema/connection.capnp') -authenticationsystem_capnp = capnp.load('schema/authenticationsystem.capnp') +from fabapi import api +connection_capnp = api.connection_capnp +authenticationsystem_capnp = api.authenticationsystem async def myreader(client, reader): while True: diff --git a/fabapi/user_system.py b/fabapi/user_system.py new file mode 100644 index 0000000..e4a0271 --- /dev/null +++ b/fabapi/user_system.py @@ -0,0 +1,12 @@ + + +class UserSystem: + """ + Higher-level API for managing users + """ + + api_usersystem = None + + def __init__(self, usersystem): + self.api_usersystem = usersystem + diff --git a/pycapnp b/pycapnp index 5dade41..d49f4a9 160000 --- a/pycapnp +++ b/pycapnp @@ -1 +1 @@ -Subproject commit 5dade41aebcee627ef65e4f3471d7568dcd7a5e2 +Subproject commit d49f4a9813ac9c3100f63b11d4dc47ceb3397b75