当前位置: 首页>>代码示例>>Python>>正文


Python Track.id方法代码示例

本文整理汇总了Python中track.Track.id方法的典型用法代码示例。如果您正苦于以下问题:Python Track.id方法的具体用法?Python Track.id怎么用?Python Track.id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在track.Track的用法示例。


在下文中一共展示了Track.id方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_track_row

# 需要导入模块: from track import Track [as 别名]
# 或者: from track.Track import id [as 别名]
    def get_track_row(self):
        row = self.db.fetchone()
        tid = row['track_id']
        position = row['position']
        ptid = row['id']

        self.db.commit_statement('''select * from tracks where id = ?''', [row['track_id']])
        row = self.db.fetchone()
        del row['id']
        t = Track(**row)
        t.id = tid
        t.position = position
        t.ptid = ptid
        return t
开发者ID:estock,项目名称:dogvibes,代码行数:16,代码来源:playlist.py

示例2: get_track_row

# 需要导入模块: from track import Track [as 别名]
# 或者: from track.Track import id [as 别名]
    def get_track_row(self):
        row = self.db.fetchone()
        tid = row["track_id"]
        position = row["position"]
        ptid = row["id"]

        self.db.commit_statement("""select * from tracks where id = ?""", [row["track_id"]])
        row = self.db.fetchone()
        del row["id"]
        t = Track(**row)
        t.id = tid
        t.position = position
        t.ptid = ptid
        return t
开发者ID:popdevelop,项目名称:dogvibes_old,代码行数:16,代码来源:playlist.py

示例3: _get_tracks_list

# 需要导入模块: from track import Track [as 别名]
# 或者: from track.Track import id [as 别名]
	def _get_tracks_list(self, query):
		self._cur.execute(query)
		rows = self._cur.fetchall()
		result = []

		for row in rows:
			t = Track()
			t.id = row["id"]
			t.subfile_no = row["subfile_no"]
			t.title = row["title"]
			t.offset = row["offset"]
			t.size = row["size"]
			t.filehash = row["filehash"]
			t.created_at = row["created_at"]
			result.append(t)

		return result;
开发者ID:olysyuk,项目名称:track2peer,代码行数:19,代码来源:db.py

示例4: get_all_tracks

# 需要导入模块: from track import Track [as 别名]
# 或者: from track.Track import id [as 别名]
    def get_all_tracks(self):
        self.db.commit_statement('''select * from playlist_tracks where playlist_id = ?''', [int(self.id)])
        row = self.db.fetchone()
        tracks = []
        while row != None:
            tracks.append((str(row['id']), row['track_id'])) # FIXME: broken!
            row = self.db.fetchone()

        ret_tracks = []
        for track in tracks:
            # TODO: replace with an SQL statement that instantly creates a Track object
            self.db.commit_statement('''select * from tracks where id = ?''', [track[1]])
            row = self.db.fetchone()
            del row['id']
            t = Track(**row)
            t.id = track[0] # add the playlist-to-track id instead
            ret_tracks.append(t)

        return ret_tracks
开发者ID:estock,项目名称:dogvibes,代码行数:21,代码来源:playlist.py

示例5: get_track_nbr

# 需要导入模块: from track import Track [as 别名]
# 或者: from track.Track import id [as 别名]
    def get_track_nbr(self, nbr):
        self.db.commit_statement('''select * from playlist_tracks where playlist_id = ?''', [int(self.id)])

        row = self.db.fetchone()

        # There is probably a much smarter way to fetch a specific row number
        i = 0
        while i < nbr:
            row = self.db.fetchone()
            i = i + 1

        tid = row['id']

        self.db.commit_statement('''select * from tracks where id = ?''', [row['track_id']])
        row = self.db.fetchone()
        del row['id']
        t = Track(**row)
        t.id = tid
        return t
开发者ID:estock,项目名称:dogvibes,代码行数:21,代码来源:playlist.py

示例6: get_all_tracks

# 需要导入模块: from track import Track [as 别名]
# 或者: from track.Track import id [as 别名]
    def get_all_tracks(self):
        self.db.commit_statement(
            """select * from playlist_tracks where playlist_id = ? order by position""", [int(self.id)]
        )
        row = self.db.fetchone()
        tracks = []
        while row != None:
            tracks.append((str(row["id"]), row["track_id"]))  # FIXME: broken!
            row = self.db.fetchone()

        ret_tracks = []
        for track in tracks:
            # TODO: replace with an SQL statement that instantly creates a Track object
            self.db.commit_statement("""select * from tracks where id = ?""", [track[1]])
            row = self.db.fetchone()
            del row["id"]
            t = Track(**row)
            t.id = track[0]
            ret_tracks.append(t)

        return ret_tracks
开发者ID:popdevelop,项目名称:dogvibes_old,代码行数:23,代码来源:playlist.py

示例7: get_all_tracks

# 需要导入模块: from track import Track [as 别名]
# 或者: from track.Track import id [as 别名]
    def get_all_tracks(self):

        self.db.commit_statement('''select * from playlist_tracks where playlist_id = ? order by position''', [int(self.id)])
        row = self.db.fetchone()
        tracks = []
        while row != None:
            tracks.append((str(row['id']), row['track_id'], row['votes'])) # FIXME: broken!
            row = self.db.fetchone()

        ret_tracks = []

        for track in tracks:
            # TODO: replace with an SQL statement that instantly creates a Track object
            self.db.commit_statement('''select * from tracks where id = ?''', [track[1]])
            row = self.db.fetchone()
            oldid = row['id']
            del row['id']
            t = Track(**row)
            t.id = track[0]
            t.votes = str(track[2])
            t.voters = t.get_all_voting_users(oldid)
            ret_tracks.append(t)

        return ret_tracks
开发者ID:estock,项目名称:dogvibes,代码行数:26,代码来源:playlist.py


注:本文中的track.Track.id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。