Skip to content

Commit 62f8cf0

Browse files
committed
Added __version__ and __author__ to cefpython1 package.
Updated wxpython.py example, there is now an option to use EVT_IDLE or EVT_TIMER through USE_EVT_IDLE global variable.
1 parent a47eb06 commit 62f8cf0

File tree

8 files changed

+80
-11
lines changed

8 files changed

+80
-11
lines changed

cefpython/cef1/windows/binaries/cefadvanced.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,16 @@ def Rebind(self):
203203
class ClientHandler:
204204

205205
def OnLoadStart(self, browser, frame):
206-
# print("OnLoadStart(): frame URL: %s" % frame.GetURL())
206+
# print("OnLoadStart(): frame url: %s" % frame.GetUrl())
207207
pass
208208

209209
def OnLoadEnd(self, browser, frame, httpStatusCode):
210-
# print("OnLoadEnd(): frame URL: %s" % frame.GetURL())
210+
# print("OnLoadEnd(): frame url: %s" % frame.GetUrl())
211211
pass
212212

213-
def OnLoadError(self, browser, frame, errorCode, failedURL, errorText):
214-
# print("OnLoadError() failedURL: %s" % (failedURL))
215-
errorText[0] = ("Custom error message when loading URL fails, "
213+
def OnLoadError(self, browser, frame, errorCode, failedUrl, errorText):
214+
# print("OnLoadError() failedUrl: %s" % (failedUrl))
215+
errorText[0] = ("Custom error message when loading url fails, "
216216
"see: def OnLoadError()")
217217
return True
218218

cefpython/cef1/windows/binaries/wxpython.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@
1919

2020
import wx
2121

22+
# Which method to use for message loop processing.
23+
# EVT_IDLE - wx application has priority (default)
24+
# EVT_TIMER - cef browser has priority
25+
# From the tests it seems that Flash content behaves
26+
# better when using a timer.
27+
USE_EVT_IDLE = True
28+
2229
def GetApplicationPath(file=None):
2330
import re, os
2431
# If file is None return current directory without trailing slash.
@@ -69,7 +76,9 @@ def __init__(self):
6976
self.Bind(wx.EVT_SET_FOCUS, self.OnSetFocus)
7077
self.Bind(wx.EVT_SIZE, self.OnSize)
7178
self.Bind(wx.EVT_CLOSE, self.OnClose)
72-
self.Bind(wx.EVT_IDLE, self.OnIdle)
79+
if USE_EVT_IDLE:
80+
# Bind EVT_IDLE only for the main application frame.
81+
self.Bind(wx.EVT_IDLE, self.OnIdle)
7382

7483
def CreateMenu(self):
7584
filemenu = wx.Menu()
@@ -96,13 +105,35 @@ def OnIdle(self, event):
96105
cefpython.MessageLoopWork()
97106

98107
class MyApp(wx.App):
108+
timer = None
109+
timerID = 1
99110

100111
def OnInit(self):
112+
if not USE_EVT_IDLE:
113+
self.CreateTimer()
101114
frame = MainFrame()
102115
self.SetTopWindow(frame)
103116
frame.Show()
104117
return True
105118

119+
def CreateTimer(self):
120+
# See "Making a render loop":
121+
# http://wiki.wxwidgets.org/Making_a_render_loop
122+
# Another approach is to use EVT_IDLE in MainFrame,
123+
# see which one fits you better.
124+
self.timer = wx.Timer(self, self.timerID)
125+
self.timer.Start(10) # 10ms
126+
wx.EVT_TIMER(self, self.timerID, self.OnTimer)
127+
128+
def OnTimer(self, event):
129+
cefpython.SingleMessageLoop()
130+
131+
def OnExit(self):
132+
# When app.MainLoop() returns, MessageLoopWork() should
133+
# not be called anymore.
134+
if not USE_EVT_IDLE:
135+
self.timer.Stop()
136+
106137
if __name__ == '__main__':
107138
sys.excepthook = ExceptHook
108139
settings = {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
import cefpython_py27 as cefpython
2+
3+
__version__ = "0.52"
4+
__author__ = "Czarek Tomczak <[email protected]>"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import cefpython_py27 as cefpython
2+
3+
__version__ = "%(APP_VERSION)s"
4+
__author__ = "Czarek Tomczak <[email protected]>"

cefpython/cef1/windows/installer/innosetup.iss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ DisableProgramGroupPage = no
2626
UsePreviousAppDir = yes
2727
UsePreviousGroup = yes
2828

29-
SourceDir = C:\cefpython\cefpython\cefpython\cef1\windows\binaries
30-
OutputDir = C:\cefpython\cefpython\cefpython\cef1\windows\installer\Output
29+
SourceDir = C:\cefpython\cefpython-src\cefpython\cef1\windows\binaries
30+
OutputDir = C:\cefpython\cefpython-src\cefpython\cef1\windows\installer\Output
3131
OutputBaseFilename = cefpython1_v0.52_win32_installer
3232

3333
UninstallFilesDir = {app}\cefpython1
34-
LicenseFile = C:\cefpython\cefpython\cefpython\cef1\windows\binaries\LICENSE.txt
34+
LicenseFile = C:\cefpython\cefpython-src\cefpython\cef1\windows\binaries\LICENSE.txt
3535

3636
[Icons]
3737

@@ -47,7 +47,7 @@ Filename: "{app}\cefpython1\examples"; Flags: postinstall shellexec;
4747
Source: "*.dll"; DestDir: "{app}\cefpython1"; Flags: ignoreversion;
4848
Source: "*.pak"; DestDir: "{app}\cefpython1"; Flags: ignoreversion;
4949
Source: "locales\*.pak"; DestDir: "{app}\cefpython1\locales"; Flags: ignoreversion;
50-
Source: "C:\cefpython\cefpython\cefpython\cef1\windows\installer\__init__.py.install"; DestDir: "{app}\cefpython1"; DestName: "__init__.py"; Flags: ignoreversion;
50+
Source: "C:\cefpython\cefpython-src\cefpython\cef1\windows\installer\__init__.py.install"; DestDir: "{app}\cefpython1"; DestName: "__init__.py"; Flags: ignoreversion;
5151
Source: "cefclient.exe"; DestDir: "{app}\cefpython1"; Flags: ignoreversion;
5252
Source: "cefpython_py27.py"; DestDir: "{app}\cefpython1"; Flags: ignoreversion;
5353
Source: "cefpython_py27.pyd"; DestDir: "{app}\cefpython1"; Flags: ignoreversion;

cefpython/cef1/windows/installer/make_installer.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ def main():
4242

4343
print("Saved: %s" % ISS_FILE)
4444

45+
initPyTemplate = os.getcwd()+r"\__init__.py.template"
46+
initPyInstall = os.getcwd()+r"\__init__.py.install"
47+
48+
f = open(initPyTemplate)
49+
initPyTemplateCode = f.read()
50+
f.close()
51+
52+
f = open(initPyInstall, "w")
53+
f.write(initPyTemplateCode % vars)
54+
f.close()
55+
print("Saved: %s" % initPyInstall)
56+
4557
iscc_command = '"'+ ISCC + '" ' + ISS_FILE
4658
print("Running ISCC: %s" % iscc_command)
4759
os.system(iscc_command)

cefpython/var/linux/linux.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,13 @@ Binary package
1414
cd /path/to/chromium/src/cef/tools
1515
make_distrib.sh --allow-partial
1616
If the process succeeds a binary distribution package
17-
will be created in the /path/to/chromium/src/cef/binary_distrib directory.
17+
will be created in the /path/to/chromium/src/cef/binary_distrib directory.
18+
19+
Commands
20+
--------
21+
schroot -c precise32 # change chroot to precise32
22+
sudo schroot -a -e # -end -all chroots & sessions
23+
schroot -l # list all chroots
24+
25+
chromium/install-chroot.sh
26+
echo "-c always copy 64bit helper binaries to 32bit chroot"

cefpython/var/linux/nano.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
copy/paste:
2+
Select: ALT + M + A
3+
Copy: ALT + 6
4+
Paste: CTRL + U
5+
6+
MC:
7+
Zawsze mozesz uzywac wbudowanego edytora ala nortonowskiego
8+
wtedy F3 mark
9+
F5 copy
10+
F2 save itp

0 commit comments

Comments
 (0)