Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: Wing 0.3.0 development #2

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions nonebot_desktop_wing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
from .constants import PYPI_MIRRORS as PYPI_MIRRORS
from .hindsight import BackgroundObject as BackgroundObject
from .lazylib import meta as meta
from .molecules import (
import_with_lock as import_with_lock,
from .utils import (
list_paginate as list_paginate,
exec_new_win as exec_new_win,
open_new_win as open_new_win,
system_open as system_open,
perform_pip_command as perform_pip_command,
perform_pip_install as perform_pip_install,
rrggbb_bg2fg as rrggbb_bg2fg
)
from .project import (
find_python as find_python,
distributions as distributions,
_distributions as _distributions,
getdist as getdist,
create as create,
get_builtin_plugins as get_builtin_plugins,
Expand Down
6 changes: 1 addition & 5 deletions nonebot_desktop_wing/constants.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import os
import sys
from typing import List, Tuple

PYPI_MIRRORS: List[str] = [
PYPI_MIRRORS: list[str] = [
"https://pypi.org/simple",
"https://pypi.doubanio.com/simple",
"https://mirrors.163.com/pypi/simple",
Expand All @@ -14,8 +13,5 @@
]
"""PyPI mirror lists, including official index, mainly for Chinese (Mainland) users."""

LINUX_TERMINALS: Tuple[str, ...] = ("gnome-terminal", "konsole", "xfce4-terminal", "xterm", "st")
"""Some terminal emulators on Linux for choosing."""

WINDOWS: bool = sys.platform.startswith("win") or (sys.platform == "cli" and os.name == "nt")
"""Windows platform identifier."""
64 changes: 0 additions & 64 deletions nonebot_desktop_wing/hindsight.py

This file was deleted.

42 changes: 0 additions & 42 deletions nonebot_desktop_wing/lazylib.py

This file was deleted.

37 changes: 0 additions & 37 deletions nonebot_desktop_wing/lazylib.pyi

This file was deleted.

59 changes: 59 additions & 0 deletions nonebot_desktop_wing/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
from datetime import datetime
from pydantic import BaseModel


class ColoredTag(BaseModel):
"""Tag with color"""

label: str
"""Tag content"""

color: str
"""Tag color"""


class NoneBotCommonInfo(BaseModel):
"""Common info for drivers, adapters and plugins"""

module_name: str
"""Name for importing"""

project_link: str
"""Name for downloading from PyPI"""

name: str
"""Human-readable name"""

desc: str
"""Description"""

author: str
"""Author"""

homepage: str
"""Project homepage"""

tags: list[ColoredTag]
"""Tags"""

is_official: bool
"""Whether an extension is official"""


class NoneBotPluginInfo(NoneBotCommonInfo):
"""Plugin info model"""

# Some plugins are still not prepared for these metadata, so `None` is still needed
# for now, until the registry is ready for all plugins.

type: str | None
"""Plugin category"""

supported_adapters: list[str] | None
"""Supported adapters, `None` for all adapters"""

valid: bool
"""Plugin load test result"""

time: datetime
"""Plugin load test time"""
Loading