简单的测试了下时间,目前 4k 首歌曲,大概是这么个情况。
In [16]: start = time.time()
...: get_dumper('json').dump(songs)
...: print(time.time() - start)
0.3063631057739258
In [17]: start = time.time()
...: get_dumper('json').dump(songs)
import os | |
import time | |
import json | |
import subprocess | |
from fuocore.provider import AbstractProvider | |
from fuocore.models import SongModel | |
no_proxy_list = [ |
import cProfile | |
from fuocore.models import SongModel | |
songs_10k = [SongModel(identifier=i) for i in range(0, 4000)] | |
songs = [] | |
def playlist_add(song): | |
if song not in songs: | |
songs.append(song) |
简单的测试了下时间,目前 4k 首歌曲,大概是这么个情况。
In [16]: start = time.time()
...: get_dumper('json').dump(songs)
...: print(time.time() - start)
0.3063631057739258
In [17]: start = time.time()
...: get_dumper('json').dump(songs)
""" | |
这个脚本的好处:运行 sql 并能看到 sql 的输出,输出格式类似 mysql client。 | |
比如,运行下面这个脚本,会有如下输出。 | |
``` | |
i j | |
1 3 | |
(1062, "Duplicate entry '1' for key 'PRIMARY'") | |
i j | |
1 2 |
# -*- mode: Python; -*- | |
# vi: ft=python | |
import json | |
import os | |
import threading | |
from functools import partial | |
config.AUDIO_SELECT_POLICY = 'sq>>>' |
def add_download_action(ctx): | |
from fuocore import aio | |
from fuocore.models import ModelType, SearchType | |
global app | |
def sample(models): | |
for model in models: | |
if model.meta.model_type == ModelType.song: | |
print(str(model)) |
#include <stdint.h> | |
#include <sys/ioctl.h> | |
#include <sys/fcntl.h> | |
#include <sys/stat.h> | |
#include <linux/fs.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <errno.h> | |
int main (int argc, char **argv) { |
""" | |
Usage: | |
1. 在 FeelUOwn 中登录网易云 | |
2. fuo exec < t.py | |
""" | |
from fuo_netease import provider | |
from fuocore.models.uri import reverse | |
from fuocore.cmds.helpers import show_song |
goroutine 3620521 [running]: | |
runtime/pprof.writeGoroutineStacks(0x40a8ae0, 0xc00827fdc0, 0x0, 0x0) | |
/usr/local/go/src/runtime/pprof/pprof.go:679 +0x9d | |
runtime/pprof.writeGoroutine(0x40a8ae0, 0xc00827fdc0, 0x2, 0x13951e6, 0xc009e2b340) | |
/usr/local/go/src/runtime/pprof/pprof.go:668 +0x44 | |
runtime/pprof.(*Profile).WriteTo(0x5a60da0, 0x40a8ae0, 0xc00827fdc0, 0x2, 0xc00827fdc0, 0xd) | |
/usr/local/go/src/runtime/pprof/pprof.go:329 +0x3da | |
net/http/pprof.handler.ServeHTTP(0xc011b55991, 0x9, 0x40fd480, 0xc00827fdc0, 0xc001003400) | |
/usr/local/go/src/net/http/pprof/pprof.go:245 +0x33a | |
net/http/pprof.Index(0x40fd480, 0xc00827fdc0, 0xc001003400) |
from typing import List | |
class SongDisplayModel: | |
pass | |
class SongModel: | |
pass |