diff --git a/doc/sources/guide/environment.rst b/doc/sources/guide/environment.rst index ba608eae6..75c36695d 100644 --- a/doc/sources/guide/environment.rst +++ b/doc/sources/guide/environment.rst @@ -52,6 +52,12 @@ KIVY_SDL2_PATH .. versionadded:: 1.9.0 + .. warning:: + + Must be used during the compilation of Kivy. It is not required for the + execution. + + Configuration ------------- @@ -68,6 +74,17 @@ KIVY_NO_FILELOG KIVY_NO_CONSOLELOG If set, logs will be not print on the console +KIVY_NO_ARGS + If set, the argument passed in command line will not be parsed and used by Kivy. + Ie, you can safely make a script or an app with your own arguments without + requiring the `--` delimiter:: + + import os + os.environ["KIVY_NO_ARGS"] = "1" + import kivy + + .. versionadded:: 1.9.0 + Restrict core to specific implementation ---------------------------------------- diff --git a/kivy/__init__.py b/kivy/__init__.py index 0466f2e65..92e9870ab 100644 --- a/kivy/__init__.py +++ b/kivy/__init__.py @@ -282,7 +282,9 @@ if not environ.get('KIVY_DOC_INCLUDE'): Logger.setLevel(level=level) # Can be overrided in command line - if 'KIVY_UNITTEST' not in environ and 'KIVY_PACKAGING' not in environ: + if ('KIVY_UNITTEST' not in environ and + 'KIVY_PACKAGING' not in environ and + 'KIVY_NO_ARGS' not in environ): # save sys argv, otherwize, gstreamer use it and display help.. sys_argv = sys.argv sys.argv = sys.argv[:1]