예제 #1
0
 def what():
     for i, d in enumerate(dupes):
         a = artists[i]
         if d:
             self.dupes.append(d)
             item = QTreeWidgetItem([a])
             for z in sorted(d, key=dupe_sort):
                 child = QTreeWidgetItem([tagtofilename(dispformat[0], z[0])])
                 item.addChild(child)                        
                 [child.addChild(QTreeWidgetItem([
                     tagtofilename(dispformat[1],x)])) for x in
                         sorted(z[1:], key=title_sort)]
             self.emit(SIGNAL('toplevel'), item)
         yield None
예제 #2
0
파일: algwin.py 프로젝트: korala1968/tago
 def what():
     for i, d in enumerate(dupes):
         a = artists[i]
         if d:
             self.dupes.append(d)
             item = QTreeWidgetItem([a])
             for z in sorted(d, key=dupe_sort):
                 child = QTreeWidgetItem([tagtofilename(dispformat[0], z[0])])
                 item.addChild(child)
                 [child.addChild(QTreeWidgetItem([
                     tagtofilename(dispformat[1],x)])) for x in
                         sorted(z[1:], key=title_sort)]
             self.emit(SIGNAL('toplevel'), item)
         yield None
예제 #3
0
파일: funcs.py 프로젝트: keithgg/puddletag
def update_status(enable = True):
    files = status['selectedfiles']
    pattern = status['patterntext']
    tf = lambda *args, **kwargs: encode_fn(findfunc.tagtofilename(*args, **kwargs))
    if not files:
        return
    tag = files[0]

    state = {'__counter': u'1', '__total_files': unicode(len(files))}

    x = findfunc.filenametotag(pattern, tag[PATH], True)
    emit('ftstatus', display_tag(x))

    bold_error = translate("Status Bar", "<b>%s</b>")
    
    try:
        newfilename = functions.move(tag, pattern, tag, state=state.copy())
        if newfilename:
            newfilename = newfilename['__path']
            emit('tfstatus', translate("Status Bar",
                "New Filename: <b>%1</b>").arg(
                    decode_fn(newfilename)))
        else:
            emit('tfstatus', u'<b>No change</b>')
    except findfunc.ParseError, e:
        emit('tfstatus', bold_error % e.message)
예제 #4
0
파일: funcs.py 프로젝트: korala1968/tago
def update_status(enable=True):
    files = status['selectedfiles']
    pattern = status['patterntext']
    tf = lambda *args, **kwargs: encode_fn(
        findfunc.tagtofilename(*args, **kwargs))
    if not files:
        return
    tag = files[0]

    state = {'__counter': u'1', '__total_files': unicode(len(files))}

    x = findfunc.filenametotag(pattern, tag[PATH], True)
    emit('ftstatus', display_tag(x))

    bold_error = translate("Status Bar", "<b>%s</b>")

    try:
        newfilename = functions.move(tag, pattern, tag, state=state.copy())
        if newfilename:
            newfilename = newfilename['__path']
            emit(
                'tfstatus',
                translate("Status Bar", "New Filename: <b>%1</b>").arg(
                    decode_fn(newfilename)))
        else:
            emit('tfstatus', u'<b>No change</b>')
    except findfunc.ParseError, e:
        emit('tfstatus', bold_error % e.message)
예제 #5
0
파일: m3u.py 프로젝트: korala1968/tago
def exportm3u(tags, tofile, format = None, reldir = False, winsep=False):
    header = ['#EXTM3U']

    if reldir:
        reldir = os.path.dirname(os.path.abspath(tofile))
        filenames = [relpath(f.filepath, reldir) for f in tags]
    else:
        filenames = [f.filepath for f in tags]

    if winsep:
        filenames = [f.replace('/', '\\') for f in filenames]

    if format is None:
        text = '\n'.join(header + filenames)
    else:
        text = header
        extinfo = ('#EXTINF: %s, %s' % (str(lnglength(f.length)),
            encode_fn(tagtofilename(format, f, False))) for f in tags)
        [text.extend([z,y]) for z,y in zip(extinfo, filenames)]
        text = '\n'.join(text)

    playlist = open(tofile, 'w')
    playlist.write(text)
    playlist.close()
예제 #6
0
def save_cover(info, data, filetype):
    filename = tagtofilename(COVER_PATTERN, info, True, filetype)
    save_file(filename, data)
예제 #7
0
def save_cover(info, data, filetype):
    filename = tagtofilename(COVER_PATTERN, info, True, filetype)
    save_file(filename, data)