Skip to content

Commit e0ef669

Browse files
committed
Windows 64-bit support (cztomczak#316)...
Minor fixes to tools. Add cef.GetVersion() function with keys like cef_version, chrome_version etc. Print architecture along with python version in examples/tools.
1 parent ed758d8 commit e0ef669

File tree

17 files changed

+226
-123
lines changed

17 files changed

+226
-123
lines changed

api/cefpython.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Table of contents:
1717
* [GetCommandLineSwitch](#getcommandlineswitch)
1818
* [GetGlobalClientCallback](#getglobalclientcallback)
1919
* [GetModuleDirectory](#getmoduledirectory)
20+
* [GetVersion](#getversion)
2021
* [Initialize](#initialize)
2122
* [IsThread](#isthread)
2223
* [MessageLoop](#messageloop)
@@ -144,6 +145,22 @@ Returns a global client callback that was set using SetGlobalClientCallback(). R
144145
Get the cefpython module directory. This method is useful to get full path to CEF binaries. This is required when setting [ApplicationSettings](ApplicationSettings.md) options like: 'browser_subprocess_path', 'resources_dir_pat' and 'locales_dir_path'.
145146

146147

148+
### GetVersion
149+
150+
| | |
151+
| --- | --- |
152+
| __Return__ | dict |
153+
154+
Return CEF Python and CEF versions dictionary with keys:
155+
* version
156+
* chrome_version
157+
* cef_version
158+
* cef_api_hash_platform
159+
* cef_api_hash_universal
160+
* cef_commit_hash
161+
* cef_commit_number
162+
163+
147164
### Initialize
148165

149166
| Parameter | Type |

docs/API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# API
22

3-
API reference is available in the root [api/](../api) directory.
3+
API reference is available in the [api/](../api) root directory.

examples/gtk2.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
import pygtk
99
import gtk
1010
import gobject
11-
import sys
1211
import os
1312
import platform
13+
import sys
1414

1515
# Fix for PyCharm hints warnings when using static methods
1616
WindowUtils = cef.WindowUtils()
@@ -50,7 +50,8 @@ def main():
5050

5151
def check_versions():
5252
print("[gkt2.py] CEF Python {ver}".format(ver=cef.__version__))
53-
print("[gkt2.py] Python {ver}".format(ver=sys.version[:6]))
53+
print("[gkt2.py] Python {ver} {arch}".format(
54+
ver=platform.python_version(), arch=platform.architecture()[0]))
5455
print("[gkt2.py] GTK {ver}".format(ver='.'.join(
5556
map(str, list(gtk.gtk_version)))))
5657
assert cef.__version__ >= "55.3", "CEF Python v55.3+ required to run this"

examples/gtk3.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939

4040
def main():
4141
print("[gkt3.py] CEF Python {ver}".format(ver=cef.__version__))
42-
print("[gkt3.py] Python {ver}".format(ver=sys.version[:6]))
42+
print("[gkt3.py] Python {ver} {arch}".format(
43+
ver=platform.python_version(), arch=platform.architecture()[0]))
4344
print("[gkt3.py] GTK {major}.{minor}".format(
4445
major=Gtk.get_major_version(),
4546
minor=Gtk.get_minor_version()))

examples/hello_world.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Tested with CEF Python v55.3+.
33

44
from cefpython3 import cefpython as cef
5+
import platform
56
import sys
67

78

@@ -16,7 +17,8 @@ def main():
1617

1718
def check_versions():
1819
print("[hello_world.py] CEF Python {ver}".format(ver=cef.__version__))
19-
print("[hello_world.py] Python {ver}".format(ver=sys.version[:6]))
20+
print("[hello_world.py] Python {ver} {arch}".format(
21+
ver=platform.python_version(), arch=platform.architecture()[0]))
2022
assert cef.__version__ >= "55.3", "CEF Python v55.3+ required to run this"
2123

2224

examples/qt4.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ def main():
7676

7777
def check_versions():
7878
print("[qt4.py] CEF Python {ver}".format(ver=cef.__version__))
79-
print("[qt4.py] Python {ver}".format(ver=sys.version[:6]))
79+
print("[qt4.py] Python {ver} {arch}".format(
80+
ver=platform.python_version(), arch=platform.architecture()[0]))
8081
# PyQt version
8182
if "pyqt" in sys.argv:
8283
# noinspection PyUnresolvedReferences

examples/tkinter_.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def main():
4747
stream_handler.setFormatter(formatter)
4848
logger.addHandler(stream_handler)
4949
logger.info("CEF Python {ver}".format(ver=cef.__version__))
50-
logger.info("Python {ver}".format(ver=sys.version[:6]))
50+
logger.info("Python {ver} {arch}".format(
51+
ver=platform.python_version(), arch=platform.architecture()[0]))
5152
logger.info("Tk {ver}".format(ver=tk.Tcl().eval('info patchlevel')))
5253
assert cef.__version__ >= "55.3", "CEF Python v55.3+ required to run this"
5354
sys.excepthook = cef.ExceptHook # To shutdown all CEF processes on error

examples/wxpython.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def main():
5050

5151
def check_versions():
5252
print("[wxpython.py] CEF Python {ver}".format(ver=cef.__version__))
53-
print("[wxpython.py] Python {ver}".format(ver=sys.version[:6]))
53+
print("[wxpython.py] Python {ver} {arch}".format(
54+
ver=platform.python_version(), arch=platform.architecture()[0]))
5455
print("[wxpython.py] wxPython {ver}".format(ver=wx.version()))
5556
# CEF Python version requirement
5657
assert cef.__version__ >= "55.3", "CEF Python v55.3+ required to run this"

src/cefpython.pyx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,3 +998,16 @@ cpdef object GetAppSetting(py_string key):
998998
if key in g_applicationSettings:
999999
return g_applicationSettings[key]
10001000
return None
1001+
1002+
cpdef dict GetVersion():
1003+
# These variable are set when building the module.
1004+
# noinspection PyUnresolvedReferences
1005+
return dict(
1006+
version=__version__,
1007+
chrome_version=__chrome_version__,
1008+
cef_version=__cef_version__,
1009+
cef_api_hash_platform=__cef_api_hash_platform__,
1010+
cef_api_hash_universal=__cef_api_hash_universal__,
1011+
cef_commit_hash=__cef_commit_hash__,
1012+
cef_commit_number=__cef_commit_number__,
1013+
)

src/compile_time_constants.pxi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# This file was generated by setup.py
22
DEF UNAME_SYSNAME = "Windows"
3-
DEF PY_MAJOR_VERSION = 2
3+
DEF PY_MAJOR_VERSION = 3

0 commit comments

Comments
 (0)