[GNC-dev] webkitgtk

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[GNC-dev] webkitgtk

cicko
I was trying something out with pywebview library in Python, ran into some
issues and found that python-webkitgtk
(https://software.opensuse.org/package/python-webkitgtk) package has been
removed from openSuse.

But that's just the beginning. The webkitgtk package itself is being
removed, as can be seen in
https://bugzilla.opensuse.org/show_bug.cgi?id=1055659.
I guess/hope you are aware of the fact that gnucash is one of the few
dependencies listed at the bottom of that issue.

My real question, though, is what will webkitgtk be replaced with? It's a
web view component and I'm looking for an alternative for my pywebview app.
Well, one real alternative for me is to use Qt, which is also supported by
pywebview on Linux. I'm also wondering what is the solution for gnucash in
general.




--
Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-Dev-f1435356.html
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GNC-dev] webkitgtk

John Ralls-2


> On Sep 25, 2018, at 10:32 AM, cicko <[hidden email]> wrote:
>
> I was trying something out with pywebview library in Python, ran into some
> issues and found that python-webkitgtk
> (https://software.opensuse.org/package/python-webkitgtk) package has been
> removed from openSuse.
>
> But that's just the beginning. The webkitgtk package itself is being
> removed, as can be seen in
> https://bugzilla.opensuse.org/show_bug.cgi?id=1055659.
> I guess/hope you are aware of the fact that gnucash is one of the few
> dependencies listed at the bottom of that issue.
>
> My real question, though, is what will webkitgtk be replaced with? It's a
> web view component and I'm looking for an alternative for my pywebview app.
> Well, one real alternative for me is to use Qt, which is also supported by
> pywebview on Linux. I'm also wondering what is the solution for gnucash in
> general.

Boy, you really haven't been keeping up. The whole point of the Gtk3 upgrade was because Fedora and some other distros dropped webkitgtk. The replacement package for GnuCash 3.x would be https://software.opensuse.org/package/webkit2gtk3-devel. To use with python you'll use gobject-introspection (pygobject), see https://wiki.gnome.org/Projects/WebKitGtk/ProgrammingGuide/Bindings.

Regards,
John Ralls

_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GNC-dev] webkitgtk

cicko
Ah, that's from the period before I was born, then. :)

Thanks for the pointers! I found out some of that in the course of the
night. These packages are installed but the trick is that pywebview does not
(yet) support WebKit2. In the meantime, I'll be using the Qt5 version.
The more I learn about the options available, the more I wish GnuCash was
moving to Python, not C++. :)
It seems that Qt5 UI can be packaged for Android. And pywebview might also
work as a client (with Flask server).

Cheers



--
Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-Dev-f1435356.html
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GNC-dev] webkitgtk

John Ralls-2


> On Sep 26, 2018, at 12:38 AM, cicko <[hidden email]> wrote:
>
> Ah, that's from the period before I was born, then. :)
>
> Thanks for the pointers! I found out some of that in the course of the
> night. These packages are installed but the trick is that pywebview does not
> (yet) support WebKit2. In the meantime, I'll be using the Qt5 version.
> The more I learn about the options available, the more I wish GnuCash was
> moving to Python, not C++. :)
> It seems that Qt5 UI can be packaged for Android. And pywebview might also
> work as a client (with Flask server).

No, pywebview will never support WebKit2Gtk because WebKit2Gtk is Gtk3 only and pywebview, like pygtk, is Gtk2-only. You need to rewrite your whole application for Gtk3 using pygobject.

Regards,
John Ralls
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GNC-dev] webkitgtk

cicko
John Ralls-2 wrote
> No, pywebview will never support WebKit2Gtk because WebKit2Gtk is Gtk3
> only and pywebview, like pygtk, is Gtk2-only. You need to rewrite your
> whole application for Gtk3 using pygobject.

You may well be right but do check out this branch:
https://github.com/r0x0r/pywebview/tree/webkit2

Yesterday my time limit for investigation expired before getting to it so I
might continue with this on the weekend. Qt5 version, however, works fine so
I might as well not spend additional time on it. The browser window opens
from Python code, which is good enough for me.
On Windows, the example with running Flask in a separate thread and
connecting to it from the client works fine. If the same happens on Linux
and Android, then I might as well proceed in that direction.

Thanks for the comments.




--
Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-Dev-f1435356.html
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GNC-dev] webkitgtk

c.holtermann
Am 2018-09-26 16:03, schrieb cicko:

> John Ralls-2 wrote
>> No, pywebview will never support WebKit2Gtk because WebKit2Gtk is Gtk3
>> only and pywebview, like pygtk, is Gtk2-only. You need to rewrite your
>> whole application for Gtk3 using pygobject.
>
> You may well be right but do check out this branch:
> https://github.com/r0x0r/pywebview/tree/webkit2
>
> Yesterday my time limit for investigation expired before getting to it
> so I
> might continue with this on the weekend. Qt5 version, however, works
> fine so
> I might as well not spend additional time on it. The browser window
> opens
> from Python code, which is good enough for me.
> On Windows, the example with running Flask in a separate thread and
> connecting to it from the client works fine. If the same happens on
> Linux
> and Android, then I might as well proceed in that direction.
>
> Thanks for the comments.
>
>
>
>
> --
> Sent from:
> http://gnucash.1415818.n4.nabble.com/GnuCash-Dev-f1435356.html
> _______________________________________________
> gnucash-devel mailing list
> [hidden email]
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel

I'm also looking into that direction as I have a python script fetching
my
bank data as csv from the web. It broke with the update to the recent
gnucash
from a version about 2 years old. I got it halfway working. It would be
interesting
to put some working code as an example script to the python bindings.
I'll add some details about what I am and have been using later.

regards,

Christoph Holtermann
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GNC-dev] webkitgtk

c.holtermann
In reply to this post by John Ralls-2
Am 2018-09-26 15:52, schrieb John Ralls:

>> On Sep 26, 2018, at 12:38 AM, cicko <[hidden email]> wrote:
>>
>> Ah, that's from the period before I was born, then. :)
>>
>> Thanks for the pointers! I found out some of that in the course of the
>> night. These packages are installed but the trick is that pywebview
>> does not
>> (yet) support WebKit2. In the meantime, I'll be using the Qt5 version.
>> The more I learn about the options available, the more I wish GnuCash
>> was
>> moving to Python, not C++. :)
>> It seems that Qt5 UI can be packaged for Android. And pywebview might
>> also
>> work as a client (with Flask server).
>
> No, pywebview will never support WebKit2Gtk because WebKit2Gtk is Gtk3
> only and pywebview, like pygtk, is Gtk2-only. You need to rewrite your
> whole application for Gtk3 using pygobject.
>
> Regards,
> John Ralls
> _______________________________________________
> gnucash-devel mailing list
> [hidden email]
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel

I realize that's my issue, too. I had my script working with
webkit. Starting a webview with gnucash imported leads to crash.
Importing
webkit2 things work. But as you wrote: the script needs to be rewritten.
I'll do that. Meanwhile I don't import gnucash and continue using
webkit.

crashes:
python3 -c "import gnucash; from gi import require_version;
require_version('WebKit', '3.0'); from gi.repository import WebKit; view
= WebKit.WebView()"
-c:1: Warning: cannot register existing type 'WebKitWebView'
-c:1: Warning: g_once_init_leave: assertion 'result != 0' failed
-c:1: Warning: gsignal.c:1683: return value of type '<invalid>' for
signal "WebKitWebView::create_web_view" is not a value type

works:
python3 -c "import gnucash; from gi import require_version;
require_version('WebKit2', '4.0'); from gi.repository import WebKit2;
view = WebKit2.WebView()"

regards,

Christoph Holtermann
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GNC-dev] webkitgtk

cicko
Also update from my side:

https://gitlab.com/alensiljak/python-gui/tree/master/webview-server

Here I have two scripts pywebview and pywebview-qt. I can confirm that,
using the webkit2 branch of pywebview, both versions run on my system. So,
webkit2 seems to be used successfully.
So, Christoph, you may try using pywebview as a wrapper, if needed. That
way, at least, there would be less changes to make in the client code, I
hope.



--
Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-Dev-f1435356.html
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel