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

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

src/a/r/ardj-1.2.1/src/ardj/tracks.py   ardj(Download)
    def get_all(cls):
        """Returns information about all known playlists.  Information from
        playlists.yaml is complemented by the last_played column of the
        `playlists' table."""
        stats = dict(ardj.database.fetch('SELECT name, last_played FROM playlists WHERE name IS NOT NULL AND last_played IS NOT NULL'))
    def get_labels(self):
        if "labels" not in self:
            rows = ardj.database.fetch("SELECT label FROM labels WHERE track_id = ?", (self["id"], ))
            self["labels"] = [row[0] for row in rows]
        return self["labels"]
def get_queue():
    rows = ardj.database.fetch("SELECT track_id FROM queue ORDER BY id")
    return [get_track_by_id(row[0]) for row in rows]
 
 
    if limit is not None:
        sql += ' LIMIT %u' % limit
    rows = ardj.database.fetch(sql, params)
    return [row[0] for row in rows]
 
            if label.startswith('-'):
                ardj.database.execute('DELETE FROM labels WHERE track_id = ? AND label = ?', (track_id, label.lstrip('-'), ))
            elif ardj.database.fetch('SELECT 1 FROM labels WHERE track_id = ? AND label = ?', (track_id, label.lstrip('+'), )):
                pass
            else:

src/a/r/ardj-1.2.1/src/ardj/scrobbler.py   ardj(Download)
            sql = 'SELECT t.artist, t.title, p.ts FROM tracks t INNER JOIN playlog p ON p.track_id = t.id WHERE p.lastfm = 0 AND t.weight > 0 AND t.length > 60 ORDER BY p.ts'
            params = []
        rows = ardj.database.fetch(sql, params)
        for artist, title, ts in rows:
            if not self.scrobble(artist, title, ts):
            sql = 'SELECT t.artist, t.title, p.ts FROM tracks t INNER JOIN playlog p ON p.track_id = t.id WHERE p.librefm = 0 AND t.weight > 0 AND t.length > 60 ORDER BY p.ts'
            params = []
        rows = ardj.database.fetch(sql, params)[:10]
        for artist, title, ts in rows:
            if not self.scrobble(artist, title, ts):

src/a/r/ardj-1.2.1/src/ardj/speech.py   ardj(Download)
        return "Эта функция отключена."
 
    rows = len(ardj.database.fetch('SELECT 1 FROM queue WHERE track_id = ?', (track_id, )))
    if rows:
        return 'All the circuits are busy.  Please retry in a few minutes.'
 
    rows = ardj.database.fetch('SELECT filename FROM tracks WHERE id = ?', (track_id, ))

src/a/r/ardj-1.2.1/src/ardj/console.py   ardj(Download)
        return u"%u rows affected." % ardj.database.execute(args)
 
    rows = ardj.database.fetch(args)
    if not rows:
        return 'Nothing.'
def on_shitlist(args, sender):
    rows = ardj.database.fetch('SELECT id, artist, title, weight, count FROM tracks WHERE weight > 0 ORDER BY weight, title, artist LIMIT 10')
    if not rows:
        return 'No tracks (database must be empty).'
    tracks = [{'id': row[0], 'artist': row[1], 'title': row[2], 'weight': row[3], 'count': row[4]} for row in rows]
    return format_track_list(tracks, u'Lowest rated tracks:')
 
 
def on_hitlist(args, sender):
    rows = ardj.database.fetch('SELECT id, artist, title, weight, count FROM tracks WHERE weight > 0 ORDER BY weight DESC, title, artist LIMIT 10')
def on_news(args, sender):
    rows = ardj.database.fetch('SELECT id, artist, title, weight, count FROM tracks WHERE weight > 0 ORDER BY id DESC LIMIT 10')
    if not rows:
        return 'No tracks at all.'
    tracks = [{'id': row[0], 'artist': row[1], 'title': row[2], 'weight': row[3], 'count': row[4]} for row in rows]
    """
    if not args or args == '-a':
        data = ardj.database.fetch('SELECT l.label, COUNT(*) AS count FROM labels l '
            'INNER JOIN tracks t ON t.id = l.track_id '
            'WHERE t.weight > 0 GROUP BY label ORDER BY l.label')

src/a/r/ardj-1.2.1/src/ardj/tout.py   ardj(Download)
    weight = float(ardj.settings.get("event_schedule_label_weight", "1.0"))
 
    rows = ardj.database.fetch("SELECT DISTINCT artist "
        "FROM tracks WHERE id IN (SELECT track_id FROM labels "
        "WHERE label = ?) AND weight >= ?", (label, weight, ))

src/a/r/ardj-1.2.1/src/ardj/users.py   ardj(Download)
def get_voters():
    """Returns information on voters in tuples (email, count, weight)."""
    rows = database.fetch('SELECT v.email, COUNT(*) AS c, k.weight '
        'FROM votes v LEFT JOIN karma k ON k.email = v.email '
        'GROUP BY v.email ORDER BY c DESC, k.weight DESC, v.email')

src/a/r/ardj-1.2.1/src/ardj/replaygain.py   ardj(Download)
        elif not os.path.exists(musicdir):
            raise Exception('Directory %s does not exist.' % musicdir)
        rows = ardj.database.fetch('SELECT filename FROM tracks WHERE filename IS NOT NULL AND weight > 0 ORDER BY filename')
        args = [os.path.join(musicdir, row[0].encode("utf-8")) for row in rows]