alecthomas / alecthomas/importmagic

GTK+ "broken"

未关闭
#53 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
122
派生
21
PR 合并指标
30 天内没有已合并 PR

描述

When using GTK+ 3.0 you must call `gi.require_version("Gtk", "3.0")` before other imports, like:

```python
import gi
gi.require_version("Gtk", "3.0")

from gi.repository import Gdk, Gtk

builder = Gtk.Builder()
...
```

But importmagic re-arrange the imports broking the semantic:

```python
import gi
from gi.repository import Gdk, Gtk

gi.require_version("Gtk", "3.0")

builder = Gtk.Builder()
...
```

Is that possible to add something to code to disable in these lines? Something like:

```python
# importmagic-ignore-start
import gi
gi.require_version("Gtk", "3.0")
# importmagic-ignore-end

from gi.repository import Gdk, Gtk

builder = Gtk.Builder()
...
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。