From c3956b000fdff4f6e12651532b58cde6a81f495f Mon Sep 17 00:00:00 2001 From: eriksandberg Date: Sat, 21 Dec 2019 13:51:52 -0600 Subject: [PATCH] When working on iOS, the path to the garden module is fixed. Assumes garden flowers have been added to the project by using `garden install --app flower_name`, which adds the flower to a folder named `lib`, which should be in the same directory as main.py --- kivy/garden/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kivy/garden/__init__.py b/kivy/garden/__init__.py index fc7ae8e3c..68b823892 100644 --- a/kivy/garden/__init__.py +++ b/kivy/garden/__init__.py @@ -140,6 +140,7 @@ import sys import imp from os.path import dirname, join, realpath, exists, abspath from kivy import kivy_home_dir +from kivy.utils import platform import kivy #: system path where garden modules can be installed @@ -151,6 +152,12 @@ if getattr(sys, 'frozen', False) and getattr(sys, '_MEIPASS', False): garden_app_dir = join(realpath(sys._MEIPASS), 'libs', 'garden') else: garden_app_dir = join(realpath(dirname(sys.argv[0])), 'libs', 'garden') +#: Fixes issue #4030 in kivy where garden path is incorrect on iOS +if platform == "ios": + from os.path import join, dirname + import __main__ + main_py_file = __main__.__file__ + garden_app_dir = join(dirname(main_py_file), 'libs', 'garden') class GardenImporter(object):