gftools icon indicating copy to clipboard operation
gftools copied to clipboard

[wish] Refactor, move more advanced logic from `bin` scripts to Lib

Open twardoch opened this issue 3 years ago • 2 comments

@m4rc1e @felipesanches

GFTools is a collection of somewhat random scripts. Many of them are useful, but above all, many of them contain code that could be useful for other purposes. As an example, gftools-udhr.py contains a useful parser for UDHR XMLs, and it’d be good to move the classes to a separate module in the lib, and make the CLI tool very shallow.

For example, the classes could be in https://github.com/googlefonts/gftools/tree/main/Lib/gftools/udhr.py and the script could just import that (for backwards compatibility, it could do from gftools.udhr import *) and then do very minimal logic. Well, in fact that particular script does not really have any CLI stuff at all :)

What do you think?

twardoch avatar Jul 08 '21 16:07 twardoch

sounds good

felipesanches avatar Jul 08 '21 17:07 felipesanches

Agreed.

The fix scripts already have their own module, https://github.com/googlefonts/gftools/blob/main/Lib/gftools/fix.py

m4rc1e avatar Jul 15 '21 08:07 m4rc1e

Fixed by #638.

simoncozens avatar Nov 30 '22 16:11 simoncozens