Skip to content

Commit

Permalink
add black to the list of dependencies, format package
Browse files Browse the repository at this point in the history
  • Loading branch information
pomdtr committed Dec 20, 2023
1 parent 6874c4b commit bbdaec1
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
7 changes: 5 additions & 2 deletions pkg/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ build-backend = "flit_core.buildapi"

[project]
name = "sunbeam"
authors = [{name = "Achille Lacoin", email = "[email protected]"}]
authors = [{ name = "Achille Lacoin", email = "[email protected]" }]
readme = "README.md"
license = {file = "LICENSE"}
license = { file = "LICENSE" }
classifiers = ["License :: OSI Approved :: MIT License"]
dynamic = ["version", "description"]

[project.optional-dependencies]
dev = ["black"]

[project.urls]
Home = "https://sunbeam.sh"
2 changes: 1 addition & 1 deletion pkg/python/sunbeam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from .manifest import *
from .page import *

__version__ = '0.2.0'
__version__ = "0.2.0"
10 changes: 9 additions & 1 deletion pkg/python/sunbeam/manifest.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
from typing import TypedDict, NotRequired, Literal


class TextInput(TypedDict):
default: NotRequired[str]
placeholder: NotRequired[str]


class TextAreaInput(TypedDict):
default: NotRequired[str]
placeholder: NotRequired[str]


class CheckboxInput(TypedDict):
default: NotRequired[bool]


class PasswordInput(TypedDict):
placeholder: NotRequired[str]


class NumberInput(TypedDict):
default: NotRequired[int]
placeholder: NotRequired[str]


class Input(TypedDict):
label: str
type: str
Expand All @@ -29,15 +35,17 @@ class Input(TypedDict):
password: NotRequired[PasswordInput]
number: NotRequired[NumberInput]


CommandMode = Literal["silent", "tty", "filter", "search", "detail"]


class Command:
name: str
title: str
params: list[Input]


class Manifest(TypedDict):
title: str
description: str
preferences: NotRequired[list[Input]]

19 changes: 18 additions & 1 deletion pkg/python/sunbeam/page.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,36 @@
from typing import TypedDict, NotRequired, Literal


class Param(TypedDict):
default: NotRequired[str | int | bool]


class RunAction(TypedDict):
command: str
params: dict[str, str | int | bool | Param]


class ReloadAction(TypedDict):
params: dict[str, str | int | bool | Param]


class OpenAction(TypedDict):
url: NotRequired[str]
path: NotRequired[str]


class CopyAction(TypedDict):
text: str
exit: NotRequired[bool]

ActionType = Literal["copy", "open", "run", "reload", "exit"]

class EditAction(TypedDict):
path: str
reload: NotRequired[bool]


ActionType = Literal["copy", "open", "run", "reload", "exit", "edit", "exit"]


class Action(TypedDict):
title: str
Expand All @@ -27,11 +39,14 @@ class Action(TypedDict):
copy: NotRequired[CopyAction]
open: NotRequired[OpenAction]
run: NotRequired[RunAction]
edit: NotRequired[EditAction]


class ListItemDetail(TypedDict):
markdown: NotRequired[str]
text: NotRequired[str]


class ListItem(TypedDict):
title: str
id: NotRequired[str]
Expand All @@ -40,12 +55,14 @@ class ListItem(TypedDict):
accessories: NotRequired[list[str]]
actions: list[Action]


class List(TypedDict):
items: NotRequired[list[ListItem]]
showDetail: NotRequired[bool]
actions: NotRequired[list[Action]]
emptyText: NotRequired[str]


class Detail(TypedDict):
markdown: NotRequired[str]
text: NotRequired[str]
Expand Down

0 comments on commit bbdaec1

Please sign in to comment.