#NEWLINE# def is_supported( ) : #NEWLINE# #INDENT# ' Return True if Lua scripting is supported ' #NEWLINE# global _supported #NEWLINE# if ( _supported is not None ) : #NEWLINE# #INDENT# return _supported #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# import lupa #NEWLINE# #UNINDENT# except ImportError : #NEWLINE# #INDENT# log . msg ( "WARNING: Lua scripting is not available because 'lupa' Python package is not installed" ) #NEWLINE# _supported = False #NEWLINE# return False #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# lua = lupa . LuaRuntime ( ) #NEWLINE# #UNINDENT# except lupa . LuaError as e : #NEWLINE# #INDENT# log . msg ( ( 'WARNING: Lua scripting is not available: %r' % e ) ) #NEWLINE# _supported = False #NEWLINE# return False #NEWLINE# #UNINDENT# _supported = True #NEWLINE# return True