Skip to content

Commit

Permalink
cleanup modules
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD committed Jun 4, 2024
1 parent 6476daf commit b3fc871
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 34 deletions.
2 changes: 0 additions & 2 deletions src/pyflask/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
neurosift_namespace,
startup_namespace,
system_namespace,
time_namespace,
)

neurosift_file_registry = collections.defaultdict(bool)
Expand Down Expand Up @@ -66,7 +65,6 @@
api.add_namespace(data_namespace)
api.add_namespace(system_namespace)
api.add_namespace(dandi_namespace)
api.add_namespace(time_namespace)
# api.add_namespace(neurosift_namespace) # TODO: enable later
api.init_app(flask_app)

Expand Down
1 change: 0 additions & 1 deletion src/pyflask/namespaces/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
from .neurosift import neurosift_namespace
from .startup import startup_namespace
from .system import system_namespace
from .time import time_namespace
23 changes: 23 additions & 0 deletions src/pyflask/namespaces/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,26 @@ def get(self) -> Union[Dict[str, int], None]:
logical = cpu_count()

return dict(physical=physical, logical=logical)

@system_namespace.route("/all_timezones")
class GetTimezones(flask_restx.Resource):

@time_namespace.doc(
description="Request the available timezones available to the backend.",
)
def get(self) -> List[str]:
import zoneinfo

return list(zoneinfo.available_timezones())


@system_namespace.route("/local_timezone")
class GetTimezones(flask_restx.Resource):

@time_namespace.doc(
description="Request the current timezone on the system.",
)
def get(self) -> str:
import tzlocal

return tzlocal.get_localzone_name()
31 changes: 0 additions & 31 deletions src/pyflask/namespaces/time.py

This file was deleted.

0 comments on commit b3fc871

Please sign in to comment.