Skip to main content

GUI for user interaction to Hab.

Project description

Hab Gui

A graphical user interface built on top of hab to take hab out of the shell.

image

Features

  • Gui for selecting hab URI's and launching aliases.
  • Gui for setting the current uri.
  • hab gui sub-command
  • habw command allows using hab without popup consoles on windows.
  • Customization of hab-gui using entry_points defined in hab site json files.

Quickstart

  1. Enable the use of hab gui by adding the entry_point in your site json file. You can use the example site files that come in the hab and hab-gui repos.

  2. Set a HAB_PATHS environment variable.

hab-gui.json extends hab's cli by adding the gui comand

  1. Use hab gui to launch the alias launch window.

    hab gui launch
    

    Or update the URI saved in the user prefs.

    hab gui set-uri
    

Configuration

hab gui sub-command

Using hab entry points you can add a gui sub-command to hab. This allows you to launch hab-gui commands from the existing hab shell commands.

{
    "prepend": {
        "entry_points": {
            "cli": {
                "gui": "hab_gui.cli:gui"
            }
        }
    }
}

This is a minimal site json file enabling the use of hab gui that can be added to your existing site files.

habw.exe

When hab-gui is installed it adds the command habw as a using gui_scripts. This is useful for windows users as it prevents showing a command prompt window while using the other hab gui features. This exe uses the same cli interface as hab so you can convert any existing command to using habw. Just keep in mind that you won't see any text output on windows, so you may want to only use it when using the hab gui sub-command.

Hab-gui Entry Points

By default hab-gui uses fairly simple gui interfaces like a combo box for URI picking and simple buttons to launch aliases. Using the hab entry points system you can implement your own widgets extending or completely re-implementing them.

Feature Description Used by Multiple values
hab_gui_alias_widget Widget used to display and launch a specific alias for the current URI. AliasLaunchWindow Only the first is used, the rest are discarded.
hab_gui_aliases_widget Class used to display the hab_gui_alias_widget's. AliasLaunchWindow Only the first is used, the rest are discarded.
hab_gui_init Used to customize the init of hab gui's launched from the command line. By default this installs a sys.excepthook that captures any python exceptions and shows them in a QMessageBox dialog. See hab-gui-init.json. hab_gui.cli when starting a QApplication instance. Only the first is used, the rest are discarded.
hab_gui_uri_pin_widget Class used to allow the user to pinned commonly used URIs. Pinning can be disabled by the site file, or setting this entry_point to null. AliasLaunchWindow Only the first is used, the rest are discarded.
hab_gui_uri_widget Class used by the user to choose the current URI they want to launch aliases from. This class can be customized to provide the user with URI's generated from a DB that are not explicitly defined by configs. AliasLaunchWindow Only the first is used, the rest are discarded.
  • See hab-gui.json for an example of adding the gui sub-command to hab.
  • See hab-gui-alt.json for an example of changing the default classes used by hab gui launch.
  • See hab-gui-init.json for an example of changing the QApplication before any hab gui commands create it. This also allows for global customization of features like error handling etc.

Icons and labels

For the command line using an simplified alias name that is easy to type but harder to read is generally preferred. However for a UI like the launcher, its nice to be able to use a nice name with spaces and extra information. For example in the command line using the alias maya24 is better than having to type "Maya 2024" including double quotes.

Hab gui respects extra values defined on complex aliases.

Key Description Default
icon Path to a icon file readable by QIcon. No icon is shown.
label The text to show instead of the alias name. Same alias name shown in command line.
min_verbosity Hab-gui uses the hab-gui key. For example "min_verbosity": {"global": 1, "hab-gui": 3} would make this alias visible on the command line using -v or above, but when using hab-gui you would need to use -vvv or higher to see it. This allows you to hide aliases that only make sense on the command line but not in hab-gui. 0, so always visible.

Example:

{
    "name": "maya2024",
    "aliases": {
        "windows": [
            [
                // Alias users are expected to launch the correct version of maya with
                "maya", {
                    "cmd": "C:\\Program Files\\Autodesk\\Maya2024\\bin\\maya.exe",
                    // Show the icon and give it the nice name "Maya"
                    "icon": "{relative_root}/.img/maya.ico",
                    "label": "Maya",
                }
            ],
            [
                // Alias used to launch Maya 2024. This allows you to also have
                // access to Maya 2023 etc in the same config and launch the
                // correct version.
                "maya24", {
                    "cmd": "C:\\Program Files\\Autodesk\\Maya2024\\bin\\maya.exe",
                    "icon": "{relative_root}/.img/maya.ico",
                    "label": "Maya 2024",
                    // In general we don't want users to have to know which version
                    // of Maya to launch so hide this alias unless the user passes `-v`
                    // when using the command line or hab-gui.
                    "min_verbosity": {"global": 1},
                }
            ],
            // The mayapy alias are being added for script access and are not really
            // meant for users, so hide them from the command line.
            // Hab-gui can't pass arguments to aliases when launching, so there
            // really is no need to show this alias in hab-gui, so require `-vvv`.
            [
                "mayapy", {
                    "cmd": "C:\\Program Files\\Autodesk\\Maya2024\\bin\\mayapy.exe",
                    "min_verbosity": {"global": 1, "hab-gui": 3},
                }
            ],
            [
                "mayapy24", {
                    "cmd": "C:\\Program Files\\Autodesk\\Maya2024\\bin\\mayapy.exe",
                    "min_verbosity": {"global": 1, "hab-gui": 3},
                }
            ]
        ]
    }
}

Startup Splash Screen

A splash screen be enabled by adding image/directory paths to the site.json config. The config takes a list entry and can contain full file paths or directory paths that contain valid images.

Valid image types: JPG, PNG, GIF

{
    "prepend": {
        "splash_screen": [
            "Path(s)/To/Images"
        ]
    }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hab_gui-0.8.0.tar.gz (28.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hab_gui-0.8.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file hab_gui-0.8.0.tar.gz.

File metadata

  • Download URL: hab_gui-0.8.0.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for hab_gui-0.8.0.tar.gz
Algorithm Hash digest
SHA256 5fbc994cc276d1d6d4ebc072d7faea9d63dad1922a023c4482a3d38a6ab19fcb
MD5 ca68d3face48579d55d8bd6554d1ed78
BLAKE2b-256 c2af4baa02ebb1165ad5ed9c46613cbf87ac513f554a019ee15d1a454991bb4c

See more details on using hashes here.

File details

Details for the file hab_gui-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: hab_gui-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for hab_gui-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e72e136cba25fe336396a7981d3bbb3d2fdf2a5fd79f4d764934784805610598
MD5 955b95f307cb4cd251ee1429a6900196
BLAKE2b-256 fa94f4173950f48d014bca8273ff725e70ddd6bb338513cfebc804a577b79c3e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page