GithubHelp home page GithubHelp logo

derula / strainer Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 2.0 432 KB

A GUI for Sieve scripts and ManageSieve communications.

License: The Unlicense

Python 100.00%
sieve managesieve email-filter gui-client script-editor documentation-browser

strainer's People

Contributors

dependabot[bot] avatar derula avatar

Stargazers

 avatar  avatar

Watchers

 avatar

strainer's Issues

New lexer / parser based on Lark

A new lexer and parser are in development, They are currently much slower than the sievelib parser, but should also be more accurate / resistant to errors. Plus, since they are based on a grammar, they are more easily extendable / bugs should be easier to fix.

To do:

  • Rewrite Scintilla lexer to use new lexer
  • Run new parser to find errors
    • Make sure Parser only runs some time after typing stopped, because it is so slow
    • Consider finding all parse errors at once and adding a panel to show all of them => #31
  • Consider adding more features to the grammar, e.g. Sieve extensions => #32

See also #16.

Partial lexing: always use entire text

Currently, partial lexing uses a strange logic of "moving the goalposts" before lexing starts. This, however, potentially doesn't perform well, and causes other problems (cf. #15).

Instead:

  • Send complete document to lexer
  • "Fast forward" while the end of the token is before the start of the range
  • Style all following tokens
  • Stop styling once the start of the token is after the end of the range

Better sieve error analysis

  1. Show full parse results using sievelib.
  2. Show reason provided by server if upload fails due to parse error.

Add list of all parse errors

Lark has an option to give an error callback instead of raising on first error. With this, we could add a list of all errors instead of just highlighting the first.

GUI to return to homepage

The sieve documentation window currently has no option to return to the main page, making it difficult to look at other parts of the documentation unreachable by clicking on things. A button could either be added to a common (cf. #2) or separate toolbar (with actions loaded from the QWebEngine context menu), or just as a new entry in the context menu.

Save scripts

Currently, scripts can be opened and edited, but not saved. We need:

  • Either a save button (toolbar? regular button?) or some kind of menu.
  • Indicator of whether the script has been changed.
  • Warning when closing with unsaved changed.

Decrease time before first UI element is shown

Currently it takes a long time before the window is shown, making it seem like something's not right.

Possible solutions:

  • Show a splash screen (meeh)
  • Lazy loading of settings / populating accounts list (only a partial solution, and a bit of a challenge)

Activate / delete scripts

There is already GUI in place to activate / delete scripts, it's just not functional yet. Should be done after #2 to avoid accidentally deleting scripts while testing and then not having any test data left.

Status bar content resizes window

When the status bar content is set to a long string, the minimum width of the window is adjusted to show it in full. This should not happen; status bar text should just be limited to the available width.

Enable partial re-lexing

Currently, we rely on the sievelib lexer to style the script in Scintilla. Unfortunately, this lexer returns multi-line comments and strings as a single token, which breaks the ability to use Scintilla's partial restyling. (Neither "text:\n" not "/* comment\n" are recognized as the beginning of a string / comment in isolation.)

Possible solutions:

  • Override the rules sent to the lexer (defeats the purpose of using a lib)
  • Implement in sievelib and issue a PR (unclear if or when it will be merged)
  • Don't rely on sievelib for lexing at all
  • Always lex the entire file (current "solution")

Add more grammar features

  • Sieve extensions?
  • Explicitly recognize the optional hash comment in multi-line text?
  • Understand ${hex:...} / ${unicode:...} syntax?

Reimplement edit menu

This is currently a hacky re-use of the Scintilla default menu and can't be used in the toolbar. Should reimplement all fioelds and add to toolbar.

Asynchronous ManageSieve requests are busted

It works... okay, most of the time. Sometimes it's stuttering. But if you have 2 accounts set up and restart the program, it completely crashes without even so much as an error message. It's likely that the way it's currently done is really stupid and based on a misunderstanding of how Qt works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.