本文整理匯總了Python中foobnix.gui.model.FModel.is_file方法的典型用法代碼示例。如果您正苦於以下問題:Python FModel.is_file方法的具體用法?Python FModel.is_file怎麽用?Python FModel.is_file使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類foobnix.gui.model.FModel
的用法示例。
在下文中一共展示了FModel.is_file方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_common_beans
# 需要導入模塊: from foobnix.gui.model import FModel [as 別名]
# 或者: from foobnix.gui.model.FModel import is_file [as 別名]
def get_common_beans(self):
beans = []
cue = self.parse()
if not self.is_cue_valid():
return []
for i, track in enumerate(cue.tracks):
bean = FModel(text=track.performer + " - " + track.title, path=track.path)
bean.artist = track.performer
bean.tracknumber = i + 1
bean.title = track.title
bean.album = self.cue_file.title
bean.name = bean.text
bean.start_sec = track.get_start_time_sec()
bean.duration_sec = track.duration
bean.time = convert_seconds_to_text(track.duration)
bean.is_file = True
try:
bean.info = foobnix.util.id3_util.normalized_info(get_mutagen_audio(track.path).info, bean)
except Exception, e:
logging.warn(str(e) + " " + bean.path)
bean.info = ""
if not bean.title or not bean.artist:
bean = udpate_id3(bean)
beans.append(bean)
示例2: get_user_tracks_as_beans
# 需要導入模塊: from foobnix.gui.model import FModel [as 別名]
# 或者: from foobnix.gui.model.FModel import is_file [as 別名]
def get_user_tracks_as_beans(self, user_id):
beans = []
result = self.controls.vk_service.get_result('audio.get', "uid=" + user_id)
if not result:
beans = [FDModel(_("No results found")).add_is_file(True)]
else:
for line in result:
bean = FModel(line['artist'] + ' - ' + line['title'])
bean.aritst = line['artist']
bean.title = line['title']
bean.time = convert_seconds_to_text(line['duration'])
bean.path = line['url']
bean.aid = line['aid']
bean.oid = line['owner_id']
bean.is_file = True
bean.vk_audio_id = "%s_%s" % (line['owner_id'], line['aid'])
beans.append(bean)
return beans