Beispiel #1
0
def get_page(mod, template=False, colors=None):
    """
  Description:
  ------------
  Get the page object from the imported module.

  Attributes:
  ----------
  :param mod: Module. The Python imported module used to build the page.
  :param template: Boolean. Optional.
  :param colors: String. Optional. The list of colors as string commas delimited.
  """

    if colors is not None:
        old_colors = ThemeDefault._colors
        ThemeDefault._colors = colors.split(",")

    if hasattr(mod, 'get_page'):
        try:
            from epyk_studio.core.Page import Report

            page = Report()
            page.json_config_file = mod.__name__
        except Exception as err:
            from epyk.core.Page import Report

            page = Report()
            page.json_config_file = mod.__name__
        if template and hasattr(mod, 'INPUTS'):
            page.inputs = {i: "%%(%s)s" % i for i in mod.INPUTS}
        mod.get_page(page)

        if colors is not None:
            ThemeDefault._colors = old_colors
        return page

    if colors is not None:
        ThemeDefault._colors = old_colors
    return mod.page
Beispiel #2
0
from epyk_studio.core.Page import Report
from epyk.core.css.themes import ThemeDark

page = Report()
page.inputs = {"lang": 'fr', 'theme': 'ThemeBlue.Blue'}

s = page.studio.themes()
l = page.studio.langs()

nav = page.studio.nav(title="Code Betas")
nav.add_right(l)
nav.add_right(s)

page.studio.vitrine.cover(
    r"C:\Users\olivier\Documents\GitHub\epyk-templates\static\assets\header.PNG"
)

b = page.studio.button("Test")

page.body.onReady([b.dom.events.trigger("click", options={"timer": 10})])

t1 = page.ui.text("TTTTTTTTTTT")
t2 = page.ui.text("2222222222222")

# page.ui.icons.timer(2, [
#   page.js.console.log("Test")
# ])

page.ui.buttons.live(2, [page.js.console.log("live")])

t1.style.effects.fade_out()