Skip to content

Commit 822f6c0

Browse files
committed
Final QA
1 parent a042c7e commit 822f6c0

13 files changed

+37
-44
lines changed

python-textual/events.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ class EventsApp(App):
1414
double_border = False
1515

1616
def compose(self):
17-
yield Button(
18-
"Click me!",
19-
id="button",
20-
)
17+
yield Button("Click me!", id="button")
2118
digits = Digits("0", id="digits")
2219
digits.border_subtitle = "Button presses"
2320
yield digits

python-textual/grid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from textual.widgets import Static
44

55

6-
class GridLayoutExample(App):
6+
class GridLayoutApp(App):
77
def compose(self):
88
grid = Grid()
99
grid.styles.grid_size_rows = rows = 6
@@ -19,5 +19,5 @@ def compose(self):
1919

2020

2121
if __name__ == "__main__":
22-
app = GridLayoutExample()
22+
app = GridLayoutApp()
2323
app.run()

python-textual/grid.tcss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ Grid {
55
Static {
66
height: 1fr;
77
width: 1fr;
8-
border: solid green;
8+
border: solid green;
99
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from textual.widgets import Static
44

55

6-
class GridLayoutWithTCSS(App):
6+
class GridLayoutAppWithTCSS(App):
77
CSS_PATH = "grid.tcss"
88

99
def compose(self):
@@ -14,5 +14,5 @@ def compose(self):
1414

1515

1616
if __name__ == "__main__":
17-
app = GridLayoutWithTCSS()
17+
app = GridLayoutAppWithTCSS()
1818
app.run()

python-textual/horizontal_layout.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
NUM_BOXES = 4
66

77

8-
class HorizontalLayoutExample(App):
8+
class HorizontalLayoutApp(App):
99
def compose(self):
1010
with Horizontal():
1111
for i in range(NUM_BOXES):
12-
static = Static(f"Static {i+1}")
12+
static = Static(f"Static {i + 1}")
1313
static.styles.border = ("solid", "green")
1414
static.styles.width = "10%"
1515
yield static
1616

1717

1818
if __name__ == "__main__":
19-
app = HorizontalLayoutExample()
19+
app = HorizontalLayoutApp()
2020
app.run()

python-textual/horizontal_scroll.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
NUM_BOXES = 20
66

77

8-
class HorizontalScrollExample(App):
8+
class HorizontalScrollApp(App):
99
def compose(self):
1010
with HorizontalScroll():
1111
for i in range(NUM_BOXES):
12-
static = Static(f"Static {i+1}")
12+
static = Static(f"Static {i + 1}")
1313
static.styles.border = ("solid", "green")
1414
static.styles.width = "10%"
1515
yield static
1616

1717

1818
if __name__ == "__main__":
19-
app = HorizontalScrollExample()
19+
app = HorizontalScrollApp()
2020
app.run()
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
from textual.app import App
2-
from textual.containers import (
3-
Horizontal,
4-
HorizontalScroll,
5-
VerticalScroll,
6-
)
2+
from textual.containers import Horizontal, HorizontalScroll, VerticalScroll
73
from textual.widgets import Label, Static
84

95
NUM_BOXES = 12
106

117

12-
class NestedContainersExample(App):
8+
class NestedContainersApp(App):
139
CSS_PATH = "layouts.tcss"
1410

1511
def compose(self):
@@ -18,13 +14,13 @@ def compose(self):
1814
with HorizontalScroll(id="horizontalscroll"):
1915
for i in range(NUM_BOXES):
2016
yield Static(
21-
f"Center.{i+1}",
17+
f"Center.{i + 1}",
2218
classes="box yellowbox",
2319
)
2420
with VerticalScroll(id="verticalscroll"):
2521
for i in range(NUM_BOXES):
2622
yield Static(
27-
f"Right.{i+1}",
23+
f"Right.{i + 1}",
2824
classes="box redbox",
2925
)
3026
yield Label(
@@ -34,5 +30,5 @@ def compose(self):
3430

3531

3632
if __name__ == "__main__":
37-
app = NestedContainersExample()
33+
app = NestedContainersApp()
3834
app.run()

python-textual/layouts.tcss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.box {
22
height: 1fr;
33
width: 1fr;
4-
background:$panel;
4+
background: $panel;
55
border: solid white;
66
}
77

python-textual/static_and_label.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ def on_mount(self):
1818
self.static.styles.background = "blue"
1919
self.static.styles.border = ("solid", "white")
2020
self.static.styles.text_align = "center"
21-
self.static.styles.padding = 1, 1
22-
self.static.styles.margin = 4, 4
21+
self.static.styles.padding = (1, 1)
22+
self.static.styles.margin = (4, 4)
2323
# Styling the label
2424
self.label.styles.background = "darkgreen"
2525
self.label.styles.border = ("double", "red")
26-
self.label.styles.padding = 1, 1
27-
self.label.styles.margin = 2, 4
26+
self.label.styles.padding = (1, 1)
27+
self.label.styles.margin = (2, 4)
2828

2929

3030
if __name__ == "__main__":
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
Static {
22
background: blue;
3-
border: solid white;
3+
border: solid white;
44
padding: 1 1;
55
margin: 2 2;
66
text-align: center;
77
}
88

99
#label_id {
1010
color: black;
11-
background: yellow;
12-
border: solid black;
11+
background: red;
12+
border: solid black;
1313
padding: 1 1;
1414
margin: 2 4;
1515
}
1616

1717
.label_class {
18-
color:black;
18+
color: black;
1919
background: green;
20-
border: dashed purple;
20+
border: dashed purple;
2121
padding: 1 1;
2222
margin: 2 6;
23-
}
23+
}

0 commit comments

Comments
 (0)