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"
        ]
    }
}

Auto Refresh

Users are likely to keep the hab launcher open for long periods of time and this may lead to them using out of date configuration settings. Hab Launcher has a refresh button to let users manually force a refresh. Note that this does not refresh the site configuration, configs and distros.

By default it will automatically refresh every 30 minutes(00:30:00). You can configure this interval by setting hab_gui_refresh_inverval in your site configuration. This accepts a string in %H:%M:%S format using time.strptime. An empty string will disable this auto-refresh feature.

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.9.0.tar.gz (32.3 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.9.0-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hab_gui-0.9.0.tar.gz
  • Upload date:
  • Size: 32.3 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.9.0.tar.gz
Algorithm Hash digest
SHA256 a8584a025ca79bf8fed00fc0b5b6067bcba96f9cd8bfb0406f3e6f3509b7ade5
MD5 47c25b2e95e7cebb83583297e78cb79b
BLAKE2b-256 d194fb7c62f738ed4e836dc18043348be2703853b06e2c8ac94f84be6f9166fd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hab_gui-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 28.3 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.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7448087d7724240f3cf8152513cac280ff3aff6357ec50ab6c2d3841c1ee6ed1
MD5 ee66d09236d1a15822a1fec84ecf7918
BLAKE2b-256 f5c3924226353d92fbaeb311971650a36d47227073ba597e8c116b453daccafd

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