Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(16)  |  Call(16)  |  Derive(0)  |  Import(0)

src/a/r/ardj-1.2.1/src/ardj/tracks.py   ardj(Download)
    def get_by_id(cls, track_id):
        if not track_id:
            return None
        sql = "SELECT %s FROM %s WHERE %s = ?" % (", ".join(cls.fields), cls.table_name, cls.key_name)
        row = ardj.database.fetchone(sql, (int(track_id), ))
    def get_last(cls):
        sql = "SELECT %s FROM %s ORDER BY last_played DESC LIMIT 1" % (", ".join(cls.fields), cls.table_name)
        row = ardj.database.fetchone(sql)
        return Track([(cls.fields[k], v) for k, v in enumerate(row)])
 
    def get_last_vote(self, sender):
        votes = ardj.database.fetchone("SELECT vote FROM votes WHERE track_id = ? AND email = ? ORDER BY id DESC", (self["id"], sender, ))
    cur -- database cursor, created if None.
    """
    row = ardj.database.fetchone("SELECT id FROM tracks ORDER BY last_played DESC LIMIT 1")
    if row:
        return row[0]
    email = resolve_alias(email)
 
    row = ardj.database.fetchone("SELECT last_played, weight FROM tracks WHERE id = ?", (track_id, ))
    if row is None:
        return None

src/a/r/ardj-1.2.1/src/ardj/console.py   ardj(Download)
def on_ban(args, sender):
    if not args:
        return 'Usage: ban artist_name'
    count = ardj.database.fetchone('SELECT COUNT(*) FROM tracks WHERE artist = ? AND weight > 0', (args, ))[0]
    if not count:
 
        tracks = tracks[:1]
        have_tracks = ardj.database.fetchone('SELECT COUNT(*) FROM queue WHERE owner = ?', (sender, ))[0]
 
        if not is_admin:
    track['editable'] = is_user_admin(sender)
 
    votes = ardj.database.fetchone('SELECT vote FROM votes WHERE track_id = ? AND email = ?', (track['id'], sender, ))
    track['vote'] = votes and votes[0] or None
 

src/a/r/ardj-1.2.1/src/ardj/podcast.py   ardj(Download)
    Does nothing if the song is already in the database (only artist/title are
    checked).  TODO: check duration and file size also."""
    track_id = ardj.database.fetchone('SELECT id FROM tracks WHERE artist = ? AND title = ?', (artist, title, ))
    if track_id is None:
        logging.info((u'Downloading "%s" by %s' % (title, artist)).encode("utf-8"))