Skip to content

Commit 91b0369

Browse files
committed
refactor: rename subcomponents
1 parent 6330da1 commit 91b0369

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

chapter07_adapter_facade/home_theatre.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from facade.home_theatre_facade import HomeTheaterFacade
2-
from separates.separates import Amplifier, Tuner, StreamingPlayer, Projector, Screen, TheaterLights, PopcornPopper
2+
from subcomponents.separates import Amplifier, Tuner, StreamingPlayer, Projector, Screen, TheaterLights, PopcornPopper
33

44

55
def theatre_test_drive():

chapter07_adapter_facade/readme.md

+6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ high-level cross-platform interface to methods and attributes from the `os`, `sy
1818

1919
## Running the code
2020

21+
### Adapter
2122
```bash
2223
python duck.py
2324
```
25+
26+
### Facade
27+
```bash
28+
python home_theatre.py
29+
```

chapter07_adapter_facade/separates/separates.py renamed to chapter07_adapter_facade/subcomponents/separates.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,13 @@ def play(self, arg):
121121
if isinstance(arg, str):
122122
self.title = arg
123123
self.current_track = 0
124-
print(f'{self.description} playing "{self.movie}"')
124+
print(f'{self.description} playing "{self.title}"')
125125
elif isinstance(arg, int):
126126
if self.title is None:
127127
print(f"{self.description} can't play track {self.current_track}, no cd inserted")
128128
else:
129129
self.current_track = arg
130-
print(
131-
f'{self.description} playing track {self.current_track}'
132-
)
130+
print(f'{self.description} playing track {self.current_track}')
133131

134132
def eject(self):
135133
print(f'{self.description} eject')

0 commit comments

Comments
 (0)