|
6 | 6 | # In this example kivy-lang is used to declare the layout which |
7 | 7 | # contains two buttons (back, forward) and the browser view. |
8 | 8 |
|
9 | | -from kivy.app import App |
10 | | -from kivy.uix.widget import Widget |
11 | | -from kivy.graphics import Color, Rectangle, GraphicException |
12 | | -from kivy.clock import Clock |
13 | | -from kivy.graphics.texture import Texture |
14 | | -from kivy.core.window import Window |
15 | | -from kivy.lang import Builder |
16 | | -from kivy.uix.boxlayout import BoxLayout |
17 | | -from kivy.base import EventLoop |
18 | | - |
19 | | -####CEF IMPORT #### |
| 9 | +# On Linux importing the cefpython module must be the very |
| 10 | +# first in your application. This is because CEF makes a global |
| 11 | +# tcmalloc hook for memory allocation/deallocation. See Issue 73 |
| 12 | +# that is to provide CEF builds with tcmalloc hook disabled: |
| 13 | +# https://code.google.com/p/cefpython/issues/detail?id=73 |
20 | 14 | import ctypes, os, sys |
21 | | -libcef_so = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'libcef.so') |
| 15 | +libcef_so = os.path.join(os.path.dirname( |
| 16 | + os.path.abspath(__file__)), 'libcef.so') |
22 | 17 | if os.path.exists(libcef_so): |
23 | 18 | # Import local module |
24 | 19 | ctypes.CDLL(libcef_so, ctypes.RTLD_GLOBAL) |
|
30 | 25 | # Import from package |
31 | 26 | from cefpython3 import cefpython |
32 | 27 |
|
| 28 | +from kivy.app import App |
| 29 | +from kivy.uix.widget import Widget |
| 30 | +from kivy.graphics import Color, Rectangle, GraphicException |
| 31 | +from kivy.clock import Clock |
| 32 | +from kivy.graphics.texture import Texture |
| 33 | +from kivy.core.window import Window |
| 34 | +from kivy.lang import Builder |
| 35 | +from kivy.uix.boxlayout import BoxLayout |
| 36 | +from kivy.base import EventLoop |
33 | 37 |
|
34 | 38 | ####Kivy APP #### |
35 | 39 | Builder.load_string(""" |
|
0 commit comments