How to use the ipysheet._version.__version_js__ function in ipysheet

To help you get started, we’ve selected a few ipysheet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github QuantStack / ipysheet / ipysheet / sheet.py View on Github external
import ipywidgets as widgets
import traitlets
from traitlets import Unicode, CInt, List, Tuple, Instance, Union, Dict, Bool, Any

from .serializer import create_value_serializer
from .utils import transpose, adapt_value
from ._version import __version_js__

semver_range_frontend = "~" + __version_js__


@widgets.register('ipysheet.Cell')
class Cell(widgets.Widget):
    _model_name = Unicode('CellRangeModel').tag(sync=True)
    _model_module = Unicode('ipysheet').tag(sync=True)
    # _view_module_version = Unicode('^0.1.0').tag(sync=True)
    _model_module_version = Unicode(semver_range_frontend).tag(sync=True)

    # value = Union([Bool(), Unicode(), Float(), Int()], allow_none=True, default_value=None).tag(sync=True)
    value = Any().tag(sync=True, **create_value_serializer('value'))
    row_start = CInt(3).tag(sync=True)
    column_start = CInt(4).tag(sync=True)
    row_end = CInt(3).tag(sync=True)
    column_end = CInt(4).tag(sync=True)
    type = Unicode(None, allow_none=True).tag(sync=True)