class MakefileOnly(AutoconfProject):
    build_cmd = 'make'

@classmethod
def match(cls, base):
    ret = super(MakefileOnly, cls).match(base)
if ret is not None:
    return ret
if path.isfile(path.join(base, 'Makefile')):
    return cls()
return None
Factory method in python