Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jnumainville committed Feb 29, 2024
1 parent 050a18f commit 1639b79
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions plugins/packaging/src/deephaven/plugin/packaging/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import os
import subprocess

__all__ = ["package_js"]


def package_js(js_dir: str, dest_dir: str) -> None:
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
from deephaven.plugin import Callback, Plugin
from __future__ import annotations

from typing import Type
import logging
from deephaven.plugin import Callback, Plugin
from deephaven.plugin.js import JsPlugin
from .utils import in_enterprise_environment

logger = logging.getLogger(__name__)

__all__ = ["DheSafeCallbackWrapper"]


class DheSafeCallbackWrapper:
class DheSafeCallbackWrapper(Callback):
"""
A wrapper around the Callback class that provides a safe way to register plugins.
Expand All @@ -16,7 +21,7 @@ class DheSafeCallbackWrapper:
def __init__(self, callback: Callback):
self._callback = callback

def register(self, plugin: Plugin) -> None:
def register(self, plugin: Plugin | Type[Plugin]) -> None:
"""
Register a plugin with the provided callback
Expand Down
3 changes: 2 additions & 1 deletion plugins/utilities/src/deephaven/plugin/utilities/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import abc
import logging
import os
from functools import partial
from typing import Callable, ContextManager
import importlib.resources
Expand All @@ -11,6 +10,8 @@

logger = logging.getLogger(__name__)

__all__ = ["in_enterprise_environment", "create_js_plugin"]


def in_enterprise_environment() -> bool:
"""
Expand Down

0 comments on commit 1639b79

Please sign in to comment.