gufw icon indicating copy to clipboard operation
gufw copied to clipboard

22.04 /usr/share/gufw/gufw/gufw.py - missing

Open 0pLuS0 opened this issue 4 years ago • 25 comments

Hello,

I'm trying to build 22.04.0 on Slackware 15.0

Just using python3 setup.py install --prefix=/usr --root=$PKG in a build script, when I try to run gufw, I get back at the term;

gufw python3: can't open file '/usr/share/gufw/gufw/gufw.py': [Errno 2] No such file or directory

With 21.04.0 I have this in my build script;

Point gufw-pkexec to the correct python3 location and version. sed -i "s|lib/python3.5|lib$LIBDIRSUFFIX/python3.7|g" bin/gufw-pkexec sed 's|/usr/share/gufw/gufw/gufw.py $1|/usr/lib64/python'"${PYTHONVERSION}"'/site-packages/gufw/gufw.py "$@"|' -i bin/gufw-pkexec

But it doesn't seem to be working now with the latest gufw, I hope you can please fix this build issue.

THANKS

0pLuS0 avatar Mar 14 '22 23:03 0pLuS0

If I also try to build gufw-21.04.0 with the sed options listed above, when I run it from the term I get this back;

~ >gufw python3: can't open file '/usr/lib64/python3.7/site-packages/gufw/gufw.py': [Errno 2] No such file or directory

I used before 21.04.0 in Slackware 14.2 but it doesn't compile properly either.

BUT, I want to use the latest version.

THANKS

0pLuS0 avatar Mar 14 '22 23:03 0pLuS0

Well, after posting this issue, I did added in a sed line in my slackbuild script and gufw is running.

I'm attaching the build script I used to compile 22.04.0.

Please tell me if Line 54 in this build script for the sed is ok?

THANKS

gufw.SlackBuild.txt

0pLuS0 avatar Mar 15 '22 04:03 0pLuS0

Hi, Yes, your line 54 looks right. I had several problems with the python directory and that is the reason on this change. Thanks for you work adapting it!! Love it! Best regards.

costales avatar Mar 15 '22 17:03 costales

Hi @costales

Do you think it possible in the future you can port this to either QT or GTK?

I love the app, I just hate the extra added needed for more deps, with webkitgtk...

Thanks for your time!

0pLuS0 avatar Mar 15 '22 21:03 0pLuS0

Hi,

But it is already GTK :O

Best regards.

costales avatar Mar 16 '22 20:03 costales

Only GTK, there is no need for Webkit2gtk, or python-distutils-extra?

I used this slackware build script as a guide, and according to it, gufw needs webkit2gtk;

https://slackbuilds.org/repository/15.0/network/gui-ufw/

Thanks

0pLuS0 avatar Mar 17 '22 00:03 0pLuS0

Hi @costales

I'm still not sure what you mean it is already GTK, gufw is not 100% a GTK only app, by my understanding.

Slackware and Arch both list webkit2gtk as a requirement to build.

Slackware https://slackbuilds.org/repository/15.0/network/gui-ufw/

Arch https://archlinux.org/packages/community/any/gufw/

In simple words, my understanding is that while webkit2gtk is used to render UI, I've seen other projects use this for creating the UI, I don't understand why this has to be requirement to build gufw?

https://webkitgtk.org/

I hope in the future you can remove the requirement for this, so it's 100% only GTK.

If gufw can be built without webkit2gtk, I would greatly appreciate it, if you would please reply to let me know?

THANKS

0pLuS0 avatar Mar 23 '22 07:03 0pLuS0

Hi, I don't remember the needs of this library. I will check ot, but I will not have time soon. Thank you for the feedback! Best regards!

costales avatar Mar 26 '22 18:03 costales

HI @costales

I just removed webkit2gtk and tried to run gfufw, but it fails to run now without it;

~ pts/0 rog ~ >gufw
Traceback (most recent call last):
  File "/usr/lib64/python3.9/site-packages/gufw/gufw.py", line 21, in <module>
    from gufw.view.gufw  import Gufw
  File "/usr/lib64/python3.9/site-packages/gufw/gufw/view/gufw.py", line 21, in <module>
    gi.require_version('WebKit2', '4.0')
  File "/usr/lib64/python3.9/site-packages/gi/__init__.py", line 126, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace WebKit2 not available

It would be really great if you can code gufw to not need webkit2gtk, as it needs 5 more additional dependencies to compile it.

THANKS

0pLuS0 avatar Mar 26 '22 22:03 0pLuS0

Hi,

What is happening if you remove this line: "gi.require_version('WebKit2', '4.0')" in the file "/usr/lib64/python3.9/site-packages/gufw/gufw/view/gufw.py", line 21

Thanks in advance!

costales avatar Mar 27 '22 07:03 costales

Ok the UI came up, but now it shows this message;

~ pts/1 foo ~ >gufw /usr/lib64/python3.9/site-packages/gufw/gufw/view/gufw.py:21: PyGIWarning: WebKit2 was imported without specifying a version first. Use gi.require_version('WebKit2', '4.0') before import to ensure that the right version gets loaded. from gi.repository import Gtk, Gdk, WebKit2

0pLuS0 avatar Mar 27 '22 23:03 0pLuS0

Hi,

Please, try then to change:

gi.repository import Gtk, Gdk, WebKit2

for:

import gi
gi.require_version('WebKit2', '4.0')
gi.repository import Gtk, Gdk, WebKit2

costales avatar Apr 23 '22 13:04 costales

I don't understand leaving in Webkit2? It is what I am asking to remove the support for. So to remove WebKit2, shouldn't the lines look like this now?

import gi gi.require_version('Gtk', '3.0') gi.require_version('Gdk', '3.0') gi.repository import Gtk, Gdk

If I make the lines like above this is the terminal output.

~ >gufw Traceback (most recent call last): File "/usr/lib64/python3.9/site-packages/gufw/gufw.py", line 30, in gufw = Gufw(controler.get_frontend()) File "/usr/lib64/python3.9/site-packages/gufw/gufw/view/gufw.py", line 78, in init self._set_objects_name() File "/usr/lib64/python3.9/site-packages/gufw/gufw/view/gufw.py", line 116, in _set_objects_name self.web_content = WebKit2.WebView() NameError: name 'WebKit2' is not defined

I don't undestand why I am testing this, aren't you the developer? Gufw requires Webkit2 to run, I can't change any of the lines you are asking and make it run, because it wants Webkit2.

I showed you before a link for gufw for Arch Linux and Slackware, that shows Webkit2 as a dependancy.

THANKS

0pLuS0 avatar Apr 23 '22 22:04 0pLuS0

If I make it look like this, if I understand correctly;

import gi gi.require_version('Gtk', '3.0') gi.require_version('Gdk', '3.0') gi.require_version('WebKit2', '4.0') gi.repository import Gtk, Gdk, WebKit2

I get this at the terminal, it doesn't run;

~ >gufw Traceback (most recent call last): File "/usr/lib64/python3.9/site-packages/gufw/gufw.py", line 21, in from gufw.view.gufw import Gufw File "/usr/lib64/python3.9/site-packages/gufw/gufw/view/gufw.py", line 22 gi.repository import Gtk, Gdk, WebKit2 ^ SyntaxError: invalid syntax

0pLuS0 avatar Apr 23 '22 23:04 0pLuS0

Hi,

I think you are not working with the last commits?

I don't find any gi.repository import Gtk, Gdk, WebKit2.

Best regards.

costales avatar Apr 24 '22 12:04 costales

Only GTK, there is no need for Webkit2gtk, or python-distutils-extra?

Hi, sorry, I just remembered, the webkit is necessary for the main Gufw tutorial. Best regards.

costales avatar Apr 26 '22 09:04 costales

What do you mean tutorial, the Home button section?

I thought webkit was needed for the entire UI?

Can you please consider getting rid of this webkit dependency and having this work with just GTK?

Or maybe a simpler solution, if webkit is only for the tutorial section under the Home, could you please make the Home/Tutorial section a compiling option, so if users want, they can choose to disable/remove the Home button tutorial section?

So if the Home button is this Tutorial section you are talking about, and this is all that requires webkit, I'd greatly appreciate you please considering having a compile option to disable/remove the tutorial section in gufw.

THANKS

0pLuS0 avatar Apr 27 '22 01:04 0pLuS0

Hi, yes that tutorial in 1st screen. If someone can develop it, it is welcome! Best regards

costales avatar Apr 27 '22 06:04 costales

Hi,

I thought you are the developer of GUFW, and you coded this for webkit?

So I assumed you could change it in time from webkit to gtk.

But as I was mentioning before, if the simplest thing to do for you is making a compile option to enable/disable this, that is all I am asking for, an option to disable this at compile time.

Or, just remove the Tutorial section, and have the tutorial online and in the man pages. I would of assumed, this makes the coding easier for you in the future.

I really appreciate your time, and considering all of this.

Thank you very much!

0pLuS0 avatar Apr 28 '22 04:04 0pLuS0

You're the developer, or you don't have the time to do this?

THANKS

0pLuS0 avatar Jun 12 '22 00:06 0pLuS0

Hello, I'm sorry, but I don't work on demand. All the software I developed I developed for myself, but as a believer in free software, I released it under a free license. The main tutorial is a key feature and I want it. Anyway, I don't have the time or knowledge for migrating from webkit to GTK. A hug.

costales avatar Jun 12 '22 07:06 costales

Ok, if things might change in the future to change this, I'm sure a lot of the Linux community out there will also greatly appreciate this, because this takes 5 additional dependencies to compile, for webkit.

If it were GTK only, it wouldn't need all these extra dependencies to compile.

Don't we all hate bloat? LOL :)

THANKS

0pLuS0 avatar Jun 15 '22 06:06 0pLuS0