Re: PyGObject: pep8 konform

2018-06-01 Thread James Cameron
Code that uses PyGObject can't be PEP8 conformant without generating version warnings. My practice is to minimise E402 by moving imports, then add .flake8 file with; [flake8] # E402 module level import not at top of file # gi.require_version() is required before later imports ignore = E402 --

Re: PyGObject: pep8 konform

2018-06-01 Thread Gergely Polonkai
My take would be to ignore this specific line with a magic comment. Or, if you really donʼt want to d that, a from importlib import import_module # isnʼt that line wonderful? Gtk = import_module('gi.repository.Gtk') might do the trick. (Note that I wrote it without having Python at hand; maybe y