Trying to use a Glyphs.function() from within an imported file

I have the following situation which is not working,

In a script ‘kernMaker’ I have this function:

def subCat(eachGlyph, subCat):
	if Glyphs.glyphInfoForName( eachGlyph ).subCategory == subCat:
		return True
	else:
		return False

Which is being called later in the same script. kernMaker is used by other another script. But I get this error:

Start
Traceback (most recent call last):
  File "./kernMakerFuncB.py", line 5, in subCat
    if Glyphs.glyphInfoForName( eachGlyph ).subCategory == subCat:
NameError: global name 'Glyphs' is not defined
End

How could I solve this? Full gist here

Oh I had found a solution a long time ago:

I just have to add

if __name__ != '__main__':
	from __main__ import *
import GlyphsApp

To the start of the kernMaker script.