Merge lp:~samuel-buffet/entertainer/pokes into lp:entertainer
- pokes
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Matt Layman |
Approved revision: | 396 |
Merged at revision: | not available |
Proposed branch: | lp:~samuel-buffet/entertainer/pokes |
Merge into: | lp:entertainer |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~samuel-buffet/entertainer/pokes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matt Layman | Approve | ||
Review via email:
|
Commit message
Change in variable names on the VolumeIndicator Class.
Description of the change
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Samuel Buffet (samuel-buffet) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Matt Layman (mblayman) wrote : | # |
Samuel,
Thanks for making this change. The variable name makes more sense now. I wanted to take the chance to also add my comments from the volume indicator that I didn't chime in on because I was too slow to review. So keep in mind that the following comments aren't directly related to this branch, they are just piggyback comments.
test_mediaplaye
* The test method convention that I've been using is typically test_<method name> if I'm testing a method or something more creative if I'm testing something more specific about a method. Therefore, I'd suggest renaming a test method like test_getmediatitle to test_get_
* MediaPlayerTest class docstring is wrong.
That's all I wanted to add. I hope you'll update the second point. I'll leave it up to you if you want to update stuff based on the first point.
- 396. By Samuel Buffet
-
Fixes after Matt's comments.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Samuel Buffet (samuel-buffet) wrote : | # |
Matt,
I've done all the suggested changes.
Samuel-
PS :
> ... You can even see
> examples where I follow the same convention for "private" methods (e.g.,
> test__generate_
Hmm, I don't really see why we need to test a "private" method. A private method is supposed to be for internal logic. For me it only make sense to test "public" properties, variables or methods.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Paul Hummer (rockstar) wrote : | # |
`which trial` entertainerlib.
entertainerlib.
ArrowTextureTest
test_bounce ... /home/rockstar/
/home/rockstar/
/home/rockstar/
/home/rockstar/
test_create ... [ERROR]
entertainerlib.
BaseTest
testCreate ... [OK]
testGetAbsX ... [ERROR]
testGetAbsY ... [ERROR]
entertainerlib.
ConfigurationTest
testBorg ... [OK]
testCreate ... [OK]
testGetCfgDir ... [OK]
testGetSlid
testGetStag
testGetStag
testGetThem
testSetStag
testSetStag
testStartAu
testTrayIco
test_create_dir ... [OK]
test_
test_sanitize ... [ERROR]
test_taint ... [OK]
test_
test_
test_
entertainerlib.
ConnectionSer
testPortBinding ... [OK]
entertainerlib.
DatabaseTest
testCreate ... [OK]
testUseExisting ... [OK]
entertainerlib.
EyeCandyTextu
test_create ... [ERROR]
entertainerlib.
FeedConfigTo...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Paul Hummer (rockstar) wrote : | # |
`which trial` entertainerlib.
entertainerlib.
ArrowTextureTest
test_bounce ... /home/rockstar/
/home/rockstar/
/home/rockstar/
/home/rockstar/
test_create ... [ERROR]
entertainerlib.
BaseTest
testCreate ... [OK]
testGetAbsX ... [ERROR]
testGetAbsY ... [ERROR]
entertainerlib.
ConfigurationTest
testBorg ... [OK]
testCreate ... [OK]
testGetCfgDir ... [OK]
testGetSlid
testGetStag
testGetStag
testGetThem
testSetStag
testSetStag
testStartAu
testTrayIco
test_create_dir ... [OK]
test_
test_sanitize ... [ERROR]
test_taint ... [OK]
test_
test_
test_
entertainerlib.
ConnectionSer
testPortBinding ... [OK]
entertainerlib.
DatabaseTest
testCreate ... [OK]
testUseExisting ... [OK]
entertainerlib.
EyeCandyTextu
test_create ... [ERROR]
entertainerlib.
FeedConfigTo...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Paul Hummer (rockstar) wrote : | # |
`which trial` entertainerlib.
entertainerlib.
ArrowTextureTest
test_bounce ... /home/rockstar/
/home/rockstar/
/home/rockstar/
/home/rockstar/
test_create ... [ERROR]
entertainerlib.
BaseTest
testCreate ... [OK]
testGetAbsX ... [ERROR]
testGetAbsY ... [ERROR]
entertainerlib.
ConfigurationTest
testBorg ... [OK]
testCreate ... [OK]
testGetCfgDir ... [OK]
testGetSlid
testGetStag
testGetStag
testGetThem
testSetStag
testSetStag
testStartAu
testTrayIco
test_create_dir ... [OK]
test_
test_sanitize ... [ERROR]
test_taint ... [OK]
test_
test_
test_
entertainerlib.
ConnectionSer
testPortBinding ... [OK]
entertainerlib.
DatabaseTest
testCreate ... [OK]
testUseExisting ... [OK]
entertainerlib.
EyeCandyTextu
test_create ... [ERROR]
entertainerlib.
FeedConfigTo...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Paul Hummer (rockstar) wrote : | # |
`which trial` entertainerlib.
entertainerlib.
ArrowTextureTest
test_bounce ... /home/rockstar/
/home/rockstar/
/home/rockstar/
/home/rockstar/
test_create ... [ERROR]
entertainerlib.
BaseTest
testCreate ... [OK]
testGetAbsX ... [ERROR]
testGetAbsY ... [ERROR]
entertainerlib.
ConfigurationTest
testBorg ... [OK]
testCreate ... [OK]
testGetCfgDir ... [OK]
testGetSlid
testGetStag
testGetStag
testGetThem
testSetStag
testSetStag
testStartAu
testTrayIco
test_create_dir ... [OK]
test_
test_sanitize ... [ERROR]
test_taint ... [OK]
test_
test_
test_
entertainerlib.
ConnectionSer
testPortBinding ... [OK]
entertainerlib.
DatabaseTest
testCreate ... [OK]
testUseExisting ... [OK]
entertainerlib.
EyeCandyTextu
test_create ... [ERROR]
entertainerlib.
FeedConfigTo...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Paul Hummer (rockstar) wrote : | # |
`which trial` entertainerlib.
entertainerlib.
ArrowTextureTest
test_bounce ... /home/rockstar/
/home/rockstar/
/home/rockstar/
/home/rockstar/
test_create ... [ERROR]
entertainerlib.
BaseTest
testCreate ... [OK]
testGetAbsX ... [ERROR]
testGetAbsY ... [ERROR]
entertainerlib.
ConfigurationTest
testBorg ... [OK]
testCreate ... [OK]
testGetCfgDir ... [OK]
testGetSlid
testGetStag
testGetStag
testGetThem
testSetStag
testSetStag
testStartAu
testTrayIco
test_create_dir ... [OK]
test_
test_sanitize ... [ERROR]
test_taint ... [OK]
test_
test_
test_
entertainerlib.
ConnectionSer
testPortBinding ... [OK]
entertainerlib.
DatabaseTest
testCreate ... [OK]
testUseExisting ... [OK]
entertainerlib.
EyeCandyTextu
test_create ... [ERROR]
entertainerlib.
FeedConfigTo...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Paul Hummer (rockstar) wrote : | # |
`which trial` entertainerlib.
entertainerlib.
ArrowTextureTest
test_bounce ... /home/rockstar/
/home/rockstar/
/home/rockstar/
/home/rockstar/
test_create ... [ERROR]
entertainerlib.
BaseTest
testCreate ... [OK]
testGetAbsX ... [ERROR]
testGetAbsY ... [ERROR]
entertainerlib.
ConfigurationTest
testBorg ... [OK]
testCreate ... [OK]
testGetCfgDir ... [OK]
testGetSlid
testGetStag
testGetStag
testGetThem
testSetStag
testSetStag
testStartAu
testTrayIco
test_create_dir ... [OK]
test_
test_sanitize ... [ERROR]
test_taint ... [OK]
test_
test_
test_
entertainerlib.
ConnectionSer
testPortBinding ... [OK]
entertainerlib.
DatabaseTest
testCreate ... [OK]
testUseExisting ... [OK]
entertainerlib.
EyeCandyTextu
test_create ... [ERROR]
entertainerlib.
FeedConfigTo...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Paul Hummer (rockstar) wrote : | # |
`which trial` entertainerlib.
entertainerlib.
ArrowTextureTest
test_bounce ... /home/rockstar/
/home/rockstar/
/home/rockstar/
/home/rockstar/
test_create ... [ERROR]
entertainerlib.
BaseTest
testCreate ... [OK]
testGetAbsX ... [ERROR]
testGetAbsY ... [ERROR]
entertainerlib.
ConfigurationTest
testBorg ... [OK]
testCreate ... [OK]
testGetCfgDir ... [OK]
testGetSlid
testGetStag
testGetStag
testGetThem
testSetStag
testSetStag
testStartAu
testTrayIco
test_create_dir ... [OK]
test_
test_sanitize ... [ERROR]
test_taint ... [OK]
test_
test_
test_
entertainerlib.
ConnectionSer
testPortBinding ... [OK]
entertainerlib.
DatabaseTest
testCreate ... [OK]
testUseExisting ... [OK]
entertainerlib.
EyeCandyTextu
test_create ... [ERROR]
entertainerlib.
FeedConfigTo...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Paul Hummer (rockstar) wrote : | # |
`which trial` entertainerlib.
entertainerlib.
ArrowTextureTest
test_bounce ... /home/rockstar/
/home/rockstar/
/home/rockstar/
/home/rockstar/
test_create ... [ERROR]
entertainerlib.
BaseTest
testCreate ... [OK]
testGetAbsX ... [ERROR]
testGetAbsY ... [ERROR]
entertainerlib.
ConfigurationTest
testBorg ... [OK]
testCreate ... [OK]
testGetCfgDir ... [OK]
testGetSlid
testGetStag
testGetStag
testGetThem
testSetStag
testSetStag
testStartAu
testTrayIco
test_create_dir ... [OK]
test_
test_sanitize ... [ERROR]
test_taint ... [OK]
test_
test_
test_
entertainerlib.
ConnectionSer
testPortBinding ... [OK]
entertainerlib.
DatabaseTest
testCreate ... [OK]
testUseExisting ... [OK]
entertainerlib.
EyeCandyTextu
test_create ... [ERROR]
entertainerlib.
FeedConfigTo...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Paul Hummer (rockstar) wrote : | # |
`which trial` entertainerlib.
entertainerlib.
ArrowTextureTest
test_bounce ... /home/rockstar/
/home/rockstar/
/home/rockstar/
/home/rockstar/
test_create ... [ERROR]
entertainerlib.
BaseTest
testCreate ... [OK]
testGetAbsX ... [ERROR]
testGetAbsY ... [ERROR]
entertainerlib.
ConfigurationTest
testBorg ... [OK]
testCreate ... [OK]
testGetCfgDir ... [OK]
testGetSlid
testGetStag
testGetStag
testGetThem
testSetStag
testSetStag
testStartAu
testTrayIco
test_create_dir ... [OK]
test_
test_sanitize ... [ERROR]
test_taint ... [OK]
test_
test_
test_
entertainerlib.
ConnectionSer
testPortBinding ... [OK]
entertainerlib.
DatabaseTest
testCreate ... [OK]
testUseExisting ... [OK]
entertainerlib.
EyeCandyTextu
test_create ... [ERROR]
entertainerlib.
FeedConfigTo...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Paul Hummer (rockstar) wrote : | # |
`which trial` entertainerlib.
entertainerlib.
ArrowTextureTest
test_bounce ... /home/rockstar/
/home/rockstar/
/home/rockstar/
/home/rockstar/
test_create ... [ERROR]
entertainerlib.
BaseTest
testCreate ... [OK]
testGetAbsX ... [ERROR]
testGetAbsY ... [ERROR]
entertainerlib.
ConfigurationTest
testBorg ... [OK]
testCreate ... [OK]
testGetCfgDir ... [OK]
testGetSlid
testGetStag
testGetStag
testGetThem
testSetStag
testSetStag
testStartAu
testTrayIco
test_create_dir ... [OK]
test_
test_sanitize ... [ERROR]
test_taint ... [OK]
test_
test_
test_
entertainerlib.
ConnectionSer
testPortBinding ... [OK]
entertainerlib.
DatabaseTest
testCreate ... [OK]
testUseExisting ... [OK]
entertainerlib.
EyeCandyTextu
test_create ... [ERROR]
entertainerlib.
FeedConfigTo...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Paul Hummer (rockstar) wrote : | # |
`which trial` entertainerlib.
entertainerlib.
ArrowTextureTest
test_bounce ... /home/rockstar/
/home/rockstar/
/home/rockstar/
/home/rockstar/
test_create ... [ERROR]
entertainerlib.
BaseTest
testCreate ... [OK]
testGetAbsX ... [ERROR]
testGetAbsY ... [ERROR]
entertainerlib.
ConfigurationTest
testBorg ... [OK]
testCreate ... [OK]
testGetCfgDir ... [OK]
testGetSlid
testGetStag
testGetStag
testGetThem
testSetStag
testSetStag
testStartAu
testTrayIco
test_create_dir ... [OK]
test_
test_sanitize ... [ERROR]
test_taint ... [OK]
test_
test_
test_
entertainerlib.
ConnectionSer
testPortBinding ... [OK]
entertainerlib.
DatabaseTest
testCreate ... [OK]
testUseExisting ... [OK]
entertainerlib.
EyeCandyTextu
test_create ... [ERROR]
entertainerlib.
FeedConfigTo...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Paul Hummer (rockstar) wrote : | # |
`which trial` entertainerlib.
entertainerlib.
ArrowTextureTest
test_bounce ... /home/rockstar/
/home/rockstar/
/home/rockstar/
/home/rockstar/
test_create ... [ERROR]
entertainerlib.
BaseTest
testCreate ... [OK]
testGetAbsX ... [ERROR]
testGetAbsY ... [ERROR]
entertainerlib.
ConfigurationTest
testBorg ... [OK]
testCreate ... [OK]
testGetCfgDir ... [OK]
testGetSlid
testGetStag
testGetStag
testGetThem
testSetStag
testSetStag
testStartAu
testTrayIco
test_create_dir ... [OK]
test_
test_sanitize ... [ERROR]
test_taint ... [OK]
test_
test_
test_
entertainerlib.
ConnectionSer
testPortBinding ... [OK]
entertainerlib.
DatabaseTest
testCreate ... [OK]
testUseExisting ... [OK]
entertainerlib.
EyeCandyTextu
test_create ... [ERROR]
entertainerlib.
FeedConfigTo...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Paul Hummer (rockstar) wrote : | # |
`which trial` entertainerlib.
entertainerlib.
ArrowTextureTest
test_bounce ... /home/rockstar/
/home/rockstar/
/home/rockstar/
/home/rockstar/
test_create ... [ERROR]
entertainerlib.
BaseTest
testCreate ... [OK]
testGetAbsX ... [ERROR]
testGetAbsY ... [ERROR]
entertainerlib.
ConfigurationTest
testBorg ... [OK]
testCreate ... [OK]
testGetCfgDir ... [OK]
testGetSlid
testGetStag
testGetStag
testGetThem
testSetStag
testSetStag
testStartAu
testTrayIco
test_create_dir ... [OK]
test_
test_sanitize ... [ERROR]
test_taint ... [OK]
test_
test_
test_
entertainerlib.
ConnectionSer
testPortBinding ... [OK]
entertainerlib.
DatabaseTest
testCreate ... [OK]
testUseExisting ... [OK]
entertainerlib.
EyeCandyTextu
test_create ... [ERROR]
entertainerlib.
FeedConfigTo...
Preview Diff
1 | === modified file 'entertainerlib/frontend/gui/widgets/volume_indicator.py' |
2 | --- entertainerlib/frontend/gui/widgets/volume_indicator.py 2009-06-29 19:41:35 +0000 |
3 | +++ entertainerlib/frontend/gui/widgets/volume_indicator.py 2009-07-11 16:14:49 +0000 |
4 | @@ -22,18 +22,18 @@ |
5 | volume = clutter.Texture(theme.getImage("volume")) |
6 | self.add(volume) |
7 | |
8 | - self._pokes = [] |
9 | + self._bars = [] |
10 | |
11 | - poke_width = filled.get_width() |
12 | + bar_width = filled.get_width() |
13 | |
14 | for i in range(20): |
15 | - poke_filled = clutter.CloneTexture(filled) |
16 | - poke_unfilled = clutter.CloneTexture(unfilled) |
17 | - poke_filled.set_position(volume.get_width() + i * poke_width, 0) |
18 | - poke_unfilled.set_position(volume.get_width() + i * poke_width, 0) |
19 | - self.add(poke_filled) |
20 | - self.add(poke_unfilled) |
21 | - self._pokes.append([poke_filled, poke_unfilled]) |
22 | + bar_filled = clutter.CloneTexture(filled) |
23 | + bar_unfilled = clutter.CloneTexture(unfilled) |
24 | + bar_filled.set_position(volume.get_width() + i * bar_width, 0) |
25 | + bar_unfilled.set_position(volume.get_width() + i * bar_width, 0) |
26 | + self.add(bar_filled) |
27 | + self.add(bar_unfilled) |
28 | + self._bars.append([bar_filled, bar_unfilled]) |
29 | |
30 | self._hide_timeout_key = None |
31 | self.visible = False |
32 | @@ -47,7 +47,7 @@ |
33 | self.set_position(self.get_abs_x(0.35), self.get_abs_y(0.1)) |
34 | |
35 | def show_volume(self, volume): |
36 | - """Displays volume level using filled and unfilled pokes.""" |
37 | + """Displays volume level using filled and unfilled bars.""" |
38 | self.raise_top() |
39 | |
40 | if self._hide_timeout_key is not None: |
41 | @@ -55,13 +55,13 @@ |
42 | self._hide_timeout_key = gobject.timeout_add(2000, |
43 | self.animate_out) |
44 | |
45 | - for index, pokes in enumerate(self._pokes): |
46 | + for index, bars in enumerate(self._bars): |
47 | if index >= volume: |
48 | - pokes[0].set_opacity(0) |
49 | - pokes[1].set_opacity(255) |
50 | + bars[0].set_opacity(0) |
51 | + bars[1].set_opacity(255) |
52 | else: |
53 | - pokes[0].set_opacity(255) |
54 | - pokes[1].set_opacity(0) |
55 | + bars[0].set_opacity(255) |
56 | + bars[1].set_opacity(0) |
57 | |
58 | if self.visible == True: |
59 | return |
60 | |
61 | === modified file 'entertainerlib/tests/test_volumeindicator.py' |
62 | --- entertainerlib/tests/test_volumeindicator.py 2009-06-28 12:19:08 +0000 |
63 | +++ entertainerlib/tests/test_volumeindicator.py 2009-07-11 16:14:49 +0000 |
64 | @@ -1,6 +1,8 @@ |
65 | # Copyright (c) 2009 Entertainer Developers - See COPYING - GPLv2 |
66 | """Tests VolumeIndicator""" |
67 | |
68 | +import clutter |
69 | + |
70 | from entertainerlib.frontend.gui.widgets.volume_indicator import VolumeIndicator |
71 | from entertainerlib.tests import EntertainerTest |
72 | |
73 | @@ -12,6 +14,7 @@ |
74 | EntertainerTest.setUp(self) |
75 | |
76 | self.indicator = VolumeIndicator() |
77 | + clutter.Stage().add(self.indicator) |
78 | |
79 | def test_create(self): |
80 | '''Test correct VolumeIndicator initialization.''' |
Matt,
I've renamed "poke" in "bar" in the VolumeIndicator Class.
The change on the test is done to avoid a warning when calling "show_volume" because of "self.raise_top()".
Samuel-