{ "info": { "author": "Leon Wiesen", "author_email": "", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Weasel's GUI Spices\nThis is the one and only GUI module you really need...\n\n## Features\n- Helper functions for PyInstaller builds\n- Tray icons with custom sub-menus\n- Windows Messages\n- Qt Creator windows\n- Windows Explorer extensions\n- Borderless *and* draggable windows\n- Easy custom CSS Styling\n\n# Helper functions for PyInstaller\nThese helper functions provide excellent support for building applications \nwith PyInstaller, fixing some major problems which usually occur at runtime.\nI highly suggest you to build all windowed and one-file applications with \nPyInstaller with these functions. This will save you **A LOT** of debugging time.\n\n### One-file build (-F option)\nIf you build a .exe with the -F option, the whole app gets bundled into a single \nexecutable with all resource files included. These are unpacked on execution. \nBut where? Use this function to refer to resource files whenever you plan to \nuse the -w option.\n```python\nfrom GUISpices.Utility import resource_path\n\n# opening a \"text.txt\" in the same directory\nf = open(resource_path(\"text.txt\"),\"r\")\nprint(f.read())\nf.close()\n```\nMake sure you attach your resource files upon build via `--add-data ` \nwhen running PyInstaller! In this case: `pyinstaller -F --add-data \"text.txt;text.txt\" main.py`\n\n### Windowed build (-w option)\nIf you build a .exe with the -w option, the app will execute without a terminal\nwindow. We usually want this for GUI-only applications. However, if your app \nneeds to fetch the output of a terminal command, your app either opens up a \nterminal or gets stuck because it is prohibited to do so. This function will \nexecute your terminal command and return the output as string (based on `subprocess.Popen`).\n```python\nfrom GUISpices.Utility import popen\n\nprint(popen(\"pwd\")) # Output -> \"C:\\Users\\User\\Desktop\"\n```\n\n# Code examples\n\n### Tray Icons\nThis example creates a classic icon in the bottom right tray.\n```python\nfrom PySide2.QtWidgets import QApplication, QMenu\nfrom GUISpices import TrayIcon\nimport sys\n\n# create main application (if not present)\napp = QApplication([])\napp.setQuitOnLastWindowClosed(False)\n\n# configure basic tray actions\ntray = TrayIcon(app, \"examples/icon.png\", \"Test Program\", click_action=lambda :print(\"Clicked\"))\ntray.add_menu_feature(\"Change Icon\", lambda: tray.set_icon(\"examples/icon2.png\"))\ntray.add_menu_feature(\"Show a message from tray\", lambda: tray.show_tray_message(\"Hello\", \"Hello my friend\"))\ntray.add_separator()\ntray.add_menu_feature(\"Exit\", app.exit)\n\n# Include a custom sub-menu\nmenu_ = QMenu(title=\"Sub Menu\")\nmenu_.addAction(\"Egg sit (sub-action)\", lambda: sys.exit(0))\ntray.add_menu(menu_)\n\nsys.exit(app.exec_())\n```\n\n### Windows Messages\nThis shows a tray icon and creates a windows tray message with a custom icon and action.\n```python\nfrom PySide2.QtWidgets import QApplication, QMenu\nfrom GUISpices import TrayIcon\nimport sys\n\n# create main application (if not present)\napp = QApplication([])\napp.setQuitOnLastWindowClosed(False)\n\n# configure basic tray\ntray = TrayIcon(app, \"examples/icon.png\", \"Test Program\")\n\n# Show message\ntray.show_tray_message(\"Title\",\"This is the message body\",\n icon=\"examples/icon.png\",\n on_click=lambda:print(\"Message clicked\"))\n\nsys.exit(app.exec_())\n```\n\n### Qt Windows\nThe whole module lets you build all windows and popups with\n[Qt Designer](https://www.qt.io/), a powerful and easy-to-use environment for \ndrag & drop GUI building. This creates a `.ui` file which can be directly loaded \nto create the desired window with full compatibility.\n```python\nfrom PySide2.QtWidgets import QApplication\nfrom GUISpices import UIWindow\nimport sys\n\napp = QApplication()\nmain_form = UIWindow('examples/wizard.ui', \"examples/icon.png\")\nmain_form.window.show()\nsys.exit(app.exec_())\n```\n\n### Windows Explorer extensions\nThis creates a new entry in the explorers context menu. \nSo a right-click in any folder or on the user's desktop \nwill show your custom action, as well. This example creates \na custom action \"Run CMD\", which opens up a terminal.\n```python\nfrom GUISpices import ExplorerContextManager\nExplorerContextManager.register_entry(\"Run CMD\", \"C:\\\\Windows\\\\System32\\\\cmd.exe\", \"C:\\\\Windows\\\\System32\\\\cmd.exe\")\n```\n\n### Borderless and draggable windows\nThis creates a new entry in the explorers context menu. \nSo a right-click in any folder or on the user's desktop \nwill show your custom action, as well. This example creates \na custom action \"Run CMD\", which opens up a terminal.\n```python\n\nfrom PySide2.QtWidgets import QApplication\nfrom PySide2.QtCore import Qt\nimport sys\nfrom GUISpices import UIWindow, DragBar\n\napp = QApplication()\nmain_form = UIWindow('examples/wizard.ui', \"examples/icon.png\")\n\n# This line makes your window borderless\nmain_form.window.setWindowFlags(Qt.FramelessWindowHint)\n\n# This adds a special Class to it, making it movable (via drag)\nDragBar(main_form.window)\n\nmain_form.window.show()\nsys.exit(app.exec_())\n\n\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "GUISpices", "package_url": "https://pypi.org/project/GUISpices/", "platform": "", "project_url": "https://pypi.org/project/GUISpices/", "project_urls": null, "release_url": "https://pypi.org/project/GUISpices/1.2.0/", "requires_dist": [ "PySide2" ], "requires_python": ">=3.5", "summary": "A wrapper module for various GUI usages", "version": "1.2.0", "yanked": false, "yanked_reason": null }, "last_serial": 6042371, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "4f5db8457a0e299fb4729da6b5342dbe", "sha256": "19092828002d50734c85d72a7accf55ec8975c24eda852b2657bcbe77e87ace6" }, "downloads": -1, "filename": "GUISpices-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4f5db8457a0e299fb4729da6b5342dbe", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 7182, "upload_time": "2019-10-27T23:46:59", "upload_time_iso_8601": "2019-10-27T23:46:59.829355Z", "url": "https://files.pythonhosted.org/packages/19/a6/89b27ba34af3d194e6074ac7cc0d420fad3f8d23d1ee7c14682f9593aee7/GUISpices-1.0.0-py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "88c667e1fe96fe4796215c24f2d1a1ca", "sha256": "d02ab3446b62879a69c9614fcbadaddb7dabd043412c0505cf9fdc771a810ea1" }, "downloads": -1, "filename": "GUISpices-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "88c667e1fe96fe4796215c24f2d1a1ca", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 7234, "upload_time": "2019-10-27T23:53:13", "upload_time_iso_8601": "2019-10-27T23:53:13.294777Z", "url": "https://files.pythonhosted.org/packages/d9/10/8f0b121fdb419db1920533b91c296cf846548db4a8b5266b06e602c936f9/GUISpices-1.0.1-py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "32871fb61cda171a9a1f756d841b9cf1", "sha256": "26ed94d58fc4a708d4dacdc0c57f7723806705b841dd87975b8cecbee07c13eb" }, "downloads": -1, "filename": "GUISpices-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "32871fb61cda171a9a1f756d841b9cf1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 7236, "upload_time": "2019-10-27T23:53:54", "upload_time_iso_8601": "2019-10-27T23:53:54.630780Z", "url": "https://files.pythonhosted.org/packages/df/24/ea70a213807bf6171b756dc4004741a97e9bb426b8e022259df04bf63587/GUISpices-1.0.2-py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "825a5821457766fb9689e41724986938", "sha256": "47d774ec1944009f09afe2ae7a9d8821f9cafdea91992381dffc533f3ab064ec" }, "downloads": -1, "filename": "GUISpices-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "825a5821457766fb9689e41724986938", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 7220, "upload_time": "2019-10-27T23:54:43", "upload_time_iso_8601": "2019-10-27T23:54:43.729584Z", "url": "https://files.pythonhosted.org/packages/ee/b6/e725d1a95c4391800099db88b3cf167d6a37b7a36e111b6ce33ee083e11b/GUISpices-1.0.3-py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "3f01b16d7c2c9a89307f281b78b770b7", "sha256": "78b9561747b34b91ff4d31e8229dfa8f087272e567744f9b5c5831a863e4ac2e" }, "downloads": -1, "filename": "GUISpices-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "3f01b16d7c2c9a89307f281b78b770b7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 8046, "upload_time": "2019-10-28T00:21:34", "upload_time_iso_8601": "2019-10-28T00:21:34.710783Z", "url": "https://files.pythonhosted.org/packages/1f/8a/5c61da82205227c100853d7fd376771f3ed003621d28558934fed7c8f0d9/GUISpices-1.1.0-py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "c467547881e94705138da38f1f1001cd", "sha256": "a9d4d998ca7177da96a69e03cd54028442d005dc11d03a4bb9171583c027f216" }, "downloads": -1, "filename": "GUISpices-1.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c467547881e94705138da38f1f1001cd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 8792, "upload_time": "2019-10-28T15:10:20", "upload_time_iso_8601": "2019-10-28T15:10:20.756834Z", "url": "https://files.pythonhosted.org/packages/07/19/651f548dc7276afd9785574d86df08ba7185a3e88fa6c7d236a4a9899601/GUISpices-1.2.0-py3-none-any.whl", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c467547881e94705138da38f1f1001cd", "sha256": "a9d4d998ca7177da96a69e03cd54028442d005dc11d03a4bb9171583c027f216" }, "downloads": -1, "filename": "GUISpices-1.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c467547881e94705138da38f1f1001cd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 8792, "upload_time": "2019-10-28T15:10:20", "upload_time_iso_8601": "2019-10-28T15:10:20.756834Z", "url": "https://files.pythonhosted.org/packages/07/19/651f548dc7276afd9785574d86df08ba7185a3e88fa6c7d236a4a9899601/GUISpices-1.2.0-py3-none-any.whl", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }