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

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

src/a/r/ardj-1.2.1/src/ardj/tracks.py   ardj(Download)
            if name and playlist.match_track(track):
                logging.debug('Track %u touches playlist "%s".' % (track_id, name.encode("utf-8")))
                rowcount = ardj.database.execute('UPDATE playlists SET last_played = ? WHERE name = ?', (ts, name, ))
                if rowcount == 0:
                    ardj.database.execute('INSERT INTO playlists (name, last_played) VALUES (?, ?)', (name, ts, ))
def queue(track_id, owner=None):
    """Adds the track to queue."""
    return ardj.database.execute('INSERT INTO queue (track_id, owner) VALUES (?, ?)', (track_id, (owner or 'ardj').lower(), ))
 
 
def add_labels(track_id, labels, owner=None):
    if labels:
        for label in labels:
            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:
                ardj.database.execute('INSERT INTO labels (track_id, label, email) VALUES (?, ?, ?)', (track_id, label.lstrip('+'), owner or 'ardj', ))

src/a/r/ardj-1.2.1/src/ardj/console.py   ardj(Download)
 
    if not args.lower().startswith("select"):
        return u"%u rows affected." % ardj.database.execute(args)
 
    rows = ardj.database.fetch(args)
    if not count:
        return 'No tracks by this artist.'
    ardj.database.execute('UPDATE tracks SET weight = 0 WHERE artist = ?', (args, ))
    ardj.jabber.chat_say(u"%s deleted all %u tracks by %s." % (shortname(sender), count, args))
    return 'Deleted %u tracks.' % count
 
    if args == 'flush':
        ardj.database.execute('DELETE FROM queue WHERE owner = ?', (sender, ))
        return 'Removed your tracks from queue.'
 
    if args == 'flush -a' and is_admin:
        ardj.database.execute('DELETE FROM queue')
        if delete:
            for track_id in tracks:
                ardj.database.execute('DELETE FROM queue WHERE owner = ? AND track_id = ?', (sender, track_id, ))
            return 'Done.'
 

src/a/r/ardj-1.2.1/src/ardj/scrobbler.py   ardj(Download)
            if not self.scrobble(artist, title, ts):
                return False
            ardj.database.execute('UPDATE playlog SET lastfm = 1 WHERE ts = ?', (ts, ))
            ardj.database.commit()  # prevent hanging transactions
        return True
            if not self.scrobble(artist, title, ts):
                return False
            ardj.database.execute('UPDATE playlog SET librefm = 1 WHERE ts = ?', (ts, ))
            ardj.database.commit()  # prevent hanging transactions
        return True

src/a/r/ardj-1.2.1/src/ardj/speech.py   ardj(Download)
    tmpname, duration = render_text(message)
    ardj.util.move_file(tmpname, os.path.join(ardj.settings.get_music_dir(), filename))
    ardj.database.execute('UPDATE tracks SET length = ? WHERE id = ?', (duration, track_id, ))
    ardj.database.execute('INSERT INTO queue (track_id, owner) VALUES (?, ?)', (track_id, 'ardj', ))
 

src/a/r/ardj-1.2.1/src/ardj/users.py   ardj(Download)
def merge_aliased_votes():
    """Moves votes from aliases to real jids."""
    for k, v in get_aliases().items():
        for alias in v:
            database.execute("UPDATE votes SET email = ? WHERE email = ?", (k, alias, ))

src/a/r/ardj-1.2.1/src/ardj/jabber.py   ardj(Download)
def chat_say(message, recipient=None):
    """Adds a message to the chat room queue.  This is the only way for command
    handlers to notify chat users.  If the recipient is not specified, the
    message is sent to the chat room."""
    ardj.database.execute("INSERT INTO jabber_messages (re, message) VALUES (?, ?)", (recipient, message, ))

src/a/r/ardj-1.2.1/src/ardj/tout.py   ardj(Download)
def update_labels(artist_names):
    """Adds the concert-soon labels to appropriate tracks."""
    ardj.database.execute("DELETE FROM labels WHERE label = 'concert-soon'")
    for name in artist_names:
        logging.debug("Tagging %s with concert-soon" % name.encode("utf-8"))
        ardj.database.execute('INSERT INTO labels (track_id, label, email) '