[-] UlrikHD@programming.dev 1 points 8 months ago

@jnovinger@programming.dev

Just a reminder that we sent you a DM some time ago, but have yet to receive an answer. Happy cake day :)

-The admin team

[-] UlrikHD@programming.dev 1 points 1 year ago* (last edited 1 year ago)

I don't have any experience with pipx and personally prefer to just skip the .toml and place the whole pyprojectsetup in setup.py.

With that method, I would write inside setup()

packages=find_packages()  # Include every python packages
package_data={  # Specify additional data files
    'yourpackagename': [
        'config/*'
        etc...
    ]
}

This would however require you to have a package folder which all your package files/folders are inside, meaning the top level repo folder should not have any files or other folders that you want to distribute. Your MANIFEST.in looks fine.

[-] UlrikHD@programming.dev 1 points 1 year ago

Interesting stuff, might give me an excuse to look into rust in the future. Thanks!

[-] UlrikHD@programming.dev 1 points 1 year ago* (last edited 1 year ago)

As others have suggested, ffmpeg is a great cli tool. If you aren't comfortable with the terminal you can do it via python like this:

import os
import sys
import subprocess


def crop_media(file_name: str, w: int, h: int, x: int, y: int, new_dir: str) -> None:
    try:
        subprocess.run(f'ffmpeg -i "{file_name}" -vf "crop={w}:{h}:{x}:{y}" temp.gif -y',
                           shell=True, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
        os.rename('temp.gif', os.path.join(new_dir, file_name))
    # Print the error and continue with other gifs, remove try block if you want a complete stop
    except subprocess.CalledProcessError as e:
        print(e)
    except KeyboardInterrupt:
        print('KeyboardInterrupt, cleaning up files...')
        os.remove('temp.gif')
        sys.exit(0)


def crop_directory(directory: str, w: int, h: int, x: int, y: int, new_dir: str) -> None:
    for root, _, files in directory:
        for file in files:
            if not file.endswith('.gif'):
                continue
            if os.path.isfile(os.path.join(new_dir, file)):
                print(f'{file} already exists in {new_dir}, skipping...')
                continue

            file_path = os.path.normpath(os.path.join(root, file))
            crop_media(file_path, w, h, x, y, new_dir)


if __name__ == '__main__':
    width = 0
    height = 0
    x_offset = 0
    y_offset = 0
    gif_directory = ''
    new_directory = ''
    crop_directory(gif_directory, width, height, x_offset, y_offset, new_directory)

This should go through every file in the directory and subdirectories and call the ffmpeg command on each .gif. With new_directory you can set a directory to store every cropped .gif. The ffmpeg command is based on johnpiers suggestion.

The script assumes unique filenames for each gif and should work with spaces in the filenames. If they aren't unique, you can just remove the new_directory part, but you will then lose the original gif that you cropped.

[-] UlrikHD@programming.dev 1 points 1 year ago

Could you elaborate on that point? Is it as smooth as using C?

[-] UlrikHD@programming.dev 1 points 2 years ago* (last edited 2 years ago)

In the ancient times, the escape button wasn't at the upper left corner, but to the left of Q (ADM-A3). Vi (and by extension Vim) just haven't adapted to a different keyboard layout.

[-] UlrikHD@programming.dev 1 points 2 years ago

Strange, is there really no report button on lemmy/Jerboa?

[-] UlrikHD@programming.dev 1 points 2 years ago

Control over one of the biggest "news" sites in the world probably.

[-] UlrikHD@programming.dev 1 points 2 years ago

Kaedrin mod manager, runcher, Prop Joe's manager and a deprecated one by a user on the modding discord. We got plenty of mod managers in development but nothing as developed as vortex.

Vortex allows for profiles, configuration during installation, easy install for central "mods", very visible mod version, etc...

I'm sure runcher/Frodo's new mod manager will get there, but my point is vortex got everything a user and a modder may want for that game.

Also, I'm not sure if Kaedrin is actively developing his mod manager, he doesn't seem very active on the discord.

[-] UlrikHD@programming.dev 1 points 2 years ago

What's the problem with vortex? As a modder for total war, I dream about the day total war would get a mod launcher like that.

[-] UlrikHD@programming.dev 1 points 2 years ago

Except that you have to know exactly what is, character for character, and usually includes some long string of numbers and letters where 1 character is wrong and you have to retype the whole damn thing. This is the opposite of easy.

If it a program you are unfamiliar with, yes you'll probably need to search for the apt name and copy paste. I much prefer that over searching a website, verifying it's not a scam site, then download the exe, and then run the exe once the download is finished. After the first time, just add it to a .sh script and then you can download every program you need automatically if you ever need to set up a new instance again.

I guess it's not for all, but worst case it's hardly any more work than needing to go to a website to download the exe.

[-] UlrikHD@programming.dev 1 points 2 years ago

Other than now lemmy, the only other apps I use are Firefox and email/messaging apps. Hardly need that much performance.

view more: ‹ prev next ›

UlrikHD

joined 2 years ago