Changeset - 047cc1b40374
[Not reviewed]
default
1 2 0
Dennis Fink - 3 years ago 2022-07-19 19:18:33
dennis.fink@c3l.lu
Remove state endpoint
3 files changed with 2 insertions and 35 deletions:
0 comments (0 inline, 0 general)
spaceapi/__init__.py
Show inline comments
 
@@ -88,16 +88,12 @@ def create_app():
 
        return response
 

	
 
    from .views import root_views
 

	
 
    app.register_blueprint(root_views)
 

	
 
    from .state import state_views
 

	
 
    app.register_blueprint(state_views, url_prefix="/state")
 

	
 
    from .sensors import sensors_views
 

	
 
    app.register_blueprint(sensors_views, url_prefix="/sensors")
 

	
 
    from .utils import ActiveStatusv14
 

	
spaceapi/state.py
Show inline comments
 
deleted file
spaceapi/utils.py
Show inline comments
 
@@ -2,13 +2,13 @@ import email
 
import email.policy
 
import json
 
import os.path
 
import random
 
import smtplib
 
import ssl
 
from functools import partial, wraps
 
from functools import partial
 
from time import time
 

	
 
import mastodon
 
import tweepy
 
from flask import current_app, request
 

	
 
@@ -41,13 +41,12 @@ possible_closed_messages = (
 
    "The ChaosStuff is now closed! Come back another time!",
 
    "Poweroff process finished! We're closed!",
 
    "Singularity reached! The space is closed!",
 
    "Dream of electric sheeps! We are closed!",
 
)
 

	
 
get_identification_key = partial(first, keys=frozenset(("name", "location")))
 

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

	
 

	
 
class Singleton:
 
    def __new__(cls, *args, **kwargs):
 
@@ -288,15 +287,7 @@ def first(iterable, keys):
 
        if key in iterable:
 
            return key
 

	
 
    raise ValueError
 

	
 

	
 
def pass_active_status(f):
 
    @wraps(f)
 
    def wrapper(*args, **kwargs):
 
        status = ActiveStatusv14()
 
        rv = f(status, *args, **kwargs)
 
        status.save_last_state()
 
        return rv
 

	
 
    return wrapper
 
get_identification_key = partial(first, keys=frozenset(("name", "location")))
0 comments (0 inline, 0 general)