From 0f7e86e86dc311d3150d445cfb500534055974c1 Mon Sep 17 00:00:00 2001 From: Martin Turoci Date: Wed, 16 Nov 2022 13:14:37 +0100 Subject: [PATCH] fix: Rename API tmp. #1601 --- py/h2o_wave/types.py | 36 ++++++------- py/h2o_wave/ui.py | 12 ++--- r/R/ui.R | 16 +++--- .../resources/templates/wave-components.xml | 12 ++--- .../vscode-extension/component-snippets.json | 4 +- ui/src/audio_annotator.test.tsx | 18 +++---- ui/src/audio_annotator.tsx | 52 +++++++++---------- 7 files changed, 75 insertions(+), 75 deletions(-) diff --git a/py/h2o_wave/types.py b/py/h2o_wave/types.py index e78b4439ad..60bde8cea8 100644 --- a/py/h2o_wave/types.py +++ b/py/h2o_wave/types.py @@ -6732,46 +6732,46 @@ class AudioAnnotatorItem: """ def __init__( self, - from: float, - to: float, + range_from: float, + range_to: float, tag: str, ): - _guard_scalar('AudioAnnotatorItem.from', from, (float, int,), False, False, False) - _guard_scalar('AudioAnnotatorItem.to', to, (float, int,), False, False, False) + _guard_scalar('AudioAnnotatorItem.range_from', range_from, (float, int,), False, False, False) + _guard_scalar('AudioAnnotatorItem.range_to', range_to, (float, int,), False, False, False) _guard_scalar('AudioAnnotatorItem.tag', tag, (str,), False, False, False) - self.from = from + self.range_from = range_from """The start of the audio annotation in seconds.""" - self.to = to + self.range_to = range_to """The end of the audio annotation in seconds.""" self.tag = tag """The `name` of the audio annotator tag to refer to for the `label` and `color` of this item.""" def dump(self) -> Dict: """Returns the contents of this object as a dict.""" - _guard_scalar('AudioAnnotatorItem.from', self.from, (float, int,), False, False, False) - _guard_scalar('AudioAnnotatorItem.to', self.to, (float, int,), False, False, False) + _guard_scalar('AudioAnnotatorItem.range_from', self.range_from, (float, int,), False, False, False) + _guard_scalar('AudioAnnotatorItem.range_to', self.range_to, (float, int,), False, False, False) _guard_scalar('AudioAnnotatorItem.tag', self.tag, (str,), False, False, False) return _dump( - from=self.from, - to=self.to, + range_from=self.range_from, + range_to=self.range_to, tag=self.tag, ) @staticmethod def load(__d: Dict) -> 'AudioAnnotatorItem': """Creates an instance of this class using the contents of a dict.""" - __d_from: Any = __d.get('from') - _guard_scalar('AudioAnnotatorItem.from', __d_from, (float, int,), False, False, False) - __d_to: Any = __d.get('to') - _guard_scalar('AudioAnnotatorItem.to', __d_to, (float, int,), False, False, False) + __d_range_from: Any = __d.get('range_from') + _guard_scalar('AudioAnnotatorItem.range_from', __d_range_from, (float, int,), False, False, False) + __d_range_to: Any = __d.get('range_to') + _guard_scalar('AudioAnnotatorItem.range_to', __d_range_to, (float, int,), False, False, False) __d_tag: Any = __d.get('tag') _guard_scalar('AudioAnnotatorItem.tag', __d_tag, (str,), False, False, False) - from: float = __d_from - to: float = __d_to + range_from: float = __d_range_from + range_to: float = __d_range_to tag: str = __d_tag return AudioAnnotatorItem( - from, - to, + range_from, + range_to, tag, ) diff --git a/py/h2o_wave/ui.py b/py/h2o_wave/ui.py index 6360b64b73..6239287667 100644 --- a/py/h2o_wave/ui.py +++ b/py/h2o_wave/ui.py @@ -2506,22 +2506,22 @@ def audio_annotator_tag( def audio_annotator_item( - from: float, - to: float, + range_from: float, + range_to: float, tag: str, ) -> AudioAnnotatorItem: """Create an annotator item with initial selected tags or no tags. Args: - from: The start of the audio annotation in seconds. - to: The end of the audio annotation in seconds. + range_from: The start of the audio annotation in seconds. + range_to: The end of the audio annotation in seconds. tag: The `name` of the audio annotator tag to refer to for the `label` and `color` of this item. Returns: A `h2o_wave.types.AudioAnnotatorItem` instance. """ return AudioAnnotatorItem( - from, - to, + range_from, + range_to, tag, ) diff --git a/r/R/ui.R b/r/R/ui.R index 6b964c92cc..d08281d060 100644 --- a/r/R/ui.R +++ b/r/R/ui.R @@ -2911,21 +2911,21 @@ ui_audio_annotator_tag <- function( #' Create an annotator item with initial selected tags or no tags. #' -#' @param from The start of the audio annotation in seconds. -#' @param to The end of the audio annotation in seconds. +#' @param range_from The start of the audio annotation in seconds. +#' @param range_to The end of the audio annotation in seconds. #' @param tag The `name` of the audio annotator tag to refer to for the `label` and `color` of this item. #' @return A AudioAnnotatorItem instance. #' @export ui_audio_annotator_item <- function( - from, - to, + range_from, + range_to, tag) { - .guard_scalar("from", "numeric", from) - .guard_scalar("to", "numeric", to) + .guard_scalar("range_from", "numeric", range_from) + .guard_scalar("range_to", "numeric", range_to) .guard_scalar("tag", "character", tag) .o <- list( - from=from, - to=to, + range_from=range_from, + range_to=range_to, tag=tag) class(.o) <- append(class(.o), c(.wave_obj, "WaveAudioAnnotatorItem")) return(.o) diff --git a/tools/intellij-plugin/src/main/resources/templates/wave-components.xml b/tools/intellij-plugin/src/main/resources/templates/wave-components.xml index c912638357..609481c52a 100644 --- a/tools/intellij-plugin/src/main/resources/templates/wave-components.xml +++ b/tools/intellij-plugin/src/main/resources/templates/wave-components.xml @@ -14,9 +14,9 @@