-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
显然需要修改构建脚本
- Loading branch information
lilingfengdev
committed
Jun 23, 2024
1 parent
c2e687d
commit deee44a
Showing
20 changed files
with
69 additions
and
116 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from core.search import search | ||
import random | ||
import colorama | ||
|
||
colorama.init(autoreset=True) | ||
|
||
|
||
def print_result(result): | ||
print("\033[1;33m====================\033[0m") | ||
print(f"\033[1;32m标题: \033[0m{result.title}") | ||
print(f"\033[1;34m简介: \033[0m{result.summary}") | ||
print(f"\033[1;36mURL: \033[0m{result.url}") | ||
print("\033[1;33m====================\033[0m") | ||
print() | ||
|
||
|
||
print("欢迎使用插件搜索工具") | ||
while True: | ||
keyword = input("请输入关键字(exit退出):") | ||
if keyword == "exit": | ||
break | ||
|
||
results = search(keyword) | ||
random.shuffle(results) | ||
for result in results: | ||
print_result(result) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from typing import List | ||
|
||
from core.engine.minebbs import Minebbs | ||
from core.engine.klpbbs import Klpbbs | ||
from core.engine.spigotmc import Spigot | ||
from core.engine.tinksp import Tinksp | ||
from core.engine.base import SearchResult | ||
from concurrent.futures import ThreadPoolExecutor, wait | ||
|
||
|
||
def search(keyword: str) -> List[SearchResult]: | ||
engine = [Spigot, Tinksp, Minebbs, Klpbbs] | ||
results = [] | ||
with ThreadPoolExecutor(max_workers=6) as executor: | ||
future_list = [] | ||
for e in engine: | ||
future = executor.submit(e().search, keyword) | ||
future_list.append(future) | ||
wait(future_list) | ||
for future in future_list: | ||
for result in future.result(): | ||
results.append(result) | ||
return result |
Empty file.
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
cn_bing_translator | ||
pyperclip | ||
colorama | ||
pyperclip~=1.9.0 | ||
colorama~=0.4.6 | ||
requests~=2.32.3 | ||
lxml~=5.2.2 |