Git Product home page Git Product logo

ssgums / pyegi Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 0.0 998 KB

Pyegi is a package manager for applying scripts written in Python to subtitle lines directly within Aegisub software. It also enables users to install, update, and uninstall the scripts.

Home Page: https://pyegi.gitbook.io/pyegi/

License: MIT License

Lua 14.18% Python 78.84% CSS 1.22% Batchfile 0.14% PowerShell 2.79% MoonScript 2.83%
aegisub aegisub-automation aegisub-scripts python-scripts script-manager python

pyegi's Introduction

Pyegi

Pyegi is a package manager for applying scripts written in Python to subtitle lines directly within Aegisub software. It also enables users to install, update, and uninstall the scripts.

๐Ÿ“š Documentation

Features

  • Direct execution of Python scripts from Aegisub
  • Supports Python 3.9, 3.10, and 3.11 (Embedded)
  • Provides a list of installable/updatable scripts provided by feeds
  • Auto installation of scripts and their dependencies
  • Python scripts have access to the Aegisub's script parameters
  • Disk space optimized script installation
  • Animated preview support for each script
  • Themes support (Dark Mode included)
  • Provides a GUI maker platform for scripts (based on Aegisub's script GUI platform parameters)
  • Custom-made GUIs support

Screenshots

Picture Dictionary

Pyegi's Main Window

Pyegi's Scripts Management Window

Colormania's GUI as an example

pyegi's People

Contributors

drunksimurgh avatar ssgums avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pyegi's Issues

Supporting "all lines"/"selected lines" choice as well as "apply on"

It's probably better to include a dropdown object in the main GUI providing the choices to apply script on "selected lines" or "all lines".
It's also a good idea to have a checkbox object in the GUI corresponding to the python script as "Apply script on line(s) corresponding to the same:" with a following dropdown containing these options: "Style", "Actor", "Effect" and also provide a dropdown for each one of these.

Wrong line numbers for new lines

the lua script doesn't respect lines' order. it reverses it.
in addition to the mentioned issue, because we don't take into account lines added, I think if multiple selected lines exist, new lines for lines other than the first one will be added in a wrong position.

Line Filter Refactor

As we want to have separate macro for each automation, we need to have these options on parameters' gui

Adding filter to the main GUI

To navigate easily through the [possibly] many scripts in the list we can add an edit control object to the main GUI and search through the names of the scripts in the list containing the text in that edit control object.

Also, in order to distinguish between karaoke effects and typesetting scripts we can:

  • either recommend the developers to name the folder of their script (which is also currently the name that's shown in the script list) with a [KFX] at the end of the folder name (e.g.: sakura [KFX]) and name the typesetting script with a [TS] at the end
  • or recommend the developers to add a variable to the parameters file of their scripts for karaoke effects (e.g.: kfx: Boolean) and we use that variable to name the scripts in the main GUI list properly.

This way we can search for [KFX] and [TS] in the edit control object to list all the karaoke effects and all the typesetting scripts respectively.

Replace all lua regex with re

For avoiding utf issues, lua's regex must be avoided. Regex from re is the best alternative. It's a real Regex too.

GUI parameters files management

For now include three JSON files for parameters:

  1. A file to construct the GUI related to the python script named "gui_params.json".
  2. A file to store the user's selection so that the python script can read from named "gui_returned_values.json".
  3. A file to store the default values named "gui_params_default.json" (initially the "gui_params.json" is the same as "gui_params_default.json").

Multi Profile Support

User can save settings as profile for the script and load them and choose default between them

settings.json should refactor to this format too:

{
    "Default Profile": "Ali Fav",
    "Profiles": [
        {
            "Name": "Default",
            "Line Filter": {
                "Line Type": "Selected"
            },
            "Controls": [
                {
                    "name": "label1",
                    "x": 0,
                    "label": "Direction:",
                    "y": 0,
                    "class": "label",
                    "height": 1,
                    "width": 1
                },
                {
                    "x": 1,
                    "y": 0,
                    "class": "dropdown",
                    "items": [
                        "Horizontal",
                        "Vertical",
                        "Slant",
                        "Oval"
                    ],
                    "hint": "",
                    "value": "Horizontal",
                    "width": 1,
                    "name": "dropdown1",
                    "height": 1
                },
                {
                    "max": 1000000,
                    "x": 2,
                    "y": 0,
                    "class": "floatedit",
                    "min": -1000000,
                    "hint": "The angle:\n in case you are selecting Slant",
                    "value": 45,
                    "step": 0.01,
                    "width": 1,
                    "name": "floatedit1",
                    "height": 1
                }
            ]
        },
        {
            "Name": "Ali Fav",
            "Line Filter": {
                "Line Type": "Selected",
                "Filter Type": "Style",
                "Filter Term": "Mohsen"
            },
            "Controls": [
                {
                    "name": "label1",
                    "x": 0,
                    "label": "Direction:",
                    "y": 0,
                    "class": "label",
                    "height": 1,
                    "width": 1
                },
                {
                    "x": 1,
                    "y": 0,
                    "class": "dropdown",
                    "items": [
                        "Horizontal",
                        "Vertical",
                        "Slant",
                        "Oval"
                    ],
                    "hint": "",
                    "value": "Horizontal",
                    "width": 1,
                    "name": "dropdown1",
                    "height": 1
                },
                {
                    "max": 1000000,
                    "x": 2,
                    "y": 0,
                    "class": "floatedit",
                    "min": -1000000,
                    "hint": "The angle:\n in case you are selecting Slant",
                    "value": 45,
                    "step": 0.01,
                    "width": 1,
                    "name": "floatedit1",
                    "height": 1
                }
            ]
        }
    ]
}

Update feed

We must implement an update feed like dependency control that allows user to install new scripts and update the existing ones. we should install dependencies from requirements.txt if exists

more samples

We should have some already implemented useful samples from the beginning. We have 2 now. but a few more is better

automate deploy

I don't know a good solution to develop and test it on aegisub concurrently. I use vscode myself and I'm ok with it. Whole project folder is under my control and i can easily change and edit files. I have lua linting and... but the problem is after each change, I should copy project's files to aegisub's folder. It's frustrating. for just a one file is ok. for example I have both pyegi.lua opened in my editor and copy contents between them. but sometimes changes are multiple files. It increases the probability of human errors too.
I think we should have a simple automated task to handle the synchronization.

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.