本文整理汇总了Python中mpd.MPDClient.deleteid方法的典型用法代码示例。如果您正苦于以下问题:Python MPDClient.deleteid方法的具体用法?Python MPDClient.deleteid怎么用?Python MPDClient.deleteid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mpd.MPDClient
的用法示例。
在下文中一共展示了MPDClient.deleteid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from mpd import MPDClient [as 别名]
# 或者: from mpd.MPDClient import deleteid [as 别名]
removeItems = []
for itm in client.playlistinfo():
foundBad = False
for unwanted in unwantedStrings:
for val in itm.itervalues():
if unwanted in val.lower():
removeItems.append(itm['id'])
print unwanted,'=>',val,'IN:', itm
foundBad = True
break
if foundBad == True:
break
#if unwanted in itm['name'].lower() or unwanted in itm['file'].lower() or unwanted in itm['title'].lower():
#removeItems.append(itm['id'])
for itmId in removeItems:
client.deleteid(itmId)
if len(removeItems) > 0:
print '*********************'
print 'Removed',len(removeItems),'HEINOS'
print '*********************'
else:
print 'theres no HEINO'
client.disconnect()
示例2: delete_event
# 需要导入模块: from mpd import MPDClient [as 别名]
# 或者: from mpd.MPDClient import deleteid [as 别名]
#.........这里部分代码省略.........
self.nItr = self.tree.get_iter_root()
def mpdCmd(self):
if self.current == True:
songTitle = self.tree.get_value(self.tree.get_iter_from_string(str(self.rbox.get_cursor()[0][0])), 0)
songTitle = songTitle.split("\t")[0]
songid = self.list[songTitle]
self.mclient.playid(songid)
self.music = False
#self.mclient.disconnect()
self.destroy(self, data=None)
elif self.artist == True:
#artist = self.tree.get_value(self.nItr, 0)
artist = self.tree.get_value(self.tree.get_iter_from_string(str(self.rbox.get_cursor()[0][0])), 0)
self.mclient.add(artist)
self.mclient.play()
elif self.album == True:
#album = self.tree.get_value(self.nItr, 0)
album = self.tree.get_value(self.tree.get_iter_from_string(str(self.rbox.get_cursor()[0][0])), 0)
self.mclient.findadd("album", album)
self.mclient.play()
elif self.tracks == True:
#track = self.tree.get_value(self.nItr, 0)
track = self.tree.get_value(self.tree.get_iter_from_string(str(self.rbox.get_cursor()[0][0])), 0)
self.mclient.findadd("title", track)
self.mclient.play()
elif self.delcur == True:
track = self.tree.get_value(self.nItr, 0)
self.mclient.deleteid(self.list[track])
self.current = True
self.delcur = False
self.getMusic()
elif self.options == True:
option = self.tree.get_value(self.nItr, 0)
if "consume" in option and "off" in option:
self.mclient.consume(1)
elif "consume" in option and "on" in option:
self.mclient.consume(0)
elif "repeat" in option and "off" in option:
self.mclient.repeat(1)
elif "repeat" in option and "on" in option:
self.mclient.repeat(0)
elif "random" in option and "off" in option:
self.mclient.random(1)
elif "random" in option and "on" in option:
self.mclient.random(0)
elif "single" in option and "off" in option:
self.mclient.single(1)
elif "single" in option and "on" in option:
self.mclient.single(0)
self.getMusic()
def saveHist(self):
shutil.copyfile(self.hist, self.fhist)
def __init__(self):
#window
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.connect("delete_event", self.delete_event)
示例3: MPDClient
# 需要导入模块: from mpd import MPDClient [as 别名]
# 或者: from mpd.MPDClient import deleteid [as 别名]
from mpd import MPDClient
c = MPDClient()
c.connect("localhost", 6600)
song_id = int(c.status()["songid"])
print "Removing song {0} from playlist".format(song_id)
c.deleteid(song_id)