[App] Add _path suffixes to PathLike constructor args

This commit is contained in:
Olivier Philippon
2022-05-04 12:18:04 +01:00
parent 3f09af3768
commit 73db7ae3ad
26 changed files with 46 additions and 51 deletions

View File

@@ -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)

View File

@@ -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__":

View File

@@ -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()

View File

@@ -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")

View File

@@ -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")

View File

@@ -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")

View File

@@ -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()