Changeset - 275690f3bbdc
[Not reviewed]
default
0 3 0
Dennis Fink - 4 years ago 2021-03-20 12:36:37
dennis.fink@c3l.lu
Black autoformat
3 files changed with 20 insertions and 20 deletions:
0 comments (0 inline, 0 general)
setup.py
Show inline comments
 
from pprint import pprint
 

	
 
from setuptools import setup, find_packages
 
from setuptools import find_packages, setup
 

	
 
packages = find_packages()
 
packages.append('spaceapi.templates')
 
packages.append('spaceapi.static')
 
packages.append('spaceapi.schema')
 
packages.append("spaceapi.templates")
 
packages.append("spaceapi.static")
 
packages.append("spaceapi.schema")
 

	
 
setup(
 
    name='c3l_spaceapi',
 
    version='0.0.14',
 
    url=None,
 
    license='GPLv3+',
 
    author='Dennis Fink',
 
    author_email='dennis.fink@c3l.lu',
 
    description='spaceapi endpoint for c3l.lu',
 
    license="GPLv3+",
 
    author="Dennis Fink",
 
    author_email="dennis.fink@c3l.lu",
 
    description="spaceapi endpoint for c3l.lu",
 
    packages=packages,
 
    package_data={
 
        'spaceapi.templates': ['*'],
 
        'spaceapi.static': ['*'],
 
        'spaceapi.schema': ['*'],
 
        "spaceapi.templates": ["*"],
 
        "spaceapi.static": ["*"],
 
        "spaceapi.schema": ["*"],
 
    },
 
    install_requires=[
 
        'Flask',
 
        'Flask-HTTPAuth',
 
        'Flask-Bootstrap',
 
        'jsonschema',
 
        'tweepy',
 
        'Mastodon.py',
 
    ]
 
        "Flask",
 
        "Flask-HTTPAuth",
 
        "Flask-Bootstrap",
 
        "jsonschema",
 
        "tweepy",
 
        "Mastodon.py",
 
    ],
 
)
spaceapi/sensors.py
Show inline comments
 
import json
 
from functools import partial
 

	
 
from pkg_resources import resource_filename
 

	
 
import jsonschema
 
from flask import Blueprint, abort, current_app, jsonify, request
 
from pkg_resources import resource_filename
 

	
 
from .auth import httpauth
 
from .utils import ActiveStatus, ActiveStatusv14, first, fuzzy_list_find
 

	
 
sensors_views = Blueprint("sensors", __name__)
 

	
 
ALLOWED_SENSORS_KEYS = json.load(
 
    open(resource_filename("spaceapi", "schema/sensors.json"), encoding="utf-8")
 
)
 

	
 
RADIATON_SUBKEYS = frozenset(("alpha", "beta", "gamma", "beta_gamma"))
 

	
spaceapi/views.py
Show inline comments
 
@@ -105,15 +105,16 @@ def present():
 
            )
 
            if "present" in request.form:
 
                active.add_user_present(user)
 
                activev14.add_user_present(user)
 
            elif "leave" in request.form:
 
                active.remove_user_present(user)
 
                activev14.remove_user_present(user)
 
            else:
 
                return redirect(url_for("root.index"))
 

	
 
            active.save_last_state()
 
            activev14.save_last_state()
 

	
 
        return redirect(url_for("root.index"))
 

	
 
    return render_template("present.html")
0 comments (0 inline, 0 general)