-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitunes_dummy.py
executable file
·62 lines (48 loc) · 1.12 KB
/
itunes_dummy.py
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import Pyro4
class itunes(object):
def __init__(self):
self._vol = 50
self._status = 'paused'
def play_playlist(self,name):
pass
@Pyro4.expose
@property
def status(self):
return self._status
@Pyro4.expose
@property
def current_track(self):
return 'track'
@Pyro4.expose
@property
def current_artist(self):
return 'artist'
@Pyro4.expose
@property
def current_album(self):
return 'album'
@Pyro4.expose
@property
def volume(self):
return self._vol
@Pyro4.expose
@volume.setter
def volume(self, level):
self._vol = level
def pause(self):
self._status = 'paused'
def play(self):
self._status = 'playing'
def next(self):
pass
def previous(self):
pass
daemon = Pyro4.Daemon(host='muffin')
ns = Pyro4.locateNS()
uri = daemon.register(itunes())
ns.register("itunes", uri)
print("server object uri:", uri)
print("attributes server running.")
daemon.requestLoop()