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

Todos #17

Open
uwinx opened this issue Jan 9, 2021 · 0 comments
Open

Todos #17

uwinx opened this issue Jan 9, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@uwinx
Copy link
Member

uwinx commented Jan 9, 2021

todo!

  1. Optimize Filter instances as they're something that gets created a lot in code. Possibly make filters immutable.
class Filter(NamedTuple): pass
or, simpler:
Filter = dataclass(frozen=True)(Filter)

States are just a type of filters.

  1. Smartish code pattern generation based on given states group definition.

no examples.

  1. Nicer way to connect existing handlers to interoperate in the cases like:
# mod1.py
baker: QueryBaker = ...

handler(...): mod2.baker.get_checked(...)

# mod2.py
baker: QueryBaker = ...

handler(...): mod1.baker.get_checked(...)
  1. Introduce gettext and I18N data to users.

  2. [long-term] make garnet a frontend to any telethon-like library and not just telethon.

  3. Filter pipelines and stacks:

from garnet.filters import Pipeline, Stack

pp = Pipeline(user_exists, in_entry_state, is_allowed_cmd)

@router.message(pp.pop(1))   # will compose Stack().include (user_exists, is_allowed_cmd)
async def _(_): ...


stack = Stack(user_exists, in_entry_state, is_allowed_cmd)

@router.message(stack.include(0, 1))  # will drop is_allowed_cmd
async def _(_): ...
@uwinx uwinx added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jan 9, 2021
@uwinx uwinx self-assigned this Jan 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant