gregorio icon indicating copy to clipboard operation
gregorio copied to clipboard

Update scripts to Python 3.×

Open michalrus opened this issue 1 year ago • 3 comments

Hey, I noticed the scripts under fonts/ are still expecting Python 2.7 in FontForge, while Python 2 has reached end of life on Jan 1, 2020.

Recent FontForge versions also do not support it, I tried forcing 2.7, and this happened:

fontforge>   Could NOT find Python3 (missing: Python3_EXECUTABLE Python3_INCLUDE_DIRS
fontforge>   Python3_LIBRARIES Development Interpreter Development.Module
fontforge>   Development.Embed) (Required is at least version "3.6")

There's a tool helping with automated translation – https://docs.python.org/3/library/2to3.html – perhaps it could be used here? :pray:

Thank you for considering this!

michalrus avatar Jul 23 '23 22:07 michalrus

So far, as a workaround, this works:

find -iname '*.py' -not -name 'checkSyllabation.py' | xargs 2to3 -w

sed -r 's/(newfont\[glyphnumber\]\.width) = (width)/\1 = int(\2)/g' -i fonts/squarize.py

michalrus avatar Jul 23 '23 23:07 michalrus

Stupid question, but...can you fork, edit and create a merge request? Or: What's against it?

MaestroGlanz avatar Oct 25 '23 18:10 MaestroGlanz

Of course you can fork and make a pull request.

I may be able to update the scrips to python3 in mid November, but if @MaestroGlanz gets to it first, all the better.

eschwab avatar Oct 28 '23 16:10 eschwab