File tree 1 file changed +31
-0
lines changed 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ # pylint: disable=no-else-return, too-many-return-statements
2
+
3
+ """To check the platform"""
4
+
5
+ from sys import platform as _sys_platform
6
+ from os import environ
7
+
8
+
9
+ def _get_platform ():
10
+ kivy_build = environ .get ("KIVY_BUILD" , "" )
11
+ if kivy_build in {"android" , "ios" }:
12
+ return kivy_build
13
+ elif "P4A_BOOTSTRAP" in environ :
14
+ return "android"
15
+ elif "ANDROID_ARGUMENT" in environ :
16
+ return "android"
17
+ elif _sys_platform in ("win32" , "cygwin" ):
18
+ return "win"
19
+ elif _sys_platform == "darwin" :
20
+ return "macosx"
21
+ elif _sys_platform .startswith ("linux" ):
22
+ return "linux"
23
+ elif _sys_platform .startswith ("freebsd" ):
24
+ return "linux"
25
+ return "unknown"
26
+
27
+
28
+ platform = _get_platform ()
29
+
30
+ if platform not in ("android" , "unknown" ):
31
+ environ ["KIVY_CAMERA" ] = "opencv"
You can’t perform that action at this time.
0 commit comments