import platform

def is_tingbot():
    """return True if running as a tingbot. We can update this function to be more smart in future"""
    return platform.machine().startswith('armv71')

if platform.system() == 'Darwin':
    from osx import fixup_env, create_main_surface, register_button_callback
elif is_tingbot():
    from pi import fixup_env, create_main_surface, register_button_callback
else:
    from sdl_wrapper import fixup_env, create_main_surface, register_button_callback

import platform, os

def is_tingbot():
    """
    Return True if running as a tingbot.
    """
    # TB_RUN_ON_LCD is an environment variable set by tbprocessd when running tingbot apps.
    return 'TB_RUN_ON_LCD' in os.environ

if platform.system() == 'Darwin':
    from osx import fixup_env, create_main_surface, register_button_callback
elif is_tingbot():
    from pi import fixup_env, create_main_surface, register_button_callback
else:
    from sdl_wrapper import fixup_env, create_main_surface, register_button_callback

Change test for running on Tingbot
Change test for running on Tingbot
