简单的测试了下时间,目前 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)
| # -*- mode: Python; -*- | |
| # vi: ft=python | |
| import json | |
| import os | |
| import threading | |
| from functools import partial | |
| config.AUDIO_SELECT_POLICY = 'sq>>>' |
| """ | |
| 这个脚本的好处:运行 sql 并能看到 sql 的输出,输出格式类似 mysql client。 | |
| 比如,运行下面这个脚本,会有如下输出。 | |
| ``` | |
| i j | |
| 1 3 | |
| (1062, "Duplicate entry '1' for key 'PRIMARY'") | |
| i j | |
| 1 2 |
简单的测试了下时间,目前 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 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) |
| import os | |
| import time | |
| import json | |
| import subprocess | |
| from fuocore.provider import AbstractProvider | |
| from fuocore.models import SongModel | |
| no_proxy_list = [ |
| """ | |
| 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 |
| #!/usr/bin/env python3 | |
| import re | |
| def get_key_value(key, line): | |
| """get key's value in log line""" | |
| p = re.compile(r'\[{}\='.format(key)) | |
| m = p.search(line) | |
| if m is None: |
| { | |
| "Working Directory" : "\/Users\/yinshaowen", | |
| "Prompt Before Closing 2" : false, | |
| "Selected Text Color" : { | |
| "Green Component" : "0", | |
| "Red Component" : "0", | |
| "Blue Component" : "0" | |
| }, | |
| "Rows" : 2, | |
| "Ansi 11 Color" : { |
| # -*- mode: Python; -*- | |
| # vi: ft=python | |
| import os | |
| # 自定义配置 | |
| # config.THEME = 'dark' | |
| config.COLLECTIONS_DIR = '~/Dropbox/public/music' | |
| config.AUDIO_SELECT_POLICY = '>>>' |
| import os | |
| import re | |
| from collections import defaultdict | |
| def get_query_per_sec(line): | |
| """ | |
| >>> s = 'queries: 17493427 (58309.95 per sec.)' | |
| >>> get_query_per_sec(s) |