/usr/share/doc/screenlets/API/screenlets.plugins.mpdclient2-pysrc.html is in screenlets-doc 0.1.6-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 | <?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>screenlets.plugins.mpdclient2</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th> <a
href="screenlets-module.html">Home</a> </th>
<!-- Tree link -->
<th> <a
href="module-tree.html">Trees</a> </th>
<!-- Index link -->
<th> <a
href="identifier-index.html">Indices</a> </th>
<!-- Help link -->
<th> <a
href="help.html">Help</a> </th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
>Screenlets 0.1.6</th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
<a href="screenlets-module.html">Package screenlets</a> ::
<a href="screenlets.plugins-module.html">Package plugins</a> ::
Module mpdclient2
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
onclick="toggle_private();">hide private</a>]</span></td></tr>
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>] | <a href="screenlets.plugins.mpdclient2-pysrc.html"
target="_top">no frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<h1 class="epydoc">Source Code for <a href="screenlets.plugins.mpdclient2-module.html">Module screenlets.plugins.mpdclient2</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt> <tt class="py-line"><tt class="py-comment"># py-libmpdclient2 is written by Nick Welch <mack@incise.org>, 2005.</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L3"></a><tt class="py-lineno"> 3</tt> <tt class="py-line"><tt class="py-comment"># This software is in the public domain</tt> </tt>
<a name="L4"></a><tt class="py-lineno"> 4</tt> <tt class="py-line"><tt class="py-comment"># and is provided AS IS, with NO WARRANTY.</tt> </tt>
<a name="L5"></a><tt class="py-lineno"> 5</tt> <tt class="py-line"> </tt>
<a name="L6"></a><tt class="py-lineno"> 6</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">socket</tt> </tt>
<a name="L7"></a><tt class="py-lineno"> 7</tt> <tt class="py-line"> </tt>
<a name="L8"></a><tt class="py-lineno"> 8</tt> <tt class="py-line"><tt class="py-comment"># a line is either:</tt> </tt>
<a name="L9"></a><tt class="py-lineno"> 9</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt> <tt class="py-line"><tt class="py-comment"># key:val pair</tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt> <tt class="py-line"><tt class="py-comment"># OK</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt> <tt class="py-line"><tt class="py-comment"># ACK</tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt> <tt class="py-line"> </tt>
<a name="socket_talker"></a><div id="socket_talker-def"><a name="L14"></a><tt class="py-lineno"> 14</tt> <a class="py-toggle" href="#" id="socket_talker-toggle" onclick="return toggle('socket_talker');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.socket_talker-class.html">socket_talker</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="socket_talker-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="socket_talker-expanded"><a name="L15"></a><tt class="py-lineno"> 15</tt> <tt class="py-line"> </tt>
<a name="socket_talker.__init__"></a><div id="socket_talker.__init__-def"><a name="L16"></a><tt class="py-lineno"> 16</tt> <a class="py-toggle" href="#" id="socket_talker.__init__-toggle" onclick="return toggle('socket_talker.__init__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.socket_talker-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">host</tt><tt class="py-op">,</tt> <tt class="py-param">port</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="socket_talker.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="socket_talker.__init__-expanded"><a name="L17"></a><tt class="py-lineno"> 17</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-0" class="py-name" targets="Variable screenlets.plugins.Sonata.SonataAPI.host=screenlets.plugins.Sonata.SonataAPI-class.html#host"><a title="screenlets.plugins.Sonata.SonataAPI.host" class="py-name" href="#" onclick="return doclink('link-0', 'host', 'link-0');">host</a></tt> <tt class="py-op">=</tt> <tt id="link-1" class="py-name"><a title="screenlets.plugins.Sonata.SonataAPI.host" class="py-name" href="#" onclick="return doclink('link-1', 'host', 'link-0');">host</a></tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-2" class="py-name" targets="Variable screenlets.plugins.Sonata.SonataAPI.port=screenlets.plugins.Sonata.SonataAPI-class.html#port"><a title="screenlets.plugins.Sonata.SonataAPI.port" class="py-name" href="#" onclick="return doclink('link-2', 'port', 'link-2');">port</a></tt> <tt class="py-op">=</tt> <tt id="link-3" class="py-name"><a title="screenlets.plugins.Sonata.SonataAPI.port" class="py-name" href="#" onclick="return doclink('link-3', 'port', 'link-2');">port</a></tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">sock</tt> <tt class="py-op">=</tt> <tt class="py-name">socket</tt><tt class="py-op">.</tt><tt class="py-name">socket</tt><tt class="py-op">(</tt><tt class="py-name">socket</tt><tt class="py-op">.</tt><tt class="py-name">AF_INET</tt><tt class="py-op">,</tt> <tt class="py-name">socket</tt><tt class="py-op">.</tt><tt class="py-name">SOCK_STREAM</tt><tt class="py-op">)</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">sock</tt><tt class="py-op">.</tt><tt id="link-4" class="py-name" targets="Method screenlets.plugins.Amarok.AmarokAPI.connect()=screenlets.plugins.Amarok.AmarokAPI-class.html#connect,Method screenlets.plugins.Audacious.AudaciousAPI.connect()=screenlets.plugins.Audacious.AudaciousAPI-class.html#connect,Method screenlets.plugins.Banshee.BansheeAPI.connect()=screenlets.plugins.Banshee.BansheeAPI-class.html#connect,Method screenlets.plugins.Exaile.ExaileAPI.connect()=screenlets.plugins.Exaile.ExaileAPI-class.html#connect,Method screenlets.plugins.GenericPlayer.GenericAPI.connect()=screenlets.plugins.GenericPlayer.GenericAPI-class.html#connect,Method screenlets.plugins.Juk.JukAPI.connect()=screenlets.plugins.Juk.JukAPI-class.html#connect,Method screenlets.plugins.Kaffeine.KaffeineAPI.connect()=screenlets.plugins.Kaffeine.KaffeineAPI-class.html#connect,Method screenlets.plugins.LastFMProxy.LastFMProxyAPI.connect()=screenlets.plugins.LastFMProxy.LastFMProxyAPI-class.html#connect,Method screenlets.plugins.Listen.ListenAPI.connect()=screenlets.plugins.Listen.ListenAPI-class.html#connect,Method screenlets.plugins.Quodlibet.QuodlibetAPI.connect()=screenlets.plugins.Quodlibet.QuodlibetAPI-class.html#connect,Method screenlets.plugins.Rhythmbox.RhythmboxAPI.connect()=screenlets.plugins.Rhythmbox.RhythmboxAPI-class.html#connect,Method screenlets.plugins.Sonata.SonataAPI.connect()=screenlets.plugins.Sonata.SonataAPI-class.html#connect,Method screenlets.plugins.Songbird.SongbirdAPI.connect()=screenlets.plugins.Songbird.SongbirdAPI-class.html#connect,Function screenlets.plugins.mpdclient2.connect()=screenlets.plugins.mpdclient2-module.html#connect"><a title="screenlets.plugins.Amarok.AmarokAPI.connect
screenlets.plugins.Audacious.AudaciousAPI.connect
screenlets.plugins.Banshee.BansheeAPI.connect
screenlets.plugins.Exaile.ExaileAPI.connect
screenlets.plugins.GenericPlayer.GenericAPI.connect
screenlets.plugins.Juk.JukAPI.connect
screenlets.plugins.Kaffeine.KaffeineAPI.connect
screenlets.plugins.LastFMProxy.LastFMProxyAPI.connect
screenlets.plugins.Listen.ListenAPI.connect
screenlets.plugins.Quodlibet.QuodlibetAPI.connect
screenlets.plugins.Rhythmbox.RhythmboxAPI.connect
screenlets.plugins.Sonata.SonataAPI.connect
screenlets.plugins.Songbird.SongbirdAPI.connect
screenlets.plugins.mpdclient2.connect" class="py-name" href="#" onclick="return doclink('link-4', 'connect', 'link-4');">connect</a></tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt id="link-5" class="py-name"><a title="screenlets.plugins.Sonata.SonataAPI.host" class="py-name" href="#" onclick="return doclink('link-5', 'host', 'link-0');">host</a></tt><tt class="py-op">,</tt> <tt id="link-6" class="py-name"><a title="screenlets.plugins.Sonata.SonataAPI.port" class="py-name" href="#" onclick="return doclink('link-6', 'port', 'link-2');">port</a></tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">file</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">sock</tt><tt class="py-op">.</tt><tt class="py-name">makefile</tt><tt class="py-op">(</tt><tt class="py-string">"rb+"</tt><tt class="py-op">)</tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">current_line</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">ack</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">done</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
</div><a name="L25"></a><tt class="py-lineno"> 25</tt> <tt class="py-line"> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt> <tt class="py-line"> <tt class="py-comment"># this SUCKS</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt> <tt class="py-line"> </tt>
<a name="socket_talker.get_line"></a><div id="socket_talker.get_line-def"><a name="L28"></a><tt class="py-lineno"> 28</tt> <a class="py-toggle" href="#" id="socket_talker.get_line-toggle" onclick="return toggle('socket_talker.get_line');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.socket_talker-class.html#get_line">get_line</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="socket_talker.get_line-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="socket_talker.get_line-expanded"><a name="L29"></a><tt class="py-lineno"> 29</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">current_line</tt><tt class="py-op">:</tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">current_line</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">file</tt><tt class="py-op">.</tt><tt class="py-name">readline</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">rstrip</tt><tt class="py-op">(</tt><tt class="py-string">"\n"</tt><tt class="py-op">)</tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">current_line</tt><tt class="py-op">:</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">EOFError</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">current_line</tt> <tt class="py-op">==</tt> <tt class="py-string">"OK"</tt> <tt class="py-keyword">or</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">current_line</tt><tt class="py-op">.</tt><tt class="py-name">startswith</tt><tt class="py-op">(</tt><tt class="py-string">"ACK"</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">done</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">current_line</tt> </tt>
</div><a name="L36"></a><tt class="py-lineno"> 36</tt> <tt class="py-line"> </tt>
<a name="socket_talker.putline"></a><div id="socket_talker.putline-def"><a name="L37"></a><tt class="py-lineno"> 37</tt> <a class="py-toggle" href="#" id="socket_talker.putline-toggle" onclick="return toggle('socket_talker.putline');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.socket_talker-class.html#putline">putline</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">line</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="socket_talker.putline-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="socket_talker.putline-expanded"><a name="L38"></a><tt class="py-lineno"> 38</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">file</tt><tt class="py-op">.</tt><tt class="py-name">write</tt><tt class="py-op">(</tt><tt class="py-string">"%s\n"</tt> <tt class="py-op">%</tt> <tt class="py-name">line</tt><tt class="py-op">)</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">file</tt><tt class="py-op">.</tt><tt id="link-7" class="py-name" targets="Method screenlets.backend.CachingBackend.flush()=screenlets.backend.CachingBackend-class.html#flush,Method screenlets.backend.GconfBackend.flush()=screenlets.backend.GconfBackend-class.html#flush,Method screenlets.backend.ScreenletsBackend.flush()=screenlets.backend.ScreenletsBackend-class.html#flush"><a title="screenlets.backend.CachingBackend.flush
screenlets.backend.GconfBackend.flush
screenlets.backend.ScreenletsBackend.flush" class="py-name" href="#" onclick="return doclink('link-7', 'flush', 'link-7');">flush</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">done</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
</div><a name="L41"></a><tt class="py-lineno"> 41</tt> <tt class="py-line"> </tt>
<a name="socket_talker.get_pair"></a><div id="socket_talker.get_pair-def"><a name="L42"></a><tt class="py-lineno"> 42</tt> <a class="py-toggle" href="#" id="socket_talker.get_pair-toggle" onclick="return toggle('socket_talker.get_pair');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.socket_talker-class.html#get_pair">get_pair</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="socket_talker.get_pair-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="socket_talker.get_pair-expanded"><a name="L43"></a><tt class="py-lineno"> 43</tt> <tt class="py-line"> <tt class="py-name">line</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-8" class="py-name" targets="Method screenlets.plugins.mpdclient2.socket_talker.get_line()=screenlets.plugins.mpdclient2.socket_talker-class.html#get_line"><a title="screenlets.plugins.mpdclient2.socket_talker.get_line" class="py-name" href="#" onclick="return doclink('link-8', 'get_line', 'link-8');">get_line</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">ack</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt> <tt class="py-line"> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">done</tt><tt class="py-op">:</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">line</tt><tt class="py-op">.</tt><tt class="py-name">startswith</tt><tt class="py-op">(</tt><tt class="py-string">"ACK"</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">ack</tt> <tt class="py-op">=</tt> <tt class="py-name">line</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt> <tt class="py-line"> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt> <tt class="py-line"> <tt class="py-name">pair</tt> <tt class="py-op">=</tt> <tt class="py-name">line</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">": "</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L52"></a><tt class="py-lineno"> 52</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">pair</tt><tt class="py-op">)</tt> <tt class="py-op">!=</tt> <tt class="py-number">2</tt><tt class="py-op">:</tt> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">RuntimeError</tt><tt class="py-op">(</tt><tt class="py-string">"bogus response: ``%s''"</tt> <tt class="py-op">%</tt> <tt class="py-name">line</tt><tt class="py-op">)</tt> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt> <tt class="py-line"> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">pair</tt> </tt>
</div></div><a name="L56"></a><tt class="py-lineno"> 56</tt> <tt class="py-line"> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt> <tt class="py-line"><tt id="link-9" class="py-name" targets="Variable screenlets.plugins.mpdclient2.ZERO=screenlets.plugins.mpdclient2-module.html#ZERO"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-9', 'ZERO', 'link-9');">ZERO</a></tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt> <tt class="py-line"><tt id="link-10" class="py-name" targets="Variable screenlets.plugins.mpdclient2.ONE=screenlets.plugins.mpdclient2-module.html#ONE"><a title="screenlets.plugins.mpdclient2.ONE" class="py-name" href="#" onclick="return doclink('link-10', 'ONE', 'link-10');">ONE</a></tt> <tt class="py-op">=</tt> <tt class="py-number">1</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt> <tt class="py-line"><tt id="link-11" class="py-name" targets="Variable screenlets.plugins.mpdclient2.MANY=screenlets.plugins.mpdclient2-module.html#MANY"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-11', 'MANY', 'link-11');">MANY</a></tt> <tt class="py-op">=</tt> <tt class="py-number">2</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt> <tt class="py-line"> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt> <tt class="py-line"><tt id="link-12" class="py-name" targets="Variable screenlets.plugins.mpdclient2.plitem_delim=screenlets.plugins.mpdclient2-module.html#plitem_delim"><a title="screenlets.plugins.mpdclient2.plitem_delim" class="py-name" href="#" onclick="return doclink('link-12', 'plitem_delim', 'link-12');">plitem_delim</a></tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-string">"file"</tt><tt class="py-op">,</tt> <tt class="py-string">"directory"</tt><tt class="py-op">,</tt> <tt class="py-string">"playlist"</tt><tt class="py-op">]</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt> <tt class="py-line"> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt> <tt class="py-line"><tt id="link-13" class="py-name" targets="Variable screenlets.plugins.mpdclient2.commands=screenlets.plugins.mpdclient2-module.html#commands"><a title="screenlets.plugins.mpdclient2.commands" class="py-name" href="#" onclick="return doclink('link-13', 'commands', 'link-13');">commands</a></tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt> <tt class="py-line"> <tt class="py-comment"># (name, nargs): (format string, nresults, results_type_name, delimiter_key)</tt> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt> <tt class="py-line"> </tt>
<a name="L66"></a><tt class="py-lineno"> 66</tt> <tt class="py-line"> <tt class="py-comment"># delimiter key is for commands that return multiple results. we use this</tt> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt> <tt class="py-line"> <tt class="py-comment"># string to detect the beginning of a new result object.</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt> <tt class="py-line"> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt> <tt class="py-line"> <tt class="py-comment"># if results_type_name is empty, the result object's .type will be set to</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt> <tt class="py-line"> <tt class="py-comment"># the key of the first key/val pair in it; otherwise, it will be set to</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt> <tt class="py-line"> <tt class="py-comment"># results_type_name.</tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt> <tt class="py-line"> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"kill"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-14" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-14', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"outputs"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-15" class="py-name"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-15', 'MANY', 'link-11');">MANY</a></tt><tt class="py-op">,</tt> <tt class="py-string">'outputs'</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-string">'outputid'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"clear"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-16" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-16', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L76"></a><tt class="py-lineno"> 76</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"currentsong"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-17" class="py-name"><a title="screenlets.plugins.mpdclient2.ONE" class="py-name" href="#" onclick="return doclink('link-17', 'ONE', 'link-10');">ONE</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L77"></a><tt class="py-lineno"> 77</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"shuffle"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-18" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-18', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"next"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-19" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-19', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"previous"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-20" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-20', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"stop"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-21" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-21', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"clearerror"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-22" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-22', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"close"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-23" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-23', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L83"></a><tt class="py-lineno"> 83</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"commands"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-24" class="py-name"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-24', 'MANY', 'link-11');">MANY</a></tt><tt class="py-op">,</tt> <tt class="py-string">'commands'</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-string">'command'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"notcommands"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-25" class="py-name"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-25', 'MANY', 'link-11');">MANY</a></tt><tt class="py-op">,</tt> <tt class="py-string">'notcommands'</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-string">'command'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L85"></a><tt class="py-lineno"> 85</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"ping"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-26" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-26', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L86"></a><tt class="py-lineno"> 86</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"stats"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-27" class="py-name"><a title="screenlets.plugins.mpdclient2.ONE" class="py-name" href="#" onclick="return doclink('link-27', 'ONE', 'link-10');">ONE</a></tt><tt class="py-op">,</tt> <tt class="py-string">'stats'</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L87"></a><tt class="py-lineno"> 87</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"status"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-28" class="py-name"><a title="screenlets.plugins.mpdclient2.ONE" class="py-name" href="#" onclick="return doclink('link-28', 'ONE', 'link-10');">ONE</a></tt><tt class="py-op">,</tt> <tt class="py-string">'status'</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L88"></a><tt class="py-lineno"> 88</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"play"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-29" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-29', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"playlistinfo"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-30" class="py-name"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-30', 'MANY', 'link-11');">MANY</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt id="link-31" class="py-name"><a title="screenlets.plugins.mpdclient2.plitem_delim" class="py-name" href="#" onclick="return doclink('link-31', 'plitem_delim', 'link-12');">plitem_delim</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"playlistid"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-32" class="py-name"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-32', 'MANY', 'link-11');">MANY</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt id="link-33" class="py-name"><a title="screenlets.plugins.mpdclient2.plitem_delim" class="py-name" href="#" onclick="return doclink('link-33', 'plitem_delim', 'link-12');">plitem_delim</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"lsinfo"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-34" class="py-name"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-34', 'MANY', 'link-11');">MANY</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt id="link-35" class="py-name"><a title="screenlets.plugins.mpdclient2.plitem_delim" class="py-name" href="#" onclick="return doclink('link-35', 'plitem_delim', 'link-12');">plitem_delim</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L92"></a><tt class="py-lineno"> 92</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"update"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-36" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-36', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"listall"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-37" class="py-name"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-37', 'MANY', 'link-11');">MANY</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt id="link-38" class="py-name"><a title="screenlets.plugins.mpdclient2.plitem_delim" class="py-name" href="#" onclick="return doclink('link-38', 'plitem_delim', 'link-12');">plitem_delim</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"listallinfo"</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s'</tt><tt class="py-op">,</tt> <tt id="link-39" class="py-name"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-39', 'MANY', 'link-11');">MANY</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt id="link-40" class="py-name"><a title="screenlets.plugins.mpdclient2.plitem_delim" class="py-name" href="#" onclick="return doclink('link-40', 'plitem_delim', 'link-12');">plitem_delim</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt> <tt class="py-line"> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"disableoutput"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">"%s %d"</tt><tt class="py-op">,</tt> <tt id="link-41" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-41', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"enableoutput"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">"%s %d"</tt><tt class="py-op">,</tt> <tt id="link-42" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-42', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"delete"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s %d'</tt><tt class="py-op">,</tt> <tt id="link-43" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-43', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <int song></tt> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"deleteid"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s %d'</tt><tt class="py-op">,</tt> <tt id="link-44" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-44', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <int songid></tt> </tt>
<a name="L100"></a><tt class="py-lineno">100</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"playlistinfo"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s %d'</tt><tt class="py-op">,</tt> <tt id="link-45" class="py-name"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-45', 'MANY', 'link-11');">MANY</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt id="link-46" class="py-name"><a title="screenlets.plugins.mpdclient2.plitem_delim" class="py-name" href="#" onclick="return doclink('link-46', 'plitem_delim', 'link-12');">plitem_delim</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <int song></tt> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"playlistid"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s %d'</tt><tt class="py-op">,</tt> <tt id="link-47" class="py-name"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-47', 'MANY', 'link-11');">MANY</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt id="link-48" class="py-name"><a title="screenlets.plugins.mpdclient2.plitem_delim" class="py-name" href="#" onclick="return doclink('link-48', 'plitem_delim', 'link-12');">plitem_delim</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <int songid></tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"crossfade"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s %d'</tt><tt class="py-op">,</tt> <tt id="link-49" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-49', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <int seconds></tt> </tt>
<a name="L103"></a><tt class="py-lineno">103</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"play"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s %d'</tt><tt class="py-op">,</tt> <tt id="link-50" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-50', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <int song></tt> </tt>
<a name="L104"></a><tt class="py-lineno">104</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"playid"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s %d'</tt><tt class="py-op">,</tt> <tt id="link-51" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-51', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <int songid></tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"random"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s %d'</tt><tt class="py-op">,</tt> <tt id="link-52" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-52', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <int state></tt> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"repeat"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s %d'</tt><tt class="py-op">,</tt> <tt id="link-53" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-53', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <int state></tt> </tt>
<a name="L107"></a><tt class="py-lineno">107</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"setvol"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s %d'</tt><tt class="py-op">,</tt> <tt id="link-54" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-54', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <int vol></tt> </tt>
<a name="L108"></a><tt class="py-lineno">108</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"plchanges"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s %d'</tt><tt class="py-op">,</tt> <tt id="link-55" class="py-name"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-55', 'MANY', 'link-11');">MANY</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt id="link-56" class="py-name"><a title="screenlets.plugins.mpdclient2.plitem_delim" class="py-name" href="#" onclick="return doclink('link-56', 'plitem_delim', 'link-12');">plitem_delim</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <playlist version></tt> </tt>
<a name="L109"></a><tt class="py-lineno">109</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"pause"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s %d'</tt><tt class="py-op">,</tt> <tt id="link-57" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-57', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <bool pause></tt> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt> <tt class="py-line"> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"update"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s "%s"'</tt><tt class="py-op">,</tt> <tt id="link-58" class="py-name"><a title="screenlets.plugins.mpdclient2.ONE" class="py-name" href="#" onclick="return doclink('link-58', 'ONE', 'link-10');">ONE</a></tt><tt class="py-op">,</tt> <tt class="py-string">'update'</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <string path></tt> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"listall"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s "%s"'</tt><tt class="py-op">,</tt> <tt id="link-59" class="py-name"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-59', 'MANY', 'link-11');">MANY</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt id="link-60" class="py-name"><a title="screenlets.plugins.mpdclient2.plitem_delim" class="py-name" href="#" onclick="return doclink('link-60', 'plitem_delim', 'link-12');">plitem_delim</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <string path></tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"listallinfo"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s "%s"'</tt><tt class="py-op">,</tt> <tt id="link-61" class="py-name"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-61', 'MANY', 'link-11');">MANY</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt id="link-62" class="py-name"><a title="screenlets.plugins.mpdclient2.plitem_delim" class="py-name" href="#" onclick="return doclink('link-62', 'plitem_delim', 'link-12');">plitem_delim</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <string path></tt> </tt>
<a name="L114"></a><tt class="py-lineno">114</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"lsinfo"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s "%s"'</tt><tt class="py-op">,</tt> <tt id="link-63" class="py-name"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-63', 'MANY', 'link-11');">MANY</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt id="link-64" class="py-name"><a title="screenlets.plugins.mpdclient2.plitem_delim" class="py-name" href="#" onclick="return doclink('link-64', 'plitem_delim', 'link-12');">plitem_delim</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <string directory></tt> </tt>
<a name="L115"></a><tt class="py-lineno">115</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"add"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s "%s"'</tt><tt class="py-op">,</tt> <tt id="link-65" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-65', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <string></tt> </tt>
<a name="L116"></a><tt class="py-lineno">116</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"load"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s "%s"'</tt><tt class="py-op">,</tt> <tt id="link-66" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-66', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <string name></tt> </tt>
<a name="L117"></a><tt class="py-lineno">117</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"rm"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s "%s"'</tt><tt class="py-op">,</tt> <tt id="link-67" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-67', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <string name></tt> </tt>
<a name="L118"></a><tt class="py-lineno">118</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"save"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s "%s"'</tt><tt class="py-op">,</tt> <tt id="link-68" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-68', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <string playlist name></tt> </tt>
<a name="L119"></a><tt class="py-lineno">119</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"password"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s "%s"'</tt><tt class="py-op">,</tt> <tt id="link-69" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-69', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <string password></tt> </tt>
<a name="L120"></a><tt class="py-lineno">120</tt> <tt class="py-line"> </tt>
<a name="L121"></a><tt class="py-lineno">121</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"move"</tt><tt class="py-op">,</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">"%s %d %d"</tt><tt class="py-op">,</tt> <tt id="link-70" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-70', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <int from> <int to></tt> </tt>
<a name="L122"></a><tt class="py-lineno">122</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"moveid"</tt><tt class="py-op">,</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">"%s %d %d"</tt><tt class="py-op">,</tt> <tt id="link-71" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-71', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <int songid from> <int to></tt> </tt>
<a name="L123"></a><tt class="py-lineno">123</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"swap"</tt><tt class="py-op">,</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">"%s %d %d"</tt><tt class="py-op">,</tt> <tt id="link-72" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-72', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <int song1> <int song2></tt> </tt>
<a name="L124"></a><tt class="py-lineno">124</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"swapid"</tt><tt class="py-op">,</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">"%s %d %d"</tt><tt class="py-op">,</tt> <tt id="link-73" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-73', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <int songid1> <int songid2></tt> </tt>
<a name="L125"></a><tt class="py-lineno">125</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"seek"</tt><tt class="py-op">,</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">"%s %d %d"</tt><tt class="py-op">,</tt> <tt id="link-74" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-74', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <int song> <int time></tt> </tt>
<a name="L126"></a><tt class="py-lineno">126</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"seekid"</tt><tt class="py-op">,</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">"%s %d %d"</tt><tt class="py-op">,</tt> <tt id="link-75" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-75', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment"># <int songid> <int time></tt> </tt>
<a name="L127"></a><tt class="py-lineno">127</tt> <tt class="py-line"> </tt>
<a name="L128"></a><tt class="py-lineno">128</tt> <tt class="py-line"> <tt class="py-comment"># <string type> <string what></tt> </tt>
<a name="L129"></a><tt class="py-lineno">129</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"find"</tt><tt class="py-op">,</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s "%s" "%s"'</tt><tt class="py-op">,</tt> <tt id="link-76" class="py-name"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-76', 'MANY', 'link-11');">MANY</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt id="link-77" class="py-name"><a title="screenlets.plugins.mpdclient2.plitem_delim" class="py-name" href="#" onclick="return doclink('link-77', 'plitem_delim', 'link-12');">plitem_delim</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt> <tt class="py-line"> </tt>
<a name="L131"></a><tt class="py-lineno">131</tt> <tt class="py-line"> <tt class="py-comment"># <string type> <string what></tt> </tt>
<a name="L132"></a><tt class="py-lineno">132</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"search"</tt><tt class="py-op">,</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s "%s" "%s"'</tt><tt class="py-op">,</tt> <tt id="link-78" class="py-name"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-78', 'MANY', 'link-11');">MANY</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt id="link-79" class="py-name"><a title="screenlets.plugins.mpdclient2.plitem_delim" class="py-name" href="#" onclick="return doclink('link-79', 'plitem_delim', 'link-12');">plitem_delim</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L133"></a><tt class="py-lineno">133</tt> <tt class="py-line"> </tt>
<a name="L134"></a><tt class="py-lineno">134</tt> <tt class="py-line"> <tt class="py-comment"># list <metadata arg1> [<metadata arg2> <search term>]</tt> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt> <tt class="py-line"> </tt>
<a name="L136"></a><tt class="py-lineno">136</tt> <tt class="py-line"> <tt class="py-comment"># <metadata arg1></tt> </tt>
<a name="L137"></a><tt class="py-lineno">137</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"list"</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s "%s"'</tt><tt class="py-op">,</tt> <tt id="link-80" class="py-name"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-80', 'MANY', 'link-11');">MANY</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt id="link-81" class="py-name"><a title="screenlets.plugins.mpdclient2.plitem_delim" class="py-name" href="#" onclick="return doclink('link-81', 'plitem_delim', 'link-12');">plitem_delim</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt> <tt class="py-line"> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt> <tt class="py-line"> <tt class="py-comment"># <metadata arg1> <metadata arg2> <search term></tt> </tt>
<a name="L140"></a><tt class="py-lineno">140</tt> <tt class="py-line"> <tt class="py-op">(</tt><tt class="py-string">"list"</tt><tt class="py-op">,</tt> <tt class="py-number">3</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-op">(</tt><tt class="py-string">'%s "%s" "%s" "%s"'</tt><tt class="py-op">,</tt> <tt id="link-82" class="py-name"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-82', 'MANY', 'link-11');">MANY</a></tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt id="link-83" class="py-name"><a title="screenlets.plugins.mpdclient2.plitem_delim" class="py-name" href="#" onclick="return doclink('link-83', 'plitem_delim', 'link-12');">plitem_delim</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L141"></a><tt class="py-lineno">141</tt> <tt class="py-line"><tt class="py-op">}</tt> </tt>
<a name="L142"></a><tt class="py-lineno">142</tt> <tt class="py-line"> </tt>
<a name="is_command"></a><div id="is_command-def"><a name="L143"></a><tt class="py-lineno">143</tt> <a class="py-toggle" href="#" id="is_command-toggle" onclick="return toggle('is_command');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2-module.html#is_command">is_command</a><tt class="py-op">(</tt><tt class="py-param">cmd</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="is_command-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="is_command-expanded"><a name="L144"></a><tt class="py-lineno">144</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt id="link-84" class="py-name" targets="Method screenlets.plugins.Mplayer.Mplayer.cmd()=screenlets.plugins.Mplayer.Mplayer-class.html#cmd"><a title="screenlets.plugins.Mplayer.Mplayer.cmd" class="py-name" href="#" onclick="return doclink('link-84', 'cmd', 'link-84');">cmd</a></tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt> <tt class="py-name">k</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-keyword">for</tt> <tt class="py-name">k</tt> <tt class="py-keyword">in</tt> <tt id="link-85" class="py-name"><a title="screenlets.plugins.mpdclient2.commands" class="py-name" href="#" onclick="return doclink('link-85', 'commands', 'link-13');">commands</a></tt><tt class="py-op">.</tt><tt class="py-name">keys</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">]</tt> </tt>
</div><a name="L145"></a><tt class="py-lineno">145</tt> <tt class="py-line"> </tt>
<a name="escape"></a><div id="escape-def"><a name="L146"></a><tt class="py-lineno">146</tt> <a class="py-toggle" href="#" id="escape-toggle" onclick="return toggle('escape');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2-module.html#escape">escape</a><tt class="py-op">(</tt><tt class="py-param">text</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="escape-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="escape-expanded"><a name="L147"></a><tt class="py-lineno">147</tt> <tt class="py-line"> <tt class="py-comment"># join/split is faster than replace</tt> </tt>
<a name="L148"></a><tt class="py-lineno">148</tt> <tt class="py-line"> <tt id="link-86" class="py-name" targets="Variable screenlets.Notify.text=screenlets.Notify-class.html#text,Variable screenlets.Tooltip.text=screenlets.Tooltip-class.html#text"><a title="screenlets.Notify.text
screenlets.Tooltip.text" class="py-name" href="#" onclick="return doclink('link-86', 'text', 'link-86');">text</a></tt> <tt class="py-op">=</tt> <tt class="py-string">'\\\\'</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt id="link-87" class="py-name"><a title="screenlets.Notify.text
screenlets.Tooltip.text" class="py-name" href="#" onclick="return doclink('link-87', 'text', 'link-86');">text</a></tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'\\'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> <tt class="py-comment"># \ -> \\</tt> </tt>
<a name="L149"></a><tt class="py-lineno">149</tt> <tt class="py-line"> <tt id="link-88" class="py-name"><a title="screenlets.Notify.text
screenlets.Tooltip.text" class="py-name" href="#" onclick="return doclink('link-88', 'text', 'link-86');">text</a></tt> <tt class="py-op">=</tt> <tt class="py-string">'\\"'</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt id="link-89" class="py-name"><a title="screenlets.Notify.text
screenlets.Tooltip.text" class="py-name" href="#" onclick="return doclink('link-89', 'text', 'link-86');">text</a></tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'"'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> <tt class="py-comment"># " -> \"</tt> </tt>
<a name="L150"></a><tt class="py-lineno">150</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt id="link-90" class="py-name"><a title="screenlets.Notify.text
screenlets.Tooltip.text" class="py-name" href="#" onclick="return doclink('link-90', 'text', 'link-86');">text</a></tt> </tt>
</div><a name="L151"></a><tt class="py-lineno">151</tt> <tt class="py-line"> </tt>
<a name="get_command"></a><div id="get_command-def"><a name="L152"></a><tt class="py-lineno">152</tt> <a class="py-toggle" href="#" id="get_command-toggle" onclick="return toggle('get_command');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2-module.html#get_command">get_command</a><tt class="py-op">(</tt><tt class="py-param">cmd</tt><tt class="py-op">,</tt> <tt class="py-param">args</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="get_command-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="get_command-expanded"><a name="L153"></a><tt class="py-lineno">153</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L154"></a><tt class="py-lineno">154</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt id="link-91" class="py-name"><a title="screenlets.plugins.mpdclient2.commands" class="py-name" href="#" onclick="return doclink('link-91', 'commands', 'link-13');">commands</a></tt><tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-92" class="py-name"><a title="screenlets.plugins.Mplayer.Mplayer.cmd" class="py-name" href="#" onclick="return doclink('link-92', 'cmd', 'link-84');">cmd</a></tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
<a name="L155"></a><tt class="py-lineno">155</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">KeyError</tt><tt class="py-op">:</tt> </tt>
<a name="L156"></a><tt class="py-lineno">156</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">RuntimeError</tt><tt class="py-op">(</tt><tt class="py-string">"no such command: %s (%d args)"</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt id="link-93" class="py-name"><a title="screenlets.plugins.Mplayer.Mplayer.cmd" class="py-name" href="#" onclick="return doclink('link-93', 'cmd', 'link-84');">cmd</a></tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L157"></a><tt class="py-lineno">157</tt> <tt class="py-line"> </tt>
<a name="send_command"></a><div id="send_command-def"><a name="L158"></a><tt class="py-lineno">158</tt> <a class="py-toggle" href="#" id="send_command-toggle" onclick="return toggle('send_command');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2-module.html#send_command">send_command</a><tt class="py-op">(</tt><tt class="py-param">talker</tt><tt class="py-op">,</tt> <tt class="py-param">cmd</tt><tt class="py-op">,</tt> <tt class="py-param">args</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="send_command-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="send_command-expanded"><a name="L159"></a><tt class="py-lineno">159</tt> <tt class="py-line"> <tt class="py-name">args</tt> <tt class="py-op">=</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L160"></a><tt class="py-lineno">160</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">i</tt><tt class="py-op">,</tt> <tt class="py-name">arg</tt> <tt class="py-keyword">in</tt> <tt class="py-name">enumerate</tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L161"></a><tt class="py-lineno">161</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">arg</tt><tt class="py-op">,</tt> <tt class="py-name">int</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L162"></a><tt class="py-lineno">162</tt> <tt class="py-line"> <tt class="py-name">args</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt id="link-94" class="py-name" targets="Function screenlets.plugins.mpdclient2.escape()=screenlets.plugins.mpdclient2-module.html#escape"><a title="screenlets.plugins.mpdclient2.escape" class="py-name" href="#" onclick="return doclink('link-94', 'escape', 'link-94');">escape</a></tt><tt class="py-op">(</tt><tt id="link-95" class="py-name" targets="Method screenlets.plugins.Convert.Converter.str()=screenlets.plugins.Convert.Converter-class.html#str"><a title="screenlets.plugins.Convert.Converter.str" class="py-name" href="#" onclick="return doclink('link-95', 'str', 'link-95');">str</a></tt><tt class="py-op">(</tt><tt class="py-name">arg</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L163"></a><tt class="py-lineno">163</tt> <tt class="py-line"> <tt class="py-name">format</tt> <tt class="py-op">=</tt> <tt id="link-96" class="py-name" targets="Function screenlets.plugins.mpdclient2.get_command()=screenlets.plugins.mpdclient2-module.html#get_command"><a title="screenlets.plugins.mpdclient2.get_command" class="py-name" href="#" onclick="return doclink('link-96', 'get_command', 'link-96');">get_command</a></tt><tt class="py-op">(</tt><tt id="link-97" class="py-name"><a title="screenlets.plugins.Mplayer.Mplayer.cmd" class="py-name" href="#" onclick="return doclink('link-97', 'cmd', 'link-84');">cmd</a></tt><tt class="py-op">,</tt> <tt class="py-name">args</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L164"></a><tt class="py-lineno">164</tt> <tt class="py-line"> <tt class="py-name">talker</tt><tt class="py-op">.</tt><tt id="link-98" class="py-name" targets="Method screenlets.plugins.mpdclient2.socket_talker.putline()=screenlets.plugins.mpdclient2.socket_talker-class.html#putline"><a title="screenlets.plugins.mpdclient2.socket_talker.putline" class="py-name" href="#" onclick="return doclink('link-98', 'putline', 'link-98');">putline</a></tt><tt class="py-op">(</tt><tt class="py-name">format</tt> <tt class="py-op">%</tt> <tt class="py-name">tuple</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt id="link-99" class="py-name"><a title="screenlets.plugins.Mplayer.Mplayer.cmd" class="py-name" href="#" onclick="return doclink('link-99', 'cmd', 'link-84');">cmd</a></tt><tt class="py-op">]</tt> <tt class="py-op">+</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L165"></a><tt class="py-lineno">165</tt> <tt class="py-line"> </tt>
<a name="sender_n_fetcher"></a><div id="sender_n_fetcher-def"><a name="L166"></a><tt class="py-lineno">166</tt> <a class="py-toggle" href="#" id="sender_n_fetcher-toggle" onclick="return toggle('sender_n_fetcher');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.sender_n_fetcher-class.html">sender_n_fetcher</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="sender_n_fetcher-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="sender_n_fetcher-expanded"><a name="sender_n_fetcher.__init__"></a><div id="sender_n_fetcher.__init__-def"><a name="L167"></a><tt class="py-lineno">167</tt> <a class="py-toggle" href="#" id="sender_n_fetcher.__init__-toggle" onclick="return toggle('sender_n_fetcher.__init__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.sender_n_fetcher-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">sender</tt><tt class="py-op">,</tt> <tt class="py-param">fetcher</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="sender_n_fetcher.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="sender_n_fetcher.__init__-expanded"><a name="L168"></a><tt class="py-lineno">168</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">sender</tt> <tt class="py-op">=</tt> <tt class="py-name">sender</tt> </tt>
<a name="L169"></a><tt class="py-lineno">169</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">fetcher</tt> <tt class="py-op">=</tt> <tt class="py-name">fetcher</tt> </tt>
<a name="L170"></a><tt class="py-lineno">170</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">iterate</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
</div><a name="L171"></a><tt class="py-lineno">171</tt> <tt class="py-line"> </tt>
<a name="sender_n_fetcher.__getattr__"></a><div id="sender_n_fetcher.__getattr__-def"><a name="L172"></a><tt class="py-lineno">172</tt> <a class="py-toggle" href="#" id="sender_n_fetcher.__getattr__-toggle" onclick="return toggle('sender_n_fetcher.__getattr__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.sender_n_fetcher-class.html#__getattr__">__getattr__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">cmd</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="sender_n_fetcher.__getattr__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="sender_n_fetcher.__getattr__-expanded"><a name="L173"></a><tt class="py-lineno">173</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-keyword">lambda</tt> <tt class="py-op">*</tt><tt class="py-name">args</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-100" class="py-name" targets="Method screenlets.plugins.mpdclient2.sender_n_fetcher.send_n_fetch()=screenlets.plugins.mpdclient2.sender_n_fetcher-class.html#send_n_fetch"><a title="screenlets.plugins.mpdclient2.sender_n_fetcher.send_n_fetch" class="py-name" href="#" onclick="return doclink('link-100', 'send_n_fetch', 'link-100');">send_n_fetch</a></tt><tt class="py-op">(</tt><tt id="link-101" class="py-name"><a title="screenlets.plugins.Mplayer.Mplayer.cmd" class="py-name" href="#" onclick="return doclink('link-101', 'cmd', 'link-84');">cmd</a></tt><tt class="py-op">,</tt> <tt class="py-name">args</tt><tt class="py-op">)</tt> </tt>
</div><a name="L174"></a><tt class="py-lineno">174</tt> <tt class="py-line"> </tt>
<a name="sender_n_fetcher.send_n_fetch"></a><div id="sender_n_fetcher.send_n_fetch-def"><a name="L175"></a><tt class="py-lineno">175</tt> <a class="py-toggle" href="#" id="sender_n_fetcher.send_n_fetch-toggle" onclick="return toggle('sender_n_fetcher.send_n_fetch');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.sender_n_fetcher-class.html#send_n_fetch">send_n_fetch</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">cmd</tt><tt class="py-op">,</tt> <tt class="py-param">args</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="sender_n_fetcher.send_n_fetch-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="sender_n_fetcher.send_n_fetch-expanded"><a name="L176"></a><tt class="py-lineno">176</tt> <tt class="py-line"> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">sender</tt><tt class="py-op">,</tt> <tt id="link-102" class="py-name"><a title="screenlets.plugins.Mplayer.Mplayer.cmd" class="py-name" href="#" onclick="return doclink('link-102', 'cmd', 'link-84');">cmd</a></tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">args</tt><tt class="py-op">)</tt> </tt>
<a name="L177"></a><tt class="py-lineno">177</tt> <tt class="py-line"> <tt class="py-name">junk</tt><tt class="py-op">,</tt> <tt class="py-name">howmany</tt><tt class="py-op">,</tt> <tt class="py-name">type</tt><tt class="py-op">,</tt> <tt class="py-name">keywords</tt> <tt class="py-op">=</tt> <tt id="link-103" class="py-name"><a title="screenlets.plugins.mpdclient2.get_command" class="py-name" href="#" onclick="return doclink('link-103', 'get_command', 'link-96');">get_command</a></tt><tt class="py-op">(</tt><tt id="link-104" class="py-name"><a title="screenlets.plugins.Mplayer.Mplayer.cmd" class="py-name" href="#" onclick="return doclink('link-104', 'cmd', 'link-84');">cmd</a></tt><tt class="py-op">,</tt> <tt class="py-name">args</tt><tt class="py-op">)</tt> </tt>
<a name="L178"></a><tt class="py-lineno">178</tt> <tt class="py-line"> </tt>
<a name="L179"></a><tt class="py-lineno">179</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">howmany</tt> <tt class="py-op">==</tt> <tt id="link-105" class="py-name"><a title="screenlets.plugins.mpdclient2.ZERO" class="py-name" href="#" onclick="return doclink('link-105', 'ZERO', 'link-9');">ZERO</a></tt><tt class="py-op">:</tt> </tt>
<a name="L180"></a><tt class="py-lineno">180</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">fetcher</tt><tt class="py-op">.</tt><tt id="link-106" class="py-name" targets="Method screenlets.plugins.mpdclient2.response_fetcher.clear()=screenlets.plugins.mpdclient2.response_fetcher-class.html#clear"><a title="screenlets.plugins.mpdclient2.response_fetcher.clear" class="py-name" href="#" onclick="return doclink('link-106', 'clear', 'link-106');">clear</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L181"></a><tt class="py-lineno">181</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> </tt>
<a name="L182"></a><tt class="py-lineno">182</tt> <tt class="py-line"> </tt>
<a name="L183"></a><tt class="py-lineno">183</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">howmany</tt> <tt class="py-op">==</tt> <tt id="link-107" class="py-name"><a title="screenlets.plugins.mpdclient2.ONE" class="py-name" href="#" onclick="return doclink('link-107', 'ONE', 'link-10');">ONE</a></tt><tt class="py-op">:</tt> </tt>
<a name="L184"></a><tt class="py-lineno">184</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">fetcher</tt><tt class="py-op">.</tt><tt id="link-108" class="py-name" targets="Method screenlets.plugins.mpdclient2.response_fetcher.one_object()=screenlets.plugins.mpdclient2.response_fetcher-class.html#one_object"><a title="screenlets.plugins.mpdclient2.response_fetcher.one_object" class="py-name" href="#" onclick="return doclink('link-108', 'one_object', 'link-108');">one_object</a></tt><tt class="py-op">(</tt><tt class="py-name">keywords</tt><tt class="py-op">,</tt> <tt class="py-name">type</tt><tt class="py-op">)</tt> </tt>
<a name="L185"></a><tt class="py-lineno">185</tt> <tt class="py-line"> </tt>
<a name="L186"></a><tt class="py-lineno">186</tt> <tt class="py-line"> <tt class="py-keyword">assert</tt> <tt class="py-name">howmany</tt> <tt class="py-op">==</tt> <tt id="link-109" class="py-name"><a title="screenlets.plugins.mpdclient2.MANY" class="py-name" href="#" onclick="return doclink('link-109', 'MANY', 'link-11');">MANY</a></tt> </tt>
<a name="L187"></a><tt class="py-lineno">187</tt> <tt class="py-line"> <tt class="py-name">result</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">fetcher</tt><tt class="py-op">.</tt><tt id="link-110" class="py-name" targets="Method screenlets.plugins.mpdclient2.response_fetcher.all_objects()=screenlets.plugins.mpdclient2.response_fetcher-class.html#all_objects"><a title="screenlets.plugins.mpdclient2.response_fetcher.all_objects" class="py-name" href="#" onclick="return doclink('link-110', 'all_objects', 'link-110');">all_objects</a></tt><tt class="py-op">(</tt><tt class="py-name">keywords</tt><tt class="py-op">,</tt> <tt class="py-name">type</tt><tt class="py-op">)</tt> </tt>
<a name="L188"></a><tt class="py-lineno">188</tt> <tt class="py-line"> </tt>
<a name="L189"></a><tt class="py-lineno">189</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">iterate</tt><tt class="py-op">:</tt> </tt>
<a name="L190"></a><tt class="py-lineno">190</tt> <tt class="py-line"> <tt class="py-name">result</tt> <tt class="py-op">=</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">result</tt><tt class="py-op">)</tt> </tt>
<a name="L191"></a><tt class="py-lineno">191</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">fetcher</tt><tt class="py-op">.</tt><tt id="link-111" class="py-name"><a title="screenlets.plugins.mpdclient2.response_fetcher.clear" class="py-name" href="#" onclick="return doclink('link-111', 'clear', 'link-106');">clear</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L192"></a><tt class="py-lineno">192</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">result</tt> </tt>
<a name="L193"></a><tt class="py-lineno">193</tt> <tt class="py-line"> </tt>
<a name="L194"></a><tt class="py-lineno">194</tt> <tt class="py-line"> <tt class="py-comment"># stupid hack because you apparently can't return non-None and yield</tt> </tt>
<a name="L195"></a><tt class="py-lineno">195</tt> <tt class="py-line"> <tt class="py-comment"># within the same function</tt> </tt>
<a name="L196"></a><tt class="py-lineno">196</tt> <tt class="py-line"> <tt class="py-keyword">def</tt> <tt class="py-def-name">yield_then_clear</tt><tt class="py-op">(</tt><tt class="py-param">it</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L197"></a><tt class="py-lineno">197</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt id="link-112" class="py-name" targets="Variable screenlets.Notify.x=screenlets.Notify-class.html#x,Variable screenlets.Screenlet.x=screenlets.Screenlet-class.html#x,Variable screenlets.Tooltip.x=screenlets.Tooltip-class.html#x"><a title="screenlets.Notify.x
screenlets.Screenlet.x
screenlets.Tooltip.x" class="py-name" href="#" onclick="return doclink('link-112', 'x', 'link-112');">x</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">it</tt><tt class="py-op">:</tt> </tt>
<a name="L198"></a><tt class="py-lineno">198</tt> <tt class="py-line"> <tt class="py-keyword">yield</tt> <tt id="link-113" class="py-name"><a title="screenlets.Notify.x
screenlets.Screenlet.x
screenlets.Tooltip.x" class="py-name" href="#" onclick="return doclink('link-113', 'x', 'link-112');">x</a></tt> </tt>
<a name="L199"></a><tt class="py-lineno">199</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">fetcher</tt><tt class="py-op">.</tt><tt id="link-114" class="py-name"><a title="screenlets.plugins.mpdclient2.response_fetcher.clear" class="py-name" href="#" onclick="return doclink('link-114', 'clear', 'link-106');">clear</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L200"></a><tt class="py-lineno">200</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">yield_then_clear</tt><tt class="py-op">(</tt><tt class="py-name">result</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L201"></a><tt class="py-lineno">201</tt> <tt class="py-line"> </tt>
<a name="L202"></a><tt class="py-lineno">202</tt> <tt class="py-line"> </tt>
<a name="command_sender"></a><div id="command_sender-def"><a name="L203"></a><tt class="py-lineno">203</tt> <a class="py-toggle" href="#" id="command_sender-toggle" onclick="return toggle('command_sender');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.command_sender-class.html">command_sender</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="command_sender-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="command_sender-expanded"><a name="command_sender.__init__"></a><div id="command_sender.__init__-def"><a name="L204"></a><tt class="py-lineno">204</tt> <a class="py-toggle" href="#" id="command_sender.__init__-toggle" onclick="return toggle('command_sender.__init__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.command_sender-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">talker</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="command_sender.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="command_sender.__init__-expanded"><a name="L205"></a><tt class="py-lineno">205</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">talker</tt> <tt class="py-op">=</tt> <tt class="py-name">talker</tt> </tt>
</div><a name="command_sender.__getattr__"></a><div id="command_sender.__getattr__-def"><a name="L206"></a><tt class="py-lineno">206</tt> <a class="py-toggle" href="#" id="command_sender.__getattr__-toggle" onclick="return toggle('command_sender.__getattr__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.command_sender-class.html#__getattr__">__getattr__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">cmd</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="command_sender.__getattr__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="command_sender.__getattr__-expanded"><a name="L207"></a><tt class="py-lineno">207</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-keyword">lambda</tt> <tt class="py-op">*</tt><tt class="py-name">args</tt><tt class="py-op">:</tt> <tt id="link-115" class="py-name" targets="Function screenlets.plugins.mpdclient2.send_command()=screenlets.plugins.mpdclient2-module.html#send_command"><a title="screenlets.plugins.mpdclient2.send_command" class="py-name" href="#" onclick="return doclink('link-115', 'send_command', 'link-115');">send_command</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">talker</tt><tt class="py-op">,</tt> <tt id="link-116" class="py-name"><a title="screenlets.plugins.Mplayer.Mplayer.cmd" class="py-name" href="#" onclick="return doclink('link-116', 'cmd', 'link-84');">cmd</a></tt><tt class="py-op">,</tt> <tt class="py-name">args</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L208"></a><tt class="py-lineno">208</tt> <tt class="py-line"> </tt>
<a name="response_fetcher"></a><div id="response_fetcher-def"><a name="L209"></a><tt class="py-lineno">209</tt> <a class="py-toggle" href="#" id="response_fetcher-toggle" onclick="return toggle('response_fetcher');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.response_fetcher-class.html">response_fetcher</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="response_fetcher-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="response_fetcher-expanded"><a name="response_fetcher.__init__"></a><div id="response_fetcher.__init__-def"><a name="L210"></a><tt class="py-lineno">210</tt> <a class="py-toggle" href="#" id="response_fetcher.__init__-toggle" onclick="return toggle('response_fetcher.__init__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.response_fetcher-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">talker</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="response_fetcher.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="response_fetcher.__init__-expanded"><a name="L211"></a><tt class="py-lineno">211</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">talker</tt> <tt class="py-op">=</tt> <tt class="py-name">talker</tt> </tt>
<a name="L212"></a><tt class="py-lineno">212</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">converters</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
</div><a name="L213"></a><tt class="py-lineno">213</tt> <tt class="py-line"> </tt>
<a name="response_fetcher.clear"></a><div id="response_fetcher.clear-def"><a name="L214"></a><tt class="py-lineno">214</tt> <a class="py-toggle" href="#" id="response_fetcher.clear-toggle" onclick="return toggle('response_fetcher.clear');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.response_fetcher-class.html#clear">clear</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="response_fetcher.clear-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="response_fetcher.clear-expanded"><a name="L215"></a><tt class="py-lineno">215</tt> <tt class="py-line"> <tt class="py-keyword">while</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">talker</tt><tt class="py-op">.</tt><tt class="py-name">done</tt><tt class="py-op">:</tt> </tt>
<a name="L216"></a><tt class="py-lineno">216</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">talker</tt><tt class="py-op">.</tt><tt class="py-name">current_line</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt> </tt>
<a name="L217"></a><tt class="py-lineno">217</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">talker</tt><tt class="py-op">.</tt><tt id="link-117" class="py-name"><a title="screenlets.plugins.mpdclient2.socket_talker.get_line" class="py-name" href="#" onclick="return doclink('link-117', 'get_line', 'link-8');">get_line</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L218"></a><tt class="py-lineno">218</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">talker</tt><tt class="py-op">.</tt><tt class="py-name">current_line</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt> </tt>
</div><a name="L219"></a><tt class="py-lineno">219</tt> <tt class="py-line"> </tt>
<a name="response_fetcher.one_object"></a><div id="response_fetcher.one_object-def"><a name="L220"></a><tt class="py-lineno">220</tt> <a class="py-toggle" href="#" id="response_fetcher.one_object-toggle" onclick="return toggle('response_fetcher.one_object');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.response_fetcher-class.html#one_object">one_object</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">keywords</tt><tt class="py-op">,</tt> <tt class="py-param">type</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="response_fetcher.one_object-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="response_fetcher.one_object-expanded"><a name="L221"></a><tt class="py-lineno">221</tt> <tt class="py-line"> <tt class="py-comment"># if type isn't empty, then the object's type is set to it. otherwise</tt> </tt>
<a name="L222"></a><tt class="py-lineno">222</tt> <tt class="py-line"> <tt class="py-comment"># the type is set to the key of the first key/val pair.</tt> </tt>
<a name="L223"></a><tt class="py-lineno">223</tt> <tt class="py-line"> </tt>
<a name="L224"></a><tt class="py-lineno">224</tt> <tt class="py-line"> <tt class="py-comment"># keywords lists the keys that indicate a new object -- like for the</tt> </tt>
<a name="L225"></a><tt class="py-lineno">225</tt> <tt class="py-line"> <tt class="py-comment"># 'outputs' command, keywords would be ['outputid'].</tt> </tt>
<a name="L226"></a><tt class="py-lineno">226</tt> <tt class="py-line"> </tt>
<a name="L227"></a><tt class="py-lineno">227</tt> <tt class="py-line"> <tt class="py-name">entity</tt> <tt class="py-op">=</tt> <tt id="link-118" class="py-name" targets="Class screenlets.plugins.mpdclient2.dictobj=screenlets.plugins.mpdclient2.dictobj-class.html"><a title="screenlets.plugins.mpdclient2.dictobj" class="py-name" href="#" onclick="return doclink('link-118', 'dictobj', 'link-118');">dictobj</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L228"></a><tt class="py-lineno">228</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">type</tt><tt class="py-op">:</tt> </tt>
<a name="L229"></a><tt class="py-lineno">229</tt> <tt class="py-line"> <tt class="py-name">entity</tt><tt class="py-op">[</tt><tt class="py-string">'type'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">type</tt> </tt>
<a name="L230"></a><tt class="py-lineno">230</tt> <tt class="py-line"> </tt>
<a name="L231"></a><tt class="py-lineno">231</tt> <tt class="py-line"> <tt class="py-keyword">while</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">talker</tt><tt class="py-op">.</tt><tt class="py-name">done</tt><tt class="py-op">:</tt> </tt>
<a name="L232"></a><tt class="py-lineno">232</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">talker</tt><tt class="py-op">.</tt><tt id="link-119" class="py-name"><a title="screenlets.plugins.mpdclient2.socket_talker.get_line" class="py-name" href="#" onclick="return doclink('link-119', 'get_line', 'link-8');">get_line</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L233"></a><tt class="py-lineno">233</tt> <tt class="py-line"> <tt class="py-name">pair</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">talker</tt><tt class="py-op">.</tt><tt id="link-120" class="py-name" targets="Method screenlets.plugins.mpdclient2.socket_talker.get_pair()=screenlets.plugins.mpdclient2.socket_talker-class.html#get_pair"><a title="screenlets.plugins.mpdclient2.socket_talker.get_pair" class="py-name" href="#" onclick="return doclink('link-120', 'get_pair', 'link-120');">get_pair</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L234"></a><tt class="py-lineno">234</tt> <tt class="py-line"> </tt>
<a name="L235"></a><tt class="py-lineno">235</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">pair</tt><tt class="py-op">:</tt> </tt>
<a name="L236"></a><tt class="py-lineno">236</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">talker</tt><tt class="py-op">.</tt><tt class="py-name">current_line</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt> </tt>
<a name="L237"></a><tt class="py-lineno">237</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">entity</tt> </tt>
<a name="L238"></a><tt class="py-lineno">238</tt> <tt class="py-line"> </tt>
<a name="L239"></a><tt class="py-lineno">239</tt> <tt class="py-line"> <tt class="py-name">key</tt><tt class="py-op">,</tt> <tt class="py-name">val</tt> <tt class="py-op">=</tt> <tt class="py-name">pair</tt> </tt>
<a name="L240"></a><tt class="py-lineno">240</tt> <tt class="py-line"> <tt class="py-name">key</tt> <tt class="py-op">=</tt> <tt class="py-name">key</tt><tt class="py-op">.</tt><tt class="py-name">lower</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L241"></a><tt class="py-lineno">241</tt> <tt class="py-line"> </tt>
<a name="L242"></a><tt class="py-lineno">242</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">key</tt> <tt class="py-keyword">in</tt> <tt class="py-name">keywords</tt> <tt class="py-keyword">and</tt> <tt class="py-name">key</tt> <tt class="py-keyword">in</tt> <tt class="py-name">entity</tt><tt class="py-op">.</tt><tt class="py-name">keys</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L243"></a><tt class="py-lineno">243</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">entity</tt> </tt>
<a name="L244"></a><tt class="py-lineno">244</tt> <tt class="py-line"> </tt>
<a name="L245"></a><tt class="py-lineno">245</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">type</tt> <tt class="py-keyword">and</tt> <tt class="py-string">'type'</tt> <tt class="py-keyword">not</tt> <tt class="py-keyword">in</tt> <tt class="py-name">entity</tt><tt class="py-op">.</tt><tt class="py-name">keys</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L246"></a><tt class="py-lineno">246</tt> <tt class="py-line"> <tt class="py-name">entity</tt><tt class="py-op">[</tt><tt class="py-string">'type'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">key</tt> </tt>
<a name="L247"></a><tt class="py-lineno">247</tt> <tt class="py-line"> </tt>
<a name="L248"></a><tt class="py-lineno">248</tt> <tt class="py-line"> <tt class="py-name">entity</tt><tt class="py-op">[</tt><tt class="py-name">key</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-121" class="py-name" targets="Method screenlets.plugins.BaseConverter.BaseConverter.convert()=screenlets.plugins.BaseConverter.BaseConverter-class.html#convert,Method screenlets.plugins.Convert.Converter.convert()=screenlets.plugins.Convert.Converter-class.html#convert,Method screenlets.plugins.Convert.RatioConverter.convert()=screenlets.plugins.Convert.RatioConverter-class.html#convert,Method screenlets.plugins.TemperatureConverter.TemperatureConverter.convert()=screenlets.plugins.TemperatureConverter.TemperatureConverter-class.html#convert,Method screenlets.plugins.mpdclient2.response_fetcher.convert()=screenlets.plugins.mpdclient2.response_fetcher-class.html#convert"><a title="screenlets.plugins.BaseConverter.BaseConverter.convert
screenlets.plugins.Convert.Converter.convert
screenlets.plugins.Convert.RatioConverter.convert
screenlets.plugins.TemperatureConverter.TemperatureConverter.convert
screenlets.plugins.mpdclient2.response_fetcher.convert" class="py-name" href="#" onclick="return doclink('link-121', 'convert', 'link-121');">convert</a></tt><tt class="py-op">(</tt><tt class="py-name">entity</tt><tt class="py-op">[</tt><tt class="py-string">'type'</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">key</tt><tt class="py-op">,</tt> <tt class="py-name">val</tt><tt class="py-op">)</tt> </tt>
<a name="L249"></a><tt class="py-lineno">249</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">talker</tt><tt class="py-op">.</tt><tt class="py-name">current_line</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt> </tt>
<a name="L250"></a><tt class="py-lineno">250</tt> <tt class="py-line"> </tt>
<a name="L251"></a><tt class="py-lineno">251</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">entity</tt> </tt>
</div><a name="L252"></a><tt class="py-lineno">252</tt> <tt class="py-line"> </tt>
<a name="response_fetcher.all_objects"></a><div id="response_fetcher.all_objects-def"><a name="L253"></a><tt class="py-lineno">253</tt> <a class="py-toggle" href="#" id="response_fetcher.all_objects-toggle" onclick="return toggle('response_fetcher.all_objects');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.response_fetcher-class.html#all_objects">all_objects</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">keywords</tt><tt class="py-op">,</tt> <tt class="py-param">type</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="response_fetcher.all_objects-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="response_fetcher.all_objects-expanded"><a name="L254"></a><tt class="py-lineno">254</tt> <tt class="py-line"> <tt class="py-keyword">while</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L255"></a><tt class="py-lineno">255</tt> <tt class="py-line"> <tt class="py-name">obj</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-122" class="py-name"><a title="screenlets.plugins.mpdclient2.response_fetcher.one_object" class="py-name" href="#" onclick="return doclink('link-122', 'one_object', 'link-108');">one_object</a></tt><tt class="py-op">(</tt><tt class="py-name">keywords</tt><tt class="py-op">,</tt> <tt class="py-name">type</tt><tt class="py-op">)</tt> </tt>
<a name="L256"></a><tt class="py-lineno">256</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">obj</tt><tt class="py-op">:</tt> </tt>
<a name="L257"></a><tt class="py-lineno">257</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">StopIteration</tt> </tt>
<a name="L258"></a><tt class="py-lineno">258</tt> <tt class="py-line"> <tt class="py-keyword">yield</tt> <tt class="py-name">obj</tt> </tt>
<a name="L259"></a><tt class="py-lineno">259</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">talker</tt><tt class="py-op">.</tt><tt class="py-name">done</tt><tt class="py-op">:</tt> </tt>
<a name="L260"></a><tt class="py-lineno">260</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">StopIteration</tt> </tt>
</div><a name="L261"></a><tt class="py-lineno">261</tt> <tt class="py-line"> </tt>
<a name="response_fetcher.convert"></a><div id="response_fetcher.convert-def"><a name="L262"></a><tt class="py-lineno">262</tt> <a class="py-toggle" href="#" id="response_fetcher.convert-toggle" onclick="return toggle('response_fetcher.convert');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.response_fetcher-class.html#convert">convert</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">cmd</tt><tt class="py-op">,</tt> <tt class="py-param">key</tt><tt class="py-op">,</tt> <tt class="py-param">val</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="response_fetcher.convert-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="response_fetcher.convert-expanded"><a name="L263"></a><tt class="py-lineno">263</tt> <tt class="py-line"> <tt class="py-comment"># if there's a converter, convert it, otherwise return it the same</tt> </tt>
<a name="L264"></a><tt class="py-lineno">264</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">converters</tt><tt class="py-op">.</tt><tt id="link-123" class="py-name" targets="Method screenlets.plugins.keyring.KeyRing.Key.get()=screenlets.plugins.keyring.KeyRing.Key-class.html#get,Method screenlets.services.ScreenletService.get()=screenlets.services.ScreenletService-class.html#get"><a title="screenlets.plugins.keyring.KeyRing.Key.get
screenlets.services.ScreenletService.get" class="py-name" href="#" onclick="return doclink('link-123', 'get', 'link-123');">get</a></tt><tt class="py-op">(</tt><tt id="link-124" class="py-name"><a title="screenlets.plugins.Mplayer.Mplayer.cmd" class="py-name" href="#" onclick="return doclink('link-124', 'cmd', 'link-84');">cmd</a></tt><tt class="py-op">,</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-125" class="py-name"><a title="screenlets.plugins.keyring.KeyRing.Key.get
screenlets.services.ScreenletService.get" class="py-name" href="#" onclick="return doclink('link-125', 'get', 'link-123');">get</a></tt><tt class="py-op">(</tt><tt class="py-name">key</tt><tt class="py-op">,</tt> <tt class="py-keyword">lambda</tt> <tt id="link-126" class="py-name"><a title="screenlets.Notify.x
screenlets.Screenlet.x
screenlets.Tooltip.x" class="py-name" href="#" onclick="return doclink('link-126', 'x', 'link-112');">x</a></tt><tt class="py-op">:</tt> <tt id="link-127" class="py-name"><a title="screenlets.Notify.x
screenlets.Screenlet.x
screenlets.Tooltip.x" class="py-name" href="#" onclick="return doclink('link-127', 'x', 'link-112');">x</a></tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-name">val</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L265"></a><tt class="py-lineno">265</tt> <tt class="py-line"> </tt>
<a name="dictobj"></a><div id="dictobj-def"><a name="L266"></a><tt class="py-lineno">266</tt> <a class="py-toggle" href="#" id="dictobj-toggle" onclick="return toggle('dictobj');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.dictobj-class.html">dictobj</a><tt class="py-op">(</tt><tt class="py-base-class">dict</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="dictobj-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="dictobj-expanded"><a name="dictobj.__getattr__"></a><div id="dictobj.__getattr__-def"><a name="L267"></a><tt class="py-lineno">267</tt> <a class="py-toggle" href="#" id="dictobj.__getattr__-toggle" onclick="return toggle('dictobj.__getattr__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.dictobj-class.html#__getattr__">__getattr__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">attr</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="dictobj.__getattr__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="dictobj.__getattr__-expanded"><a name="L268"></a><tt class="py-lineno">268</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L269"></a><tt class="py-lineno">269</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">[</tt><tt class="py-name">attr</tt><tt class="py-op">]</tt> </tt>
<a name="L270"></a><tt class="py-lineno">270</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">KeyError</tt><tt class="py-op">:</tt> </tt>
<a name="L271"></a><tt class="py-lineno">271</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">AttributeError</tt> </tt>
</div><a name="dictobj.__repr__"></a><div id="dictobj.__repr__-def"><a name="L272"></a><tt class="py-lineno">272</tt> <a class="py-toggle" href="#" id="dictobj.__repr__-toggle" onclick="return toggle('dictobj.__repr__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.dictobj-class.html#__repr__">__repr__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="dictobj.__repr__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="dictobj.__repr__-expanded"><a name="L273"></a><tt class="py-lineno">273</tt> <tt class="py-line"> <tt class="py-comment"># <mpdclient2.dictobj at 0x12345678 ..</tt> </tt>
<a name="L274"></a><tt class="py-lineno">274</tt> <tt class="py-line"> <tt class="py-comment"># {</tt> </tt>
<a name="L275"></a><tt class="py-lineno">275</tt> <tt class="py-line"> <tt class="py-comment"># key: val,</tt> </tt>
<a name="L276"></a><tt class="py-lineno">276</tt> <tt class="py-line"> <tt class="py-comment"># key2: val2</tt> </tt>
<a name="L277"></a><tt class="py-lineno">277</tt> <tt class="py-line"> <tt class="py-comment"># }></tt> </tt>
<a name="L278"></a><tt class="py-lineno">278</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt class="py-name">object</tt><tt class="py-op">.</tt><tt id="link-128" class="py-name" targets="Method screenlets.plugins.mpdclient2.dictobj.__repr__()=screenlets.plugins.mpdclient2.dictobj-class.html#__repr__"><a title="screenlets.plugins.mpdclient2.dictobj.__repr__" class="py-name" href="#" onclick="return doclink('link-128', '__repr__', 'link-128');">__repr__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">rstrip</tt><tt class="py-op">(</tt><tt class="py-string">'>'</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-string">' ..\n'</tt> <tt class="py-op">+</tt> </tt>
<a name="L279"></a><tt class="py-lineno">279</tt> <tt class="py-line"> <tt class="py-string">' {\n '</tt> <tt class="py-op">+</tt> </tt>
<a name="L280"></a><tt class="py-lineno">280</tt> <tt class="py-line"> <tt class="py-string">',\n '</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-op">[</tt> <tt class="py-string">'%s: %s'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">k</tt><tt class="py-op">,</tt> <tt class="py-name">v</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">k</tt><tt class="py-op">,</tt> <tt class="py-name">v</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">items</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">]</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> </tt>
<a name="L281"></a><tt class="py-lineno">281</tt> <tt class="py-line"> <tt class="py-string">'\n }>'</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L282"></a><tt class="py-lineno">282</tt> <tt class="py-line"> </tt>
<a name="mpd_connection"></a><div id="mpd_connection-def"><a name="L283"></a><tt class="py-lineno">283</tt> <a class="py-toggle" href="#" id="mpd_connection-toggle" onclick="return toggle('mpd_connection');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.mpd_connection-class.html">mpd_connection</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="mpd_connection-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="mpd_connection-expanded"><a name="mpd_connection.__init__"></a><div id="mpd_connection.__init__-def"><a name="L284"></a><tt class="py-lineno">284</tt> <a class="py-toggle" href="#" id="mpd_connection.__init__-toggle" onclick="return toggle('mpd_connection.__init__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.mpd_connection-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">host</tt><tt class="py-op">,</tt> <tt class="py-param">port</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="mpd_connection.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="mpd_connection.__init__-expanded"><a name="L285"></a><tt class="py-lineno">285</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">talker</tt> <tt class="py-op">=</tt> <tt id="link-129" class="py-name" targets="Class screenlets.plugins.mpdclient2.socket_talker=screenlets.plugins.mpdclient2.socket_talker-class.html"><a title="screenlets.plugins.mpdclient2.socket_talker" class="py-name" href="#" onclick="return doclink('link-129', 'socket_talker', 'link-129');">socket_talker</a></tt><tt class="py-op">(</tt><tt id="link-130" class="py-name"><a title="screenlets.plugins.Sonata.SonataAPI.host" class="py-name" href="#" onclick="return doclink('link-130', 'host', 'link-0');">host</a></tt><tt class="py-op">,</tt> <tt id="link-131" class="py-name"><a title="screenlets.plugins.Sonata.SonataAPI.port" class="py-name" href="#" onclick="return doclink('link-131', 'port', 'link-2');">port</a></tt><tt class="py-op">)</tt> </tt>
<a name="L286"></a><tt class="py-lineno">286</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">send</tt> <tt class="py-op">=</tt> <tt id="link-132" class="py-name" targets="Class screenlets.plugins.mpdclient2.command_sender=screenlets.plugins.mpdclient2.command_sender-class.html"><a title="screenlets.plugins.mpdclient2.command_sender" class="py-name" href="#" onclick="return doclink('link-132', 'command_sender', 'link-132');">command_sender</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">talker</tt><tt class="py-op">)</tt> </tt>
<a name="L287"></a><tt class="py-lineno">287</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">fetch</tt> <tt class="py-op">=</tt> <tt id="link-133" class="py-name" targets="Class screenlets.plugins.mpdclient2.response_fetcher=screenlets.plugins.mpdclient2.response_fetcher-class.html"><a title="screenlets.plugins.mpdclient2.response_fetcher" class="py-name" href="#" onclick="return doclink('link-133', 'response_fetcher', 'link-133');">response_fetcher</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">talker</tt><tt class="py-op">)</tt> </tt>
<a name="L288"></a><tt class="py-lineno">288</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">do</tt> <tt class="py-op">=</tt> <tt id="link-134" class="py-name" targets="Class screenlets.plugins.mpdclient2.sender_n_fetcher=screenlets.plugins.mpdclient2.sender_n_fetcher-class.html"><a title="screenlets.plugins.mpdclient2.sender_n_fetcher" class="py-name" href="#" onclick="return doclink('link-134', 'sender_n_fetcher', 'link-134');">sender_n_fetcher</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">send</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">fetch</tt><tt class="py-op">)</tt> </tt>
<a name="L289"></a><tt class="py-lineno">289</tt> <tt class="py-line"> </tt>
<a name="L290"></a><tt class="py-lineno">290</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-135" class="py-name" targets="Method screenlets.plugins.mpdclient2.mpd_connection._hello()=screenlets.plugins.mpdclient2.mpd_connection-class.html#_hello"><a title="screenlets.plugins.mpdclient2.mpd_connection._hello" class="py-name" href="#" onclick="return doclink('link-135', '_hello', 'link-135');">_hello</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L291"></a><tt class="py-lineno">291</tt> <tt class="py-line"> </tt>
<a name="mpd_connection._hello"></a><div id="mpd_connection._hello-def"><a name="L292"></a><tt class="py-lineno">292</tt> <a class="py-toggle" href="#" id="mpd_connection._hello-toggle" onclick="return toggle('mpd_connection._hello');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.mpd_connection-class.html#_hello">_hello</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="mpd_connection._hello-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="mpd_connection._hello-expanded"><a name="L293"></a><tt class="py-lineno">293</tt> <tt class="py-line"> <tt class="py-name">line</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">talker</tt><tt class="py-op">.</tt><tt id="link-136" class="py-name"><a title="screenlets.plugins.mpdclient2.socket_talker.get_line" class="py-name" href="#" onclick="return doclink('link-136', 'get_line', 'link-8');">get_line</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L294"></a><tt class="py-lineno">294</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">line</tt><tt class="py-op">.</tt><tt class="py-name">startswith</tt><tt class="py-op">(</tt><tt class="py-string">"OK MPD "</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L295"></a><tt class="py-lineno">295</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">RuntimeError</tt><tt class="py-op">(</tt><tt class="py-string">"this ain't mpd"</tt><tt class="py-op">)</tt> </tt>
<a name="L296"></a><tt class="py-lineno">296</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">mpd_version</tt> <tt class="py-op">=</tt> <tt class="py-name">line</tt><tt class="py-op">[</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-string">"OK MPD "</tt><tt class="py-op">)</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">strip</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L297"></a><tt class="py-lineno">297</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">talker</tt><tt class="py-op">.</tt><tt class="py-name">current_line</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt> </tt>
</div><a name="L298"></a><tt class="py-lineno">298</tt> <tt class="py-line"> </tt>
<a name="L299"></a><tt class="py-lineno">299</tt> <tt class="py-line"> <tt class="py-comment"># conn.foo() is equivalent to conn.do.foo(), but nicer</tt> </tt>
<a name="mpd_connection.__getattr__"></a><div id="mpd_connection.__getattr__-def"><a name="L300"></a><tt class="py-lineno">300</tt> <a class="py-toggle" href="#" id="mpd_connection.__getattr__-toggle" onclick="return toggle('mpd_connection.__getattr__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2.mpd_connection-class.html#__getattr__">__getattr__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">attr</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="mpd_connection.__getattr__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="mpd_connection.__getattr__-expanded"><a name="L301"></a><tt class="py-lineno">301</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt id="link-137" class="py-name" targets="Function screenlets.plugins.mpdclient2.is_command()=screenlets.plugins.mpdclient2-module.html#is_command"><a title="screenlets.plugins.mpdclient2.is_command" class="py-name" href="#" onclick="return doclink('link-137', 'is_command', 'link-137');">is_command</a></tt><tt class="py-op">(</tt><tt class="py-name">attr</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L302"></a><tt class="py-lineno">302</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">do</tt><tt class="py-op">,</tt> <tt class="py-name">attr</tt><tt class="py-op">)</tt> </tt>
<a name="L303"></a><tt class="py-lineno">303</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">AttributeError</tt><tt class="py-op">(</tt><tt class="py-name">attr</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L304"></a><tt class="py-lineno">304</tt> <tt class="py-line"> </tt>
<a name="parse_host"></a><div id="parse_host-def"><a name="L305"></a><tt class="py-lineno">305</tt> <a class="py-toggle" href="#" id="parse_host-toggle" onclick="return toggle('parse_host');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2-module.html#parse_host">parse_host</a><tt class="py-op">(</tt><tt class="py-param">host</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="parse_host-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="parse_host-expanded"><a name="L306"></a><tt class="py-lineno">306</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-string">'@'</tt> <tt class="py-keyword">in</tt> <tt id="link-138" class="py-name"><a title="screenlets.plugins.Sonata.SonataAPI.host" class="py-name" href="#" onclick="return doclink('link-138', 'host', 'link-0');">host</a></tt><tt class="py-op">:</tt> </tt>
<a name="L307"></a><tt class="py-lineno">307</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt id="link-139" class="py-name"><a title="screenlets.plugins.Sonata.SonataAPI.host" class="py-name" href="#" onclick="return doclink('link-139', 'host', 'link-0');">host</a></tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'@'</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L308"></a><tt class="py-lineno">308</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt id="link-140" class="py-name"><a title="screenlets.plugins.Sonata.SonataAPI.host" class="py-name" href="#" onclick="return doclink('link-140', 'host', 'link-0');">host</a></tt> </tt>
</div><a name="L309"></a><tt class="py-lineno">309</tt> <tt class="py-line"> </tt>
<a name="connect"></a><div id="connect-def"><a name="L310"></a><tt class="py-lineno">310</tt> <a class="py-toggle" href="#" id="connect-toggle" onclick="return toggle('connect');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="screenlets.plugins.mpdclient2-module.html#connect">connect</a><tt class="py-op">(</tt><tt class="py-op">**</tt><tt class="py-param">kw</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="connect-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="connect-expanded"><a name="L311"></a><tt class="py-lineno">311</tt> <tt class="py-line"> <tt class="py-keyword">import</tt> <tt class="py-name">os</tt> </tt>
<a name="L312"></a><tt class="py-lineno">312</tt> <tt class="py-line"> </tt>
<a name="L313"></a><tt class="py-lineno">313</tt> <tt class="py-line"> <tt id="link-141" class="py-name"><a title="screenlets.plugins.Sonata.SonataAPI.port" class="py-name" href="#" onclick="return doclink('link-141', 'port', 'link-2');">port</a></tt> <tt class="py-op">=</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">environ</tt><tt class="py-op">.</tt><tt id="link-142" class="py-name"><a title="screenlets.plugins.keyring.KeyRing.Key.get
screenlets.services.ScreenletService.get" class="py-name" href="#" onclick="return doclink('link-142', 'get', 'link-123');">get</a></tt><tt class="py-op">(</tt><tt class="py-string">'MPD_PORT'</tt><tt class="py-op">,</tt> <tt class="py-number">6600</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L314"></a><tt class="py-lineno">314</tt> <tt class="py-line"> <tt id="link-143" class="py-name" targets="Variable screenlets.options.string_option.StringOption.password=screenlets.options.string_option.StringOption-class.html#password,Variable screenlets.plugins.keyring.KeyRing.Key.password=screenlets.plugins.keyring.KeyRing.Key-class.html#password"><a title="screenlets.options.string_option.StringOption.password
screenlets.plugins.keyring.KeyRing.Key.password" class="py-name" href="#" onclick="return doclink('link-143', 'password', 'link-143');">password</a></tt><tt class="py-op">,</tt> <tt id="link-144" class="py-name"><a title="screenlets.plugins.Sonata.SonataAPI.host" class="py-name" href="#" onclick="return doclink('link-144', 'host', 'link-0');">host</a></tt> <tt class="py-op">=</tt> <tt id="link-145" class="py-name" targets="Function screenlets.plugins.mpdclient2.parse_host()=screenlets.plugins.mpdclient2-module.html#parse_host"><a title="screenlets.plugins.mpdclient2.parse_host" class="py-name" href="#" onclick="return doclink('link-145', 'parse_host', 'link-145');">parse_host</a></tt><tt class="py-op">(</tt><tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">environ</tt><tt class="py-op">.</tt><tt id="link-146" class="py-name"><a title="screenlets.plugins.keyring.KeyRing.Key.get
screenlets.services.ScreenletService.get" class="py-name" href="#" onclick="return doclink('link-146', 'get', 'link-123');">get</a></tt><tt class="py-op">(</tt><tt class="py-string">'MPD_HOST'</tt><tt class="py-op">,</tt> <tt class="py-string">'localhost'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L315"></a><tt class="py-lineno">315</tt> <tt class="py-line"> </tt>
<a name="L316"></a><tt class="py-lineno">316</tt> <tt class="py-line"> <tt class="py-name">kw_port</tt> <tt class="py-op">=</tt> <tt class="py-name">kw</tt><tt class="py-op">.</tt><tt id="link-147" class="py-name"><a title="screenlets.plugins.keyring.KeyRing.Key.get
screenlets.services.ScreenletService.get" class="py-name" href="#" onclick="return doclink('link-147', 'get', 'link-123');">get</a></tt><tt class="py-op">(</tt><tt class="py-string">'port'</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L317"></a><tt class="py-lineno">317</tt> <tt class="py-line"> <tt class="py-name">kw_password</tt> <tt class="py-op">=</tt> <tt class="py-name">kw</tt><tt class="py-op">.</tt><tt id="link-148" class="py-name"><a title="screenlets.plugins.keyring.KeyRing.Key.get
screenlets.services.ScreenletService.get" class="py-name" href="#" onclick="return doclink('link-148', 'get', 'link-123');">get</a></tt><tt class="py-op">(</tt><tt class="py-string">'password'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt> </tt>
<a name="L318"></a><tt class="py-lineno">318</tt> <tt class="py-line"> <tt class="py-name">kw_host</tt> <tt class="py-op">=</tt> <tt class="py-name">kw</tt><tt class="py-op">.</tt><tt id="link-149" class="py-name"><a title="screenlets.plugins.keyring.KeyRing.Key.get
screenlets.services.ScreenletService.get" class="py-name" href="#" onclick="return doclink('link-149', 'get', 'link-123');">get</a></tt><tt class="py-op">(</tt><tt class="py-string">'host'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt> </tt>
<a name="L319"></a><tt class="py-lineno">319</tt> <tt class="py-line"> </tt>
<a name="L320"></a><tt class="py-lineno">320</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">kw_port</tt><tt class="py-op">:</tt> </tt>
<a name="L321"></a><tt class="py-lineno">321</tt> <tt class="py-line"> <tt id="link-150" class="py-name"><a title="screenlets.plugins.Sonata.SonataAPI.port" class="py-name" href="#" onclick="return doclink('link-150', 'port', 'link-2');">port</a></tt> <tt class="py-op">=</tt> <tt class="py-name">kw_port</tt> </tt>
<a name="L322"></a><tt class="py-lineno">322</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">kw_password</tt><tt class="py-op">:</tt> </tt>
<a name="L323"></a><tt class="py-lineno">323</tt> <tt class="py-line"> <tt id="link-151" class="py-name"><a title="screenlets.options.string_option.StringOption.password
screenlets.plugins.keyring.KeyRing.Key.password" class="py-name" href="#" onclick="return doclink('link-151', 'password', 'link-143');">password</a></tt> <tt class="py-op">=</tt> <tt class="py-name">kw_password</tt> </tt>
<a name="L324"></a><tt class="py-lineno">324</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">kw_host</tt><tt class="py-op">:</tt> </tt>
<a name="L325"></a><tt class="py-lineno">325</tt> <tt class="py-line"> <tt id="link-152" class="py-name"><a title="screenlets.plugins.Sonata.SonataAPI.host" class="py-name" href="#" onclick="return doclink('link-152', 'host', 'link-0');">host</a></tt> <tt class="py-op">=</tt> <tt class="py-name">kw_host</tt> </tt>
<a name="L326"></a><tt class="py-lineno">326</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L327"></a><tt class="py-lineno">327</tt> <tt class="py-line"> <tt class="py-name">conn</tt> <tt class="py-op">=</tt> <tt id="link-153" class="py-name" targets="Class screenlets.plugins.mpdclient2.mpd_connection=screenlets.plugins.mpdclient2.mpd_connection-class.html"><a title="screenlets.plugins.mpdclient2.mpd_connection" class="py-name" href="#" onclick="return doclink('link-153', 'mpd_connection', 'link-153');">mpd_connection</a></tt><tt class="py-op">(</tt><tt id="link-154" class="py-name"><a title="screenlets.plugins.Sonata.SonataAPI.host" class="py-name" href="#" onclick="return doclink('link-154', 'host', 'link-0');">host</a></tt><tt class="py-op">,</tt> <tt id="link-155" class="py-name"><a title="screenlets.plugins.Sonata.SonataAPI.port" class="py-name" href="#" onclick="return doclink('link-155', 'port', 'link-2');">port</a></tt><tt class="py-op">)</tt> </tt>
<a name="L328"></a><tt class="py-lineno">328</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt id="link-156" class="py-name"><a title="screenlets.options.string_option.StringOption.password
screenlets.plugins.keyring.KeyRing.Key.password" class="py-name" href="#" onclick="return doclink('link-156', 'password', 'link-143');">password</a></tt><tt class="py-op">:</tt> </tt>
<a name="L329"></a><tt class="py-lineno">329</tt> <tt class="py-line"> <tt class="py-name">conn</tt><tt class="py-op">.</tt><tt id="link-157" class="py-name"><a title="screenlets.options.string_option.StringOption.password
screenlets.plugins.keyring.KeyRing.Key.password" class="py-name" href="#" onclick="return doclink('link-157', 'password', 'link-143');">password</a></tt><tt class="py-op">(</tt><tt id="link-158" class="py-name"><a title="screenlets.options.string_option.StringOption.password
screenlets.plugins.keyring.KeyRing.Key.password" class="py-name" href="#" onclick="return doclink('link-158', 'password', 'link-143');">password</a></tt><tt class="py-op">)</tt> </tt>
<a name="L330"></a><tt class="py-lineno">330</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">conn</tt> </tt>
<a name="L331"></a><tt class="py-lineno">331</tt> <tt class="py-line"> <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
<a name="L332"></a><tt class="py-lineno">332</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">False</tt> </tt>
</div><a name="L333"></a><tt class="py-lineno">333</tt> <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th> <a
href="screenlets-module.html">Home</a> </th>
<!-- Tree link -->
<th> <a
href="module-tree.html">Trees</a> </th>
<!-- Index link -->
<th> <a
href="identifier-index.html">Indices</a> </th>
<!-- Help link -->
<th> <a
href="help.html">Help</a> </th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
>Screenlets 0.1.6</th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Wed Jan 4 16:58:25 2012
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
>http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>
|