• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python status.status函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中mopidy.frontends.mpd.protocol.status.status函数的典型用法代码示例。如果您正苦于以下问题:Python status函数的具体用法?Python status怎么用?Python status使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了status函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_status_method_when_starting_playing_contains_elapsed_zero

 def test_status_method_when_starting_playing_contains_elapsed_zero(self):
     self.core.tracklist.add([Track(uri='dummy:a', length=10000)])
     self.core.playback.play()
     self.core.playback.pause()
     result = dict(status.status(self.context))
     self.assertIn('elapsed', result)
     self.assertEqual(result['elapsed'], '0.000')
开发者ID:Halfnhav,项目名称:mopidy,代码行数:7,代码来源:status_test.py


示例2: test_status_method_when_playing_contains_elapsed

 def test_status_method_when_playing_contains_elapsed(self):
     self.core.tracklist.add([Track(uri='dummy:a', length=60000)])
     self.core.playback.play()
     self.core.playback.pause()
     self.core.playback.seek(59123)
     result = dict(status.status(self.context))
     self.assertIn('elapsed', result)
     self.assertEqual(result['elapsed'], '59.123')
开发者ID:Halfnhav,项目名称:mopidy,代码行数:8,代码来源:status_test.py


示例3: test_status_method_when_playing_contains_time_with_length

 def test_status_method_when_playing_contains_time_with_length(self):
     self.backend.current_playlist.append([Track(length=10000)])
     self.backend.playback.play()
     result = dict(status.status(self.context))
     self.assert_("time" in result)
     (position, total) = result["time"].split(":")
     position = int(position)
     total = int(total)
     self.assert_(position <= total)
开发者ID:Amli,项目名称:mopidy,代码行数:9,代码来源:status_test.py


示例4: test_status_method_when_playing_contains_time_with_no_length

 def test_status_method_when_playing_contains_time_with_no_length(self):
     self.backend.current_playlist.append([Track(length=None)])
     self.backend.playback.play()
     result = dict(status.status(self.context))
     self.assertIn('time', result)
     (position, total) = result['time'].split(':')
     position = int(position)
     total = int(total)
     self.assert_(position <= total)
开发者ID:Dvad,项目名称:mopidy,代码行数:9,代码来源:status_test.py


示例5: test_status_method_when_playing_contains_time_with_length

 def test_status_method_when_playing_contains_time_with_length(self):
     self.core.tracklist.add([Track(uri='dummy:a', length=10000)])
     self.core.playback.play()
     result = dict(status.status(self.context))
     self.assertIn('time', result)
     (position, total) = result['time'].split(':')
     position = int(position)
     total = int(total)
     self.assertLessEqual(position, total)
开发者ID:Halfnhav,项目名称:mopidy,代码行数:9,代码来源:status_test.py


示例6: test_status_method_contains_volume

 def test_status_method_contains_volume(self):
     self.mixer.volume = 17
     result = dict(status.status(self.context))
     self.assert_("volume" in result)
     self.assertEqual(int(result["volume"]), 17)
开发者ID:Amli,项目名称:mopidy,代码行数:5,代码来源:status_test.py


示例7: test_status_method_when_playing_contains_bitrate

 def test_status_method_when_playing_contains_bitrate(self):
     self.backend.current_playlist.append([Track(bitrate=320)])
     self.backend.playback.play()
     result = dict(status.status(self.context))
     self.assert_("bitrate" in result)
     self.assertEqual(int(result["bitrate"]), 320)
开发者ID:Amli,项目名称:mopidy,代码行数:6,代码来源:status_test.py


示例8: test_status_method_contains_state_is_pause

 def test_status_method_contains_state_is_pause(self):
     self.backend.playback.state = PLAYING
     self.backend.playback.state = PAUSED
     result = dict(status.status(self.context))
     self.assert_("state" in result)
     self.assertEqual(result["state"], "pause")
开发者ID:Amli,项目名称:mopidy,代码行数:6,代码来源:status_test.py


示例9: test_status_method_contains_xfade

 def test_status_method_contains_xfade(self):
     result = dict(status.status(self.context))
     self.assert_("xfade" in result)
     self.assert_(int(result["xfade"]) >= 0)
开发者ID:Amli,项目名称:mopidy,代码行数:4,代码来源:status_test.py


示例10: test_status_method_contains_playlist

 def test_status_method_contains_playlist(self):
     result = dict(status.status(self.context))
     self.assert_("playlist" in result)
     self.assert_(int(result["playlist"]) in xrange(0, 2 ** 31 - 1))
开发者ID:Amli,项目名称:mopidy,代码行数:4,代码来源:status_test.py


示例11: test_status_method_contains_repeat_is_1

 def test_status_method_contains_repeat_is_1(self):
     self.backend.playback.repeat = 1
     result = dict(status.status(self.context))
     self.assertIn('repeat', result)
     self.assertEqual(int(result['repeat']), 1)
开发者ID:Dvad,项目名称:mopidy,代码行数:5,代码来源:status_test.py


示例12: test_status_method_contains_volume

 def test_status_method_contains_volume(self):
     self.backend.playback.volume = 17
     result = dict(status.status(self.context))
     self.assertIn('volume', result)
     self.assertEqual(int(result['volume']), 17)
开发者ID:Dvad,项目名称:mopidy,代码行数:5,代码来源:status_test.py


示例13: test_status_method_contains_volume_with_na_value

 def test_status_method_contains_volume_with_na_value(self):
     result = dict(status.status(self.context))
     self.assertIn('volume', result)
     self.assertEqual(int(result['volume']), -1)
开发者ID:Dvad,项目名称:mopidy,代码行数:4,代码来源:status_test.py


示例14: test_status_method_when_starting_playing_contains_elapsed_zero

 def test_status_method_when_starting_playing_contains_elapsed_zero(self):
     self.backend.playback.state = PAUSED
     self.backend.playback.play_time_accumulated = 123 # Less than 1000ms
     result = dict(status.status(self.context))
     self.assertIn('elapsed', result)
     self.assertEqual(result['elapsed'], '0.123')
开发者ID:Dvad,项目名称:mopidy,代码行数:6,代码来源:status_test.py


示例15: test_status_method_when_playing_contains_elapsed

 def test_status_method_when_playing_contains_elapsed(self):
     self.backend.playback.state = PAUSED
     self.backend.playback.play_time_accumulated = 59123
     result = dict(status.status(self.context))
     self.assertIn('elapsed', result)
     self.assertEqual(result['elapsed'], '59.123')
开发者ID:Dvad,项目名称:mopidy,代码行数:6,代码来源:status_test.py


示例16: test_status_method_contains_consume_is_0

 def test_status_method_contains_consume_is_0(self):
     result = dict(status.status(self.context))
     self.assert_("consume" in result)
     self.assertEqual(int(result["consume"]), 0)
开发者ID:Amli,项目名称:mopidy,代码行数:4,代码来源:status_test.py


示例17: test_status_method_contains_consume_is_1

 def test_status_method_contains_consume_is_1(self):
     self.backend.playback.consume = 1
     result = dict(status.status(self.context))
     self.assert_("consume" in result)
     self.assertEqual(int(result["consume"]), 1)
开发者ID:Amli,项目名称:mopidy,代码行数:5,代码来源:status_test.py


示例18: test_status_method_contains_random_is_0

 def test_status_method_contains_random_is_0(self):
     result = dict(status.status(self.context))
     self.assertIn('random', result)
     self.assertEqual(int(result['random']), 0)
开发者ID:Dvad,项目名称:mopidy,代码行数:4,代码来源:status_test.py


示例19: test_status_method_contains_playlistlength

 def test_status_method_contains_playlistlength(self):
     result = dict(status.status(self.context))
     self.assert_("playlistlength" in result)
     self.assert_(int(result["playlistlength"]) >= 0)
开发者ID:Amli,项目名称:mopidy,代码行数:4,代码来源:status_test.py


示例20: test_status_method_contains_single

 def test_status_method_contains_single(self):
     result = dict(status.status(self.context))
     self.assertIn('single', result)
     self.assertIn(int(result['single']), (0, 1))
开发者ID:Dvad,项目名称:mopidy,代码行数:4,代码来源:status_test.py



注:本文中的mopidy.frontends.mpd.protocol.status.status函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python translator.track_to_mpd_format函数代码示例发布时间:2022-05-27
下一篇:
Python config.read函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap