Skip to content

Commit

Permalink
Merge branch 'develop' into bug/#1529-chart-fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
FredLL-Avaiga authored Jul 22, 2024
2 parents 71aa64b + 4001737 commit 05bd38a
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 30 deletions.
10 changes: 5 additions & 5 deletions taipy/_cli/_scaffold_cli.py → taipy/_cli/_create_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
from ._base_cli._taipy_parser import _TaipyParser


class _ScaffoldCLI(_AbstractCLI):
class _CreateCLI(_AbstractCLI):
_template_map: Dict[str, str] = {}

_COMMAND_NAME = "create"
_ARGUMENTS = ["--template"]
_ARGUMENTS = ["--application"]

@classmethod
def generate_template_map(cls, template_path: Optional[pathlib.Path] = None):
Expand All @@ -49,10 +49,10 @@ def create_parser(cls):
help="Create a new Taipy application using pre-defined templates.",
)
create_parser.add_argument(
"--template",
"--application",
choices=list(cls._template_map.keys()),
default="default",
help="The Taipy template to create new application.",
help="The template used to create the new Taipy application.",
)

@classmethod
Expand All @@ -61,7 +61,7 @@ def handle_command(cls):
if not args:
return
try:
cookiecutter(cls._template_map[args.template])
cookiecutter(cls._template_map[args.application])
except OutputDirExistsException as err:
error_msg = f"{str(err)}. Please remove the existing directory or provide a new folder name."
print(error_msg) # noqa: T201
Expand Down
8 changes: 4 additions & 4 deletions taipy/_entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
from taipy.core._version._cli._version_cli import _VersionCLI
from taipy.gui._gui_cli import _GuiCLI

from ._cli._create_cli import _CreateCLI
from ._cli._help_cli import _HelpCLI
from ._cli._run_cli import _RunCLI
from ._cli._scaffold_cli import _ScaffoldCLI
from .version import _get_version


Expand All @@ -46,8 +46,8 @@ def _entrypoint():
_CoreCLI.create_run_parser()

_VersionCLI.create_parser()
_ScaffoldCLI.generate_template_map()
_ScaffoldCLI.create_parser()
_CreateCLI.generate_template_map()
_CreateCLI.create_parser()
_MigrateCLI.create_parser()
_HelpCLI.create_parser()

Expand All @@ -65,7 +65,7 @@ def _entrypoint():
_HelpCLI.handle_command()
_VersionCLI.handle_command()
_MigrateCLI.handle_command()
_ScaffoldCLI.handle_command()
_CreateCLI.handle_command()

_TaipyParser._remove_argument("help")
_TaipyParser._parser.print_help()
4 changes: 2 additions & 2 deletions taipy/gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
add functionality to Taipy GUI:
- [`python-magic`](https://pypi.org/project/python-magic/): identifies image format
from byte buffers so the [`image`](../../../userman/gui/viselements/standard-and-blocks/image.md) control can
display them, and so that [`file_download`](../../../userman/gui/viselements/standard-and-blocks/file_download.md)
from byte buffers so the [`image`](../../../userman/gui/viselements/generic/image.md) control can
display them, and so that [`file_download`](../../../userman/gui/viselements/generic/file_download.md)
can request the browser to display the image content when relevant.<br/>
You can install that package with the regular `pip install python-magic` command
(then potentially `pip install python-magic` on Windows),
Expand Down
8 changes: 3 additions & 5 deletions taipy/gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,6 @@ def broadcast_callback(
variable reflected in the user interface.
Arguments:
gui (Gui^): The current Gui instance.
callback: The user-defined function to be invoked.<br/>
The first parameter of this function must be a `State^` object representing the
client for which it is invoked.<br/>
Expand All @@ -1577,7 +1576,6 @@ def broadcast_change(self, var_name: str, value: t.Any):
instance. All user interfaces reflect the change.
Arguments:
gui (Gui^): The current Gui instance.
var_name: The name of the variable to change.
value: The new value for the variable.
"""
Expand All @@ -1600,9 +1598,9 @@ def broadcast_changes(self, values: t.Optional[dict[str, t.Any]] = None, **kwarg
values: An optional dictionary where each key is the name of a variable to change, and
where the associated value is the new value to set for that variable, in each state
for the application.
**kwargs: A collection of variable name-value pairs that are updated for each state of
the application. Name-value pairs overload the ones in *values* if the name exists
as a key in the dictionary.
**kwargs (dict[str, any]): A collection of variable name-value pairs that are updated
for each state of the application. Name-value pairs overload the ones in *values*
if the name exists as a key in the dictionary.
"""
if kwargs:
values = values.copy() if values else {}
Expand Down
4 changes: 2 additions & 2 deletions taipy/gui/icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
class Icon:
"""Small image in the User Interface.
Icons are typically used in controls like [button](../../userman/gui/viselements/standard-and-blocks/button.md)
or items in a [menu](../../userman/gui/viselements/standard-and-blocks/menu.md).
Icons are typically used in controls like [button](../../userman/gui/viselements/generic/button.md)
or items in a [menu](../../userman/gui/viselements/generic/menu.md).
Attributes:
path (str): The path to the image file.
Expand Down
6 changes: 3 additions & 3 deletions taipy/gui/partial.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class Partial(_Page):
and not related pages. This allows not to have to repeat yourself when
creating your page templates.
Visual elements such as [`part`](../../userman/gui/viselements/standard-and-blocks/part.md),
[`dialog`](../..//userman/gui/viselements/standard-and-blocks/dialog.md) or
[`pane`](../../userman/gui/viselements/standard-and-blocks/pane.md) can use Partials.
Visual elements such as [`part`](../../userman/gui/viselements/generic/part.md),
[`dialog`](../..//userman/gui/viselements/generic/dialog.md) or
[`pane`](../../userman/gui/viselements/generic/pane.md) can use Partials.
Note that `Partial` has no constructor (no `__init__()` method): to create a
`Partial`, you must call the `Gui.add_partial()^` function.
Expand Down
4 changes: 2 additions & 2 deletions taipy/templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ and limitations under the License.
Taipy is a Python library for creating Business Applications. More information on our
[website](https://www.taipy.io).

Taipy templates is a repository that contains templates and scaffoldings created and
Taipy templates is a repository that contains application templates created and
maintained by Taipy. It helps users getting started with a simple and ready-to-go application.

A more in depth documentation of taipy can be found [here](https://docs.taipy.io).
Expand All @@ -38,7 +38,7 @@ taipy create
```
or
```bash
taipy create --template "default"
taipy create --application "default"
```

After providing necessary information, your new application is created in the current
Expand Down
4 changes: 2 additions & 2 deletions taipy/templates/package_desc.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Taipy is a Python library for creating Business Applications. More information o
[website](https://www.taipy.io). Taipy is split into multiple packages including *taipy-templates*
to let users install the minimum they need.

Taipy templates is a repository that contains templates created and
Taipy templates is a repository that contains application templates created and
maintained by Taipy. It helps users getting started with a simple and ready-to-go application.

To create a Taipy application using this template, first you need to install Taipy (> 2.2).
Expand All @@ -29,7 +29,7 @@ taipy create
```
or
```bash
taipy create --template "default"
taipy create --application "default"
```

After providing necessary information, your new application is created in the current
Expand Down
2 changes: 1 addition & 1 deletion tests/cli/test_help_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_help_non_existed_command(caplog):


def test_taipy_create_help(capsys):
expected_help = "create [-h] [--template"
expected_help = "create [-h] [--application"

with patch("sys.argv", ["prog", "help", "create"]):
with pytest.raises(SystemExit):
Expand Down
6 changes: 3 additions & 3 deletions tests/templates/test_template_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@


def test_create_cli_with_wrong_arguments(caplog):
with patch("sys.argv", ["prog", "create", "--teamplaet", "default"]):
with patch("sys.argv", ["prog", "create", "--applciation", "default"]):
with pytest.raises(SystemExit):
_entrypoint()
assert "Unknown arguments: --teamplaet. Did you mean: --template?" in caplog.text
assert "Unknown arguments: --applciation. Did you mean: --application?" in caplog.text


def test_create_cli_with_unsupported_template(capsys):
with patch("sys.argv", ["prog", "create", "--template", "not-a-template"]):
with patch("sys.argv", ["prog", "create", "--application", "not-a-template"]):
with pytest.raises(SystemExit):
_entrypoint()
_, err = capsys.readouterr()
Expand Down
2 changes: 1 addition & 1 deletion tools/gui/generate_pyi.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
current_version = "develop"
else:
current_version = f'release-{version.get("major", 0)}.{version.get("minor", 0)}'
taipy_doc_url = f"https://docs.taipy.io/en/{current_version}/manuals/userman/gui/viselements/standard-and-blocks/"
taipy_doc_url = f"https://docs.taipy.io/en/{current_version}/manuals/userman/gui/viselements/generic/"


# ############################################################
Expand Down

0 comments on commit 05bd38a

Please sign in to comment.