Browse Source

Avoid importing wx when --ignore-gooey is part of the command line arguments.

wx has dependencies on graphical libraries and servers. Importing it on
a headless machines causes the scripts to fail.

This change allows gooey-powered scripts to run on headless machines
with the --ignore-gooey option.
pull/473/head
Nathan Richard 6 years ago
committed by Chris
parent
commit
30aab7004d
1 changed files with 2 additions and 1 deletions
  1. 3
      gooey/python_bindings/gooey_decorator.py

3
gooey/python_bindings/gooey_decorator.py

@ -11,7 +11,6 @@ import os
import sys
from argparse import ArgumentParser
from gooey.gui import application
from gooey.gui.util.freeze import getResourcePath
from gooey.util.functional import merge
from . import config_generator
@ -53,6 +52,8 @@ def Gooey(f=None,
def build(payload):
def run_gooey(self, args=None, namespace=None):
# This import is delayed so it is not in the --ignore-gooey codepath.
from gooey.gui import application
source_path = sys.argv[0]
build_spec = None

Loading…
Cancel
Save