Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make cli command leaner
- Loading branch information
Showing
11 changed files
with
833 additions
and
820 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/sh | ||
|
||
python3 starfyre --dev=True --path="test-application/" && python -m starfyre --build=True --path="test-application/" | ||
python3 starfyre --build --path="my-first-app" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
import inspect | ||
from starfyre.dom_methods import render, render_root | ||
from .compiler import compile | ||
|
||
from starfyre.component import Component | ||
from .transpiler import transpile | ||
|
||
from .parser import RootParser | ||
|
||
|
||
def create_component(pyml="", css="", js="", client_side_python=""): | ||
if client_side_python: | ||
new_js = transpile(client_side_python) + js | ||
js = new_js | ||
|
||
local_variables = inspect.currentframe().f_back.f_back.f_locals.copy() | ||
global_variables = inspect.currentframe().f_back.f_back.f_globals.copy() | ||
|
||
parser = RootParser(local_variables, global_variables, css, js) | ||
pyml = pyml.strip("\n").strip() | ||
parser.feed(pyml) | ||
parser.close() | ||
pyml_root = parser.get_root() | ||
|
||
if pyml_root is None: | ||
return Component("div", {}, [], {}, {}, uuid="store", js=js) | ||
|
||
return pyml_root | ||
|
||
|
||
__all__ = [ | ||
"create_component", | ||
"render", | ||
"render_root", | ||
"compile", | ||
"transpile", | ||
"Component", | ||
] | ||
import inspect | ||
from starfyre.dom_methods import render, render_root | ||
from .compiler import compile | ||
|
||
from starfyre.component import Component | ||
from .transpiler import transpile | ||
|
||
from .parser import RootParser | ||
|
||
|
||
def create_component(pyml="", css="", js="", client_side_python=""): | ||
if client_side_python: | ||
new_js = transpile(client_side_python) + js | ||
js = new_js | ||
|
||
local_variables = inspect.currentframe().f_back.f_back.f_locals.copy() | ||
global_variables = inspect.currentframe().f_back.f_back.f_globals.copy() | ||
|
||
parser = RootParser(local_variables, global_variables, css, js) | ||
pyml = pyml.strip("\n").strip() | ||
parser.feed(pyml) | ||
parser.close() | ||
pyml_root = parser.get_root() | ||
|
||
if pyml_root is None: | ||
return Component("div", {}, [], {}, {}, uuid="store", js=js) | ||
|
||
return pyml_root | ||
|
||
|
||
__all__ = [ | ||
"create_component", | ||
"render", | ||
"render_root", | ||
"compile", | ||
"transpile", | ||
"Component", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.