gregorio-project / gregorio

The Gregorio Project
http://gregorio-project.github.io
Other
162 stars 43 forks source link

Update scripts to Python 3.× #1579

Open michalrus opened 1 year ago

michalrus commented 1 year ago

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 commented 1 year ago

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
ghost commented 11 months ago

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

eschwab commented 11 months ago

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.