Glyphs-Scripts icon indicating copy to clipboard operation
Glyphs-Scripts copied to clipboard

New tab with modified glyphs not working in 3.4

Open laepage opened this issue 8 months ago • 6 comments

Hello! I would like to use your fantastic script, but I encountered an error:

File "vanillaBase.py", line 539, in action_ self.callback(sender)

File "newTabModifiedGlyphs.py", line 44, in buttonCallback if glyph.lastChange > unixtime: ^^^^^^^^^^^^^^^^^^^^^^^^^^^

TypeError: '>' not supported between instances of 'NoneType' and 'float'

laepage avatar Mar 19 '25 06:03 laepage

Hi! For some reason all glyphs are returning none when trying to get lastChange

@schriftgestalt do you know what can be causing this?

Image

guidoferreyra avatar Mar 19 '25 12:03 guidoferreyra

g.lastChange is None if it was never "changed", e.g. for new files. But also note that lastChange is not stored in glyphpackage files. So if you open a glyphspackage file, all lastChange is None.

schriftgestalt avatar Mar 19 '25 13:03 schriftgestalt

Sorry, then it’s a situation at my end, because I’m using glyphspackage files (good for debugging too)

laepage avatar Mar 19 '25 14:03 laepage

Oh right, I’m using glyphspackage too on most of my projects :/

g.lastChange is None if it was never "changed", e.g. for new files. But also note that lastChange is not stored in glyphpackage files. So if you open a glyphspackage file, all lastChange is None.

guidoferreyra avatar Mar 19 '25 15:03 guidoferreyra

If you have your .glyphspackage stored in a Git repository, you can use my Light Table plugin to open a new tab with the changed glyphs or layers:

These actions differ in that they are with respect to the last commit, not the last time you saved the document.

florianpircher avatar Mar 19 '25 16:03 florianpircher

What do you mean by "modified glyphs". doesn’t it mean "since I opened the file"? Then you only need to add a check for None and it should work as before?

schriftgestalt avatar Mar 19 '25 16:03 schriftgestalt