mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
[App] Add _path suffixes to PathLike constructor args
This commit is contained in:
@@ -22,4 +22,4 @@ class AlignApp(App):
|
||||
self.log(self.screen.tree)
|
||||
|
||||
|
||||
AlignApp.run(css_file="align.css", log="textual.log", watch_css=True)
|
||||
AlignApp.run(css_path="align.css", log_path="textual.log", watch_css=True)
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
from pathlib import Path
|
||||
|
||||
from rich.align import Align
|
||||
from rich.console import RenderableType
|
||||
from rich.syntax import Syntax
|
||||
from rich.text import Text
|
||||
@@ -141,11 +138,10 @@ class BasicApp(App):
|
||||
self.panic(self.tree)
|
||||
|
||||
|
||||
sandbox_folder = Path(__file__).parent
|
||||
app = BasicApp(
|
||||
css_file=sandbox_folder / "basic.css",
|
||||
css_path="basic.css",
|
||||
watch_css=True,
|
||||
log=sandbox_folder / "textual.log",
|
||||
log_path="textual.log",
|
||||
)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -5,7 +5,6 @@ from textual import layout
|
||||
|
||||
|
||||
class ButtonsApp(App[str]):
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield layout.Vertical(
|
||||
Button("foo", id="foo"),
|
||||
@@ -19,7 +18,7 @@ class ButtonsApp(App[str]):
|
||||
self.exit(event.button.id)
|
||||
|
||||
|
||||
app = ButtonsApp(log="textual.log", log_verbosity=2)
|
||||
app = ButtonsApp(log_path="textual.log", log_verbosity=2)
|
||||
|
||||
if __name__ == "__main__":
|
||||
result = app.run()
|
||||
|
||||
@@ -34,4 +34,4 @@ class BasicApp(App):
|
||||
self.panic(self.tree)
|
||||
|
||||
|
||||
BasicApp.run(css_file="dev_sandbox.scss", watch_css=True, log="textual.log")
|
||||
BasicApp.run(css_path="dev_sandbox.scss", watch_css=True, log_path="textual.log")
|
||||
|
||||
@@ -33,4 +33,4 @@ class BasicApp(App):
|
||||
self.log(header.styles)
|
||||
|
||||
|
||||
BasicApp.run(css_file="local_styles.css", log="textual.log")
|
||||
BasicApp.run(css_path="local_styles.css", log_path="textual.log")
|
||||
|
||||
@@ -144,4 +144,4 @@ class BasicApp(App):
|
||||
self.mount(example.widget)
|
||||
|
||||
|
||||
BasicApp.run(css_file="tabs.scss", watch_css=True, log="textual.log")
|
||||
BasicApp.run(css_path="tabs.scss", watch_css=True, log_path="textual.log")
|
||||
|
||||
@@ -83,7 +83,7 @@ class BasicApp(App):
|
||||
self.focused.styles.border_top = ("solid", "invalid-color")
|
||||
|
||||
|
||||
app = BasicApp(css_file="uber.css", log="textual.log", log_verbosity=1)
|
||||
app = BasicApp(css_path="uber.css", log_path="textual.log", log_verbosity=1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run()
|
||||
|
||||
Reference in New Issue
Block a user