From a00a511884299cae4bbad18a709b3c07e2aa4790 Mon Sep 17 00:00:00 2001 From: Michael Herrmann Date: Fri, 26 Apr 2019 13:43:15 +0200 Subject: Update deployment docs for fbs 0.7.6 Change-Id: I92054ee657899960f9efd2056ab7851a3fe21fe6 Reviewed-by: Cristian Maureira-Fredes --- sources/pyside2/doc/deployment-fbs.rst | 20 +++++++------------- sources/pyside2/doc/deployment.rst | 10 ++++++---- 2 files changed, 13 insertions(+), 17 deletions(-) (limited to 'sources/pyside2/doc') diff --git a/sources/pyside2/doc/deployment-fbs.rst b/sources/pyside2/doc/deployment-fbs.rst index 94c52a08b..ff489f745 100644 --- a/sources/pyside2/doc/deployment-fbs.rst +++ b/sources/pyside2/doc/deployment-fbs.rst @@ -14,9 +14,9 @@ options. Preparation =========== -Installing `fbs` can be done via **pip**:: +Installing `fbs` (>= 0.7.6) can be done via **pip**:: - pip install fbs pyinstaller==3.4 + pip install fbs If you are using a virtual environment, remember to activate it before installing it. @@ -62,18 +62,12 @@ The main file will be under the `python` directory, and its content by default i import sys - class AppContext(ApplicationContext): # 1. Subclass ApplicationContext - def run(self): # 2. Implement run() - window = QMainWindow() - version = self.build_settings['version'] - window.setWindowTitle("MyApp v" + version) - window.resize(250, 150) - window.show() - return self.app.exec_() # 3. End run() with this line - if __name__ == '__main__': - appctxt = AppContext() # 4. Instantiate the subclass - exit_code = appctxt.run() # 5. Invoke run() + appctxt = ApplicationContext() # 1. Instantiate ApplicationContext + window = QMainWindow() + window.resize(250, 150) + window.show() + exit_code = appctxt.app.exec_() # 2. Invoke appctxt.app.exec_() sys.exit(exit_code) The example will show an empty `QMainWindow`, and you can execute it by running:: diff --git a/sources/pyside2/doc/deployment.rst b/sources/pyside2/doc/deployment.rst index 582e38992..a125dc4d7 100644 --- a/sources/pyside2/doc/deployment.rst +++ b/sources/pyside2/doc/deployment.rst @@ -12,6 +12,7 @@ The options for a project are: 3. Freezing the application in a single binary file, or into a directory. For the **third** option, there are many available tools: + * `fbs `_, * `PyInstaller `_, * `cx_Freeze `_, * `py2exe `_, @@ -26,13 +27,14 @@ The following table summarizes the above mentioned tools support: =========== ======= ===== ===== ======= Name License Linux macOS Windows =========== ======= ===== ===== ======= +fbs GPL yes yes yes +PyInstaller GPL yes yes yes +cx_Freeze MIT yes yes yes py2exe MIT no no yes py2app MIT no yes no -cx_Freeze MIT yes yes yes -PyInstaller GPL yes yes yes =========== ======= ===== ===== ======= -From the table we can see that only *cx_Freeze* and *PyInstaller* +From the table we can see that only *fbs*, *cx_Freeze* and *PyInstaller* meet our requirements. All tools are command-line based, and it could become @@ -65,6 +67,6 @@ described tools. :name: mastertoc :maxdepth: 2 + deployment-fbs.rst deployment-pyinstaller.rst deployment-cxfreeze.rst - deployment-fbs.rst -- cgit v1.2.3