Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions dynamic/raylib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
import os
import pathlib
import platform
import logging
from .version import __version__


logger = logging.getLogger(__name__)
MODULE = pathlib.Path(__file__).parent

def raylib_library_path():
Expand Down Expand Up @@ -54,9 +55,9 @@ def so_name():
try:
raylib_fname = raylib_library_path()
rl = ffi.dlopen(raylib_fname)
print('LOADED DYNAMICALLY SHARED LIB {} {}'.format(__version__, raylib_fname))
logger.warning('LOADED DYNAMICALLY SHARED LIB {} {}'.format(__version__, raylib_fname))
except Exception as e:
print(e)
logger.exception(e)

LIGHTGRAY =( 200, 200, 200, 255 )
GRAY =( 130, 130, 130, 255 )
Expand Down
14 changes: 9 additions & 5 deletions raylib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,22 @@
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

import sys
import logging

logger = logging.getLogger(__name__)

try:
from ._raylib_cffi import ffi, lib as rl
except ModuleNotFoundError:
print("\n*** ERROR LOADING NATIVE CODE ***\n")
print("See https://github.com/electronstudio/raylib-python-cffi/issues/142\n", file=sys.stderr)
print("Your Python is: "+str(sys.implementation)+"\n", file=sys.stderr)
logger.error("*** ERROR LOADING NATIVE CODE ***")
logger.error("See https://github.com/electronstudio/raylib-python-cffi/issues/142")
logger.error("Your Python is: %s", str(sys.implementation))
raise

from raylib._raylib_cffi.lib import *
from raylib.colors import *
from raylib.defines import *
import cffi
from .version import __version__

print("RAYLIB STATIC "+__version__+" LOADED", file=sys.stderr)

logger.warning("RAYLIB STATIC %s LOADED", __version__)