Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metadata-check: ignore GTK widgets if no display #2141

Merged

Conversation

matthewrmshin
Copy link
Member

Allow check to pass for GTK widgets if there is no display in the environment.

Problem reported by @scwhitehouse.

Allow check to pass for GTK widgets if there is no display in the environment.
@matthewrmshin matthewrmshin added this to the soon milestone Jan 19, 2018
@matthewrmshin matthewrmshin self-assigned this Jan 19, 2018
@matthewrmshin matthewrmshin modified the milestones: soon, next-release Jan 19, 2018
@matthewrmshin
Copy link
Member Author

(Travis CI failure unrelated.)

Copy link
Contributor

@scwhitehouse scwhitehouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've checked this both in the easy test case, and in the real life use-case where I discovered this, and it does fix the issue, and to my knowledge the code change looks sensible too (though I'm happy to defer to an expert).

Copy link
Contributor

@sadielbartholomew sadielbartholomew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look suitable & valid so I am happy to approve given they resolve the issue as you have observed. Though perhaps we could trim the exception pair (220:227) in 'metadata_check.py' down to the following:

    except Exception as exc:
        # Ignore if there is no display for GTK widget
        if (isinstance(exc, RuntimeError) and not os.getenv('DISPLAY') and
                exc.args == ('could not open display',)):
            return
        return INVALID_IMPORT.format(widget_name, type(exc).__name__, exc)

Something has changed how "%" is displayed in output of sqlite.
@matthewrmshin
Copy link
Member Author

Exception consolidated.

(I have also included the unrelated fix to Travis CI here.)

@sadielbartholomew sadielbartholomew merged commit 30f34b1 into metomi:master Jan 25, 2018
@matthewrmshin matthewrmshin deleted the rose-metadata-check-no-display branch January 25, 2018 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants