Changeset 6632 for lang/python/otolog4linux/trunk
- Timestamp:
- 02/13/08 17:30:57 (10 months ago)
- Location:
- lang/python/otolog4linux/trunk
- Files:
-
- 19 modified
-
PKG-INFO (modified) (1 diff)
-
data/otolog4linux_install.py (modified) (1 diff)
-
data/otolog4linux_win32.pyw (modified) (1 diff)
-
data/plugins/jacket_amazon.py (modified) (1 diff)
-
data/plugins/jacket_otolog.py (modified) (1 diff)
-
data/plugins/jacket_playlog.py (modified) (1 diff)
-
data/plugins/player_amarok.py (modified) (2 diffs)
-
data/plugins/player_itunes.py (modified) (2 diffs)
-
data/plugins/player_kscd.py (modified) (2 diffs)
-
data/plugins/player_mpc.py (modified) (2 diffs)
-
data/plugins/player_rhythmbox.py (modified) (2 diffs)
-
data/plugins/player_xmms.py (modified) (2 diffs)
-
data/plugins/server_otolog.py (modified) (1 diff)
-
data/plugins/server_playlog.py (modified) (1 diff)
-
otolog4linux (modified) (1 diff)
-
setup.py (modified) (1 diff)
-
src/controller.py (modified) (3 diffs)
-
src/plugin.py (modified) (1 diff)
-
src/server.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/python/otolog4linux/trunk/PKG-INFO
r2266 r6632 1 1 Metadata-Version: 1.0 2 2 Name: otolog4linux 3 Version: 0.0 43 Version: 0.05 4 4 Summary: otolog controller for linux 5 Home-page: http:// www.ac.cyberhome.ne.jp/~mattn/5 Home-page: http://mattn.kaoriya.net/ 6 6 Author: Yasuhiro Matsumoto 7 7 Author-email: mattn.jp@gmail.com -
lang/python/otolog4linux/trunk/data/otolog4linux_install.py
r2266 r6632 3 3 import os, sys 4 4 if sys.platform == "win32": 5 target=os.path.join(sys.exec_prefix, "share", "otolog4linux", "otolog4linux_win32.pyw")6 description="�����O for Linux"7 shortcut=os.path.join(get_special_folder_path("CSIDL_DESKTOPDIRECTORY"), "otolog4linux.lnk")8 iconpath=os.path.join(sys.exec_prefix, "share", "icons", "otolog4linux.wic")9 workdir=sys.exec_prefix10 create_shortcut(target,description,shortcut,"",workdir,iconpath,0)11 print "Install complete"5 target=os.path.join(sys.exec_prefix, "share", "otolog4linux", "otolog4linux_win32.pyw") 6 description="�����O for Linux" 7 shortcut=os.path.join(get_special_folder_path("CSIDL_DESKTOPDIRECTORY"), "otolog4linux.lnk") 8 iconpath=os.path.join(sys.exec_prefix, "share", "icons", "otolog4linux.wic") 9 workdir=sys.exec_prefix 10 create_shortcut(target,description,shortcut,"",workdir,iconpath,0) 11 print "Install complete" -
lang/python/otolog4linux/trunk/data/otolog4linux_win32.pyw
r2266 r6632 4 4 5 5 try: 6 import otolog4linux6 import otolog4linux 7 7 except: 8 import src9 sys.modules['otolog4linux'] = src10 import src.__init__ as otolog4linux8 import src 9 sys.modules['otolog4linux'] = src 10 import src.__init__ as otolog4linux 11 11 12 12 def usage(): 13 print '%s : %s' % (otolog4linux.app_name, otolog4linux.app_title)14 print ' version %s' % otolog4linux.app_version15 sys.exit(2)13 print '%s : %s' % (otolog4linux.app_name, otolog4linux.app_title) 14 print ' version %s' % otolog4linux.app_version 15 sys.exit(2) 16 16 17 17 player = None 18 18 try: 19 opts, args = getopt.getopt(sys.argv[1:], 'hp:v', ['help', 'player='])19 opts, args = getopt.getopt(sys.argv[1:], 'hp:v', ['help', 'player=']) 20 20 except getopt.GetoptError: 21 usage()21 usage() 22 22 23 23 for arg, val in opts: 24 if arg == '--help':25 usage()26 if arg in ('-p', '--player'):27 player = val24 if arg == '--help': 25 usage() 26 if arg in ('-p', '--player'): 27 player = val 28 28 29 29 try: 30 otocon = otolog4linux.getInstance()31 otocon.load_settings()32 if player:33 otocon.settings['player'] = player34 otocon.main()30 otocon = otolog4linux.getInstance() 31 otocon.load_settings() 32 if player: 33 otocon.settings['player'] = player 34 otocon.main() 35 35 except Exception, e: 36 print(e)36 print(e) -
lang/python/otolog4linux/trunk/data/plugins/jacket_amazon.py
r2266 r6632 7 7 8 8 def get_capability(): 9 return ['jacket']9 return ['jacket'] 10 10 11 11 def get_name(): 12 return 'アマゾン'12 return 'アマゾン' 13 13 14 14 def get_settings(): 15 return [16 ('Amazon ID', 'amazon_id'),17 ('Amazon Key', 'amazon_key'),18 ]15 return [ 16 ('Amazon ID', 'amazon_id'), 17 ('Amazon Key', 'amazon_key'), 18 ] 19 19 20 20 def get_jacket(settings, player_info): 21 wsdl = 'http://soap.amazon.com/schemas3/AmazonWebServices.wsdl'22 proxy = SOAPpy.WSDL.Proxy(wsdl)21 wsdl = 'http://soap.amazon.com/schemas3/AmazonWebServices.wsdl' 22 proxy = SOAPpy.WSDL.Proxy(wsdl) 23 23 24 _query = "%s %s" % (player_info['artist'], player_info['album'])25 while True:26 pos1 = _query.find("(")27 pos2 = _query.find(")")28 if pos1 > 0 and pos1 < pos2:29 if pos2 < len(_query)-1:30 _query = _query[:pos1-1] + _query[pos2:]31 else:32 _query = _query[:pos1-1]33 else:34 break24 _query = "%s %s" % (player_info['artist'], player_info['album']) 25 while True: 26 pos1 = _query.find("(") 27 pos2 = _query.find(")") 28 if pos1 > 0 and pos1 < pos2: 29 if pos2 < len(_query)-1: 30 _query = _query[:pos1-1] + _query[pos2:] 31 else: 32 _query = _query[:pos1-1] 33 else: 34 break 35 35 36 #print _query37 request = { 'keyword': _query,38 'page': '1',39 'mode': 'music-jp',40 'tag': settings['amazon_id'],41 'type': 'lite',42 'locale': 'jp',43 'devtag': settings['amazon_key'] }44 results = proxy.KeywordSearchRequest(request)45 if (results.TotalResults > 0):46 details = results.Details[0]47 player_info['asin'] = details['Asin']48 for key in details._keys():49 if key == 'ImageUrlMedium':50 return details[key]51 elif key == 'ImageUrlLarge':52 return details[key]53 elif key == 'ImageUrlSmall':54 return details[key]55 return None36 #print _query 37 request = { 'keyword': _query, 38 'page': '1', 39 'mode': 'music-jp', 40 'tag': settings['amazon_id'], 41 'type': 'lite', 42 'locale': 'jp', 43 'devtag': settings['amazon_key'] } 44 results = proxy.KeywordSearchRequest(request) 45 if (results.TotalResults > 0): 46 details = results.Details[0] 47 player_info['asin'] = details['Asin'] 48 for key in details._keys(): 49 if key == 'ImageUrlMedium': 50 return details[key] 51 elif key == 'ImageUrlLarge': 52 return details[key] 53 elif key == 'ImageUrlSmall': 54 return details[key] 55 return None -
lang/python/otolog4linux/trunk/data/plugins/jacket_otolog.py
r2266 r6632 5 5 6 6 def get_capability(): 7 return ['jacket']7 return ['jacket'] 8 8 9 9 def get_name(): 10 return '音ログ'10 return '音ログ' 11 11 12 12 def get_jacket(settings, player_info): 13 return 'http://jacketimg.otolog.jp/%s' % settings["userid"]13 return 'http://jacketimg.otolog.jp/%s' % settings["userid"] -
lang/python/otolog4linux/trunk/data/plugins/jacket_playlog.py
r2266 r6632 5 5 6 6 def get_capability(): 7 return ['jacket']7 return ['jacket'] 8 8 9 9 def get_name(): 10 return 'プレイログ'10 return 'プレイログ' 11 11 12 12 def get_jacket(settings, player_info): 13 return 'http://playlog.jp/_images/blog/D/e/Development/m_2467.jpg'13 return 'http://playlog.jp/_images/blog/D/e/Development/m_2467.jpg' -
lang/python/otolog4linux/trunk/data/plugins/player_amarok.py
r2266 r6632 8 8 9 9 def get_capability(): 10 return ['player']10 return ['player'] 11 11 12 12 def get_name(): 13 return 'AmaroK'13 return 'AmaroK' 14 14 15 15 # should be return supported version. … … 17 17 18 18 def play(): 19 file = os.popen('dcop amarok player play')20 res = file.readline()[:-1]21 file.close()22 print res19 file = os.popen('dcop amarok player play') 20 res = file.readline()[:-1] 21 file.close() 22 print res 23 23 24 24 def stop(): 25 file = os.popen('dcop amarok player stop')26 res = file.readline()[:-1]27 file.close()28 print res25 file = os.popen('dcop amarok player stop') 26 res = file.readline()[:-1] 27 file.close() 28 print res 29 29 30 30 def pause(): 31 file = os.popen('dcop amarok player pause')32 res = file.readline()[:-1]33 file.close()34 print res31 file = os.popen('dcop amarok player pause') 32 res = file.readline()[:-1] 33 file.close() 34 print res 35 35 36 36 def next(): 37 file = os.popen('dcop amarok player next')38 res = file.readline()[:-1]39 file.close()40 print res37 file = os.popen('dcop amarok player next') 38 res = file.readline()[:-1] 39 file.close() 40 print res 41 41 42 42 def prev(): 43 file = os.popen('dcop amarok player prev')44 res = file.readline()[:-1]45 file.close()46 print res43 file = os.popen('dcop amarok player prev') 44 res = file.readline()[:-1] 45 file.close() 46 print res 47 47 48 48 def get_info(settings): 49 info = {}50 try:51 # Check amarok is working52 file = os.popen('dcop amarok player status 2> /dev/null')53 amarok_check = file.readline()54 file.close()55 if len(amarok_check):56 amarok_check = string.atoi(amarok_check[:-1])57 else:58 amarok_check = 059 if amarok_check == 256 or amarok_check == 0:60 return None61 file = os.popen('dcop amarok player album')62 info['album'] = file.readline()[:-1]63 file.close()64 file = os.popen('dcop amarok player artist')65 info['artist'] = file.readline()[:-1]66 file.close()67 file = os.popen('dcop amarok player title')68 info['track'] = file.readline()[:-1]69 file.close()70 file = os.popen('dcop amarok player trackTotalTime')71 info['duration'] = int(file.readline()[:-1])72 file.close()73 if amarok_check == 2:74 info['status'] = True75 else:76 info['status'] = False77 except Exception, e:78 print(e)79 return info49 info = {} 50 try: 51 # Check amarok is working 52 file = os.popen('dcop amarok player status 2> /dev/null') 53 amarok_check = file.readline() 54 file.close() 55 if len(amarok_check): 56 amarok_check = string.atoi(amarok_check[:-1]) 57 else: 58 amarok_check = 0 59 if amarok_check == 256 or amarok_check == 0: 60 return None 61 file = os.popen('dcop amarok player album') 62 info['album'] = file.readline()[:-1] 63 file.close() 64 file = os.popen('dcop amarok player artist') 65 info['artist'] = file.readline()[:-1] 66 file.close() 67 file = os.popen('dcop amarok player title') 68 info['track'] = file.readline()[:-1] 69 file.close() 70 file = os.popen('dcop amarok player trackTotalTime') 71 info['duration'] = int(file.readline()[:-1]) 72 file.close() 73 if amarok_check == 2: 74 info['status'] = True 75 else: 76 info['status'] = False 77 except Exception, e: 78 print(e) 79 return info 80 80 -
lang/python/otolog4linux/trunk/data/plugins/player_itunes.py
r2266 r6632 8 8 9 9 def get_capability(): 10 return ['player']10 return ['player'] 11 11 12 12 def get_name(): 13 return 'iTunes'13 return 'iTunes' 14 14 15 15 # should be return supported version. … … 17 17 18 18 def get_info(settings): 19 info = {}20 pythoncom.CoInitialize()21 try:22 iTunes = win32com.client.gencache.EnsureDispatch("iTunes.Application")23 if not iTunes:24 return {}25 Track = iTunes.CurrentTrack26 if not Track:27 return False28 info['artist'] = Track.Artist29 info['album'] = Track.Album30 info['track'] = Track.Name31 info['duration'] = Track.Duration32 if iTunes.PlayerState == 1:33 info['status'] = True34 else:35 info['status'] = False36 except Exception, e:37 print(e)38 pythoncom.CoUninitialize()39 return info19 info = {} 20 pythoncom.CoInitialize() 21 try: 22 iTunes = win32com.client.gencache.EnsureDispatch("iTunes.Application") 23 if not iTunes: 24 return {} 25 Track = iTunes.CurrentTrack 26 if not Track: 27 return False 28 info['artist'] = Track.Artist 29 info['album'] = Track.Album 30 info['track'] = Track.Name 31 info['duration'] = Track.Duration 32 if iTunes.PlayerState == 1: 33 info['status'] = True 34 else: 35 info['status'] = False 36 except Exception, e: 37 print(e) 38 pythoncom.CoUninitialize() 39 return info 40 40 -
lang/python/otolog4linux/trunk/data/plugins/player_kscd.py
r2266 r6632 8 8 9 9 def get_capability(): 10 return ['player']10 return ['player'] 11 11 12 12 def get_name(): 13 return 'KsCD'13 return 'KsCD' 14 14 15 15 # should be return supported version. … … 17 17 18 18 def play(): 19 file = os.popen('dcop kscd CDPlayer play')20 res = file.readline()[:-1]21 file.close()22 print res19 file = os.popen('dcop kscd CDPlayer play') 20 res = file.readline()[:-1] 21 file.close() 22 print res 23 23 24 24 def stop(): 25 file = os.popen('dcop kscd CDPlayer stop')26 res = file.readline()[:-1]27 file.close()28 print res25 file = os.popen('dcop kscd CDPlayer stop') 26 res = file.readline()[:-1] 27 file.close() 28 print res 29 29 30 30 def pause(): 31 sys.stderr.write('not implement!\n')31 sys.stderr.write('not implement!\n') 32 32 33 33 def next(): 34 file = os.popen('dcop kscd CDPlayer next')35 res = file.readline()[:-1]36 file.close()37 print res34 file = os.popen('dcop kscd CDPlayer next') 35 res = file.readline()[:-1] 36 file.close() 37 print res 38 38 39 39 def prev(): 40 file = os.popen('dcop kscd CDPlayer previous')41 res = file.readline()[:-1]42 file.close()43 print res40 file = os.popen('dcop kscd CDPlayer previous') 41 res = file.readline()[:-1] 42 file.close() 43 print res 44 44 45 45 def get_info(settings): 46 info = {}47 try:48 # Check kscd is working49 file = os.popen('dcop kscd CDPlayer getStatus 2> /dev/null')50 kscd_check = file.readline()51 file.close()52 if len(kscd_check):53 kscd_check = string.atoi(kscd_check[:-1])54 else:55 kscd_check = 056 if kscd_check != 2 and kscd_check != 4:57 return None58 file = os.popen('dcop kscd CDPlayer currentAlbum')59 info['album'] = file.readline()[:-1]60 file.close()61 file = os.popen('dcop kscd CDPlayer currentArtist')62 info['artist'] = file.readline()[:-1]63 file.close()64 file = os.popen('dcop kscd CDPlayer currentTrackTitle')65 info['track'] = file.readline()[:-1]66 file.close()67 file = os.popen('dcop kscd CDPlayer currentTrackLength')68 duration = int(file.readline()[:-1])69 info['duration'] = int(duration / 1000)70 file.close()71 if kscd_check == 2:72 info['status'] = True73 else:74 info['status'] = False75 except Exception, e:76 print(e)77 return info46 info = {} 47 try: 48 # Check kscd is working 49 file = os.popen('dcop kscd CDPlayer getStatus 2> /dev/null') 50 kscd_check = file.readline() 51 file.close() 52 if len(kscd_check): 53 kscd_check = string.atoi(kscd_check[:-1]) 54 else: 55 kscd_check = 0 56 if kscd_check != 2 and kscd_check != 4: 57 return None 58 file = os.popen('dcop kscd CDPlayer currentAlbum') 59 info['album'] = file.readline()[:-1] 60 file.close() 61 file = os.popen('dcop kscd CDPlayer currentArtist') 62 info['artist'] = file.readline()[:-1] 63 file.close() 64 file = os.popen('dcop kscd CDPlayer currentTrackTitle') 65 info['track'] = file.readline()[:-1] 66 file.close() 67 file = os.popen('dcop kscd CDPlayer currentTrackLength') 68 duration = int(file.readline()[:-1]) 69 info['duration'] = int(duration / 1000) 70 file.close() 71 if kscd_check == 2: 72 info['status'] = True 73 else: 74 info['status'] = False 75 except Exception, e: 76 print(e) 77 return info 78 78 -
lang/python/otolog4linux/trunk/data/plugins/player_mpc.py
r2266 r6632 8 8 9 9 def get_capability(): 10 return ['player']10 return ['player'] 11 11 12 12 def get_name(): 13 return 'mpc'13 return 'mpc' 14 14 15 15 # should be return supported version. … … 17 17 18 18 def play(): 19 file = os.popen('mpc play')20 res = file.readline()[:-1]21 file.close()22 print res19 file = os.popen('mpc play') 20 res = file.readline()[:-1] 21 file.close() 22 print res 23 23 24 24 def stop(): 25 file = os.popen('mpc stop')26 res = file.readline()[:-1]27 file.close()28 print res25 file = os.popen('mpc stop') 26 res = file.readline()[:-1] 27 file.close() 28 print res 29 29 30 30 def pause(): 31 sys.stderr.write('mpc pause\n')31 sys.stderr.write('mpc pause\n') 32 32 33 33 def next(): 34 file = os.popen('mpc next')35 res = file.readline()[:-1]36 file.close()37 print res34 file = os.popen('mpc next') 35 res = file.readline()[:-1] 36 file.close() 37 print res 38 38 39 39 def prev():
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)