Skip to content

missing_bundle_window

main()

Show message that server does not have set bundle to use.

It is possible to pass url as argument to show it in the message. To use this feature, pass --url <url> as argument to this script.

The function expects that 'is_dev_mode_enabled' will return value for the bundle name passed in.

Source code in common/ayon_common/distribution/ui/missing_bundle_window.py
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
def main():
    """Show message that server does not have set bundle to use.

    It is possible to pass url as argument to show it in the message. To use
        this feature, pass `--url <url>` as argument to this script.

    The function expects that 'is_dev_mode_enabled' will return value
        for the bundle name passed in.
    """
    url = None
    bundle_name = None
    username = None
    if "--url" in sys.argv:
        url_index = sys.argv.index("--url") + 1
        if url_index < len(sys.argv):
            url = sys.argv[url_index]

    if "--missing-bundle" in sys.argv:
        bundle_index = sys.argv.index("--missing-bundle") + 1
        if bundle_index < len(sys.argv):
            bundle_name = sys.argv[bundle_index]

    if "--user" in sys.argv:
        user_index = sys.argv.index("--user") + 1
        if user_index < len(sys.argv):
            username = sys.argv[user_index]

    is_project_bundle = "--is-project" in sys.argv

    use_staging = is_staging_enabled()
    use_dev = is_dev_mode_enabled()
    app = get_qt_app()
    window = MissingBundleWindow(
        url, bundle_name, username, is_project_bundle, use_staging, use_dev
    )
    window.show()
    app.exec_()