开源改变世界

python-gtksourceview2 在 Buster 中不可用 #809

推推 grbl 2年前 (2023-01-30) 114次浏览
关闭
rene-dev 打开了这个问题 2020 年 4 月 28 日 · 10 条评论
关闭

python-gtksourceview2 在 Buster 中不可用#809

rene-dev 打开了这个问题 2020 年 4 月 28 日 · 10 条评论

注释

python-gtksourceview2 在 Buster 中不可用 #809
合作者

python-gtksourceview2 在 buster 上不可用,破坏了 gmoccapy 和其他 gscreen UI。

python-gtksourceview2 在 Buster 中不可用 #809
贡献者

python-gtksourceview2 在 buster 上不可用,破坏了 gmoccapy 和其他 gscreen UI。

我对打包感兴趣,linuxcncFedora我们Fedora >=30也不再有可用的pygtksourceview开始。

python-gtksourceview2 在 Buster 中不可用 #809
合作者
安迪普 评论了 2020 年 4 月 29 日  

我想我有一个解决方案的开端:
这是有效的,独立的:

gi.repository将 GtkSource导入为 gtksourceview

然后其余代码(可能)起作用。这需要 gir1.2-gtksource-N 包。

现在,这可以在命令行独立运行。

Python 2.7.16 (default, Apr  6 2019, 01:42:57) 
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gtk
>>> from gi.repository import GtkSource as gtksourceview
__main__:1: PyGIWarning: GtkSource was imported without specifying a version first. Use gi.require_version('GtkSource', '3.0') before import to ensure that the right version gets loaded.
>>> buf = gtksourceview.Buffer()
>>> 

但是,如果您尝试与“Import Gtk”混合使用(带有误导性错误消息),则会出现问题

Python 2.7.16 (default, Apr  6 2019, 01:42:57) 
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gtk
>>> from gi.repository import GtkSource as gtksourceview
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 39, in <module>
    raise ImportError(_static_binding_error)
ImportError: When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from gi.repository import GObject". See: https://bugzilla.gnome.org/show_bug.cgi?id=709183

python-gtksourceview2 位于 Sid 存储库中。我对 2.8 的意图是通过我们的 repo 向后移植它。

python-gtksourceview2 在 Buster 中不可用 #809
合作者
c-莫利 评论了 2020 年 4 月 29 日 通过电子邮件
python-gtksourceview2 在 Buster 中不可用 #809
合作者作者

不,gi 只为 gtk3 提供。看看警告。
要求版本 2 会产生错误。

python-gtksourceview2 在 Buster 中不可用 #809
合作者作者

我无论如何都将 python3 的所有导入更改为 gi,它已经在这里完成了。

python-gtksourceview2 在 Buster 中不可用 #809
合作者作者

这当然也适用于 python2。

python-gtksourceview2 在 Buster 中不可用 #809
合作者
c-莫利 评论了 2020 年 4 月 29 日 通过电子邮件
python-gtksourceview2 在 Buster 中不可用 #809
合作者作者

它确实如此,但不适用于 gtksourceview

python-gtksourceview2 在 Buster 中不可用 #809
合作者
c-莫利 评论了 2020 年 4 月 29 日 通过电子邮件
python-gtksourceview2 在 Buster 中不可用 #809
合作者

gtksourceview2 现在可用于 Linuxcnc 存储库中的 Buster