fah-control
fah-control copied to clipboard
Updated to Python3 / Gtk3 for >= Ubuntu 20.04 support
This is a fairly intense update from Python2 / Gtk2 to Python3 / Gtk 3. The Glade xml file is completely gtk3 with no deprecated widgets and should allow easier maintenance into the future without the backward dependencies that are being phased out like python-support and python-gtk2.
I'll jot down here two things I've found. Unless you fix them in the meanwhile, I'll fix them asap
- when saving configuration with a changed username, a
bis prepended. this is due to unicode_escape. Sincestring_escapeis apparently gone, a simplevalue.replace('\'', '\\\'')should do - when saving configuration, the cause is lost (it becomes an empty string)
@ffissore I believe those are fixed now :)
I think we should probably pause for a review here to see how much to throw into this PR.
@jcoffland Any thoughts on what you would like for this pull request or if you would like us to continue?
Can we have a build of that? Just, you know, for testing. 😅
You could post it to the releases of your repository if that's convenient.
@ariedov we started working on https://github.com/cdberkstresser/fah-control/issues/8 which will provide canary builds
Are you aware of https://github.com/FoldingAtHome/fah-control/pull/56?
To be honest, I became aware of the other PRs just yesterday
I've been helping with that other PR. It intends to be "only the necessary changes", so no reformatting or other re-writes. It appears to be working where it has been tested.
@bhack @guystreeter Hopefully the other PR goes well for you all. This PR was originally just an attempt to learn python3/gtk3 to get it going for beta testing the new fahclient; however, it does not intend to be "only the necessary changes" and intends rather to be free to explore more avenues of functionality towards beta testing and UI changes so I hope it is different enough not to feel like a duplicated effort. Just looking to see FAH do well into the future and not trying to step on anyone's work. :) Kudos for #56 !
@mat8913 @nikolaik @guystreeter @r-barnes @cdberkstresser FYI I'm testing the other PRs and collecting their goodness giving credit to the respective authors
@mat8913 @nikolaik @guystreeter @r-barnes Please take a look at https://github.com/cdberkstresser/fah-control/pull/14: it's made of made-up commits with you set as authors @cdberkstresser I have not included a bunch of commits from @guystreeter related to RPM packaging, since I don't have a fedora to test them: pls consider cherry-picking them
I tested the rpm changes for #56 locally on Fedora 31 and 32, both on my installed system and in a Mock buildroot. I used the srpm from the Mock build to build for Fedora and Centos 8 on COPR, the public Fedora build system. rpm packages built from #56 are available for installation and testing at COPR. I have not tested the rpm on Centos 8 because I don't have a test system. It appears to me that my changes should work fine for this PR. They may need to be worked into whatever build environment FAH uses. Also, I left Copyright, Licensing, and Version as "to-do" items. I am fine with assigning the copyright of the new files to FAH.
BTW, in my environment(Ubuntu 20.04), python setup.py --command-packages=stdeb.command sdist_dsc doesn't work.
sudo sudo apt install python3-all debhelper python3-setuptools devscripts
$ pyenv install 3.8.3
$ git clone https://github.com/cdberkstresser/fah-control.git
$ cd fah-control
$ pyenv local 3.8.3
$ python -m pip install stdeb setuptools
$ python setup.py --command-packages=stdeb.command sdist_dsc
$python setup.py --command-packages=stdeb.command sdist_dsc
dir = .
running sdist_dsc
running egg_info
writing FAHControl.egg-info/PKG-INFO
writing dependency_links to FAHControl.egg-info/dependency_links.txt
writing requirements to FAHControl.egg-info/requires.txt
writing top-level names to FAHControl.egg-info/top_level.txt
reading manifest file 'FAHControl.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'FAHControl.egg-info/SOURCES.txt'
running sdist
running check
creating FAHControl-0.0.0
creating FAHControl-0.0.0/FAHControl.egg-info
creating FAHControl-0.0.0/fah
creating FAHControl-0.0.0/fah/db
creating FAHControl-0.0.0/fah/util
creating FAHControl-0.0.0/images
copying files to FAHControl-0.0.0...
copying FAHControl -> FAHControl-0.0.0
copying FAHControl.desktop -> FAHControl-0.0.0
copying MANIFEST.in -> FAHControl-0.0.0
copying README.md -> FAHControl-0.0.0
copying setup.py -> FAHControl-0.0.0
copying FAHControl.egg-info/PKG-INFO -> FAHControl-0.0.0/FAHControl.egg-info
copying FAHControl.egg-info/SOURCES.txt -> FAHControl-0.0.0/FAHControl.egg-info
copying FAHControl.egg-info/dependency_links.txt -> FAHControl-0.0.0/FAHControl.egg-info
copying FAHControl.egg-info/requires.txt -> FAHControl-0.0.0/FAHControl.egg-info
copying FAHControl.egg-info/top_level.txt -> FAHControl-0.0.0/FAHControl.egg-info
copying fah/Client.py -> FAHControl-0.0.0/fah
copying fah/ClientConfig.py -> FAHControl-0.0.0/fah
copying fah/Connection.py -> FAHControl-0.0.0/fah
copying fah/FAHControl.py -> FAHControl-0.0.0/fah
copying fah/FAHControl_glade.py -> FAHControl-0.0.0/fah
copying fah/SlotConfig.py -> FAHControl-0.0.0/fah
copying fah/Version.py -> FAHControl-0.0.0/fah
copying fah/WidgetMap.py -> FAHControl-0.0.0/fah
copying fah/__init__.py -> FAHControl-0.0.0/fah
copying fah/wraplabel.py -> FAHControl-0.0.0/fah
copying fah/db/Column.py -> FAHControl-0.0.0/fah/db
copying fah/db/Database.py -> FAHControl-0.0.0/fah/db
copying fah/db/Table.py -> FAHControl-0.0.0/fah/db
copying fah/db/__init__.py -> FAHControl-0.0.0/fah/db
copying fah/util/EntryValidator.py -> FAHControl-0.0.0/fah/util
copying fah/util/OrderedDict.py -> FAHControl-0.0.0/fah/util
copying fah/util/PasswordValidator.py -> FAHControl-0.0.0/fah/util
copying fah/util/SingleApp.py -> FAHControl-0.0.0/fah/util
copying fah/util/__init__.py -> FAHControl-0.0.0/fah/util
copying images/FAHControl.ico -> FAHControl-0.0.0/images
copying images/FAHControl.png -> FAHControl-0.0.0/images
Writing FAHControl-0.0.0/setup.cfg
Creating tar archive
removing 'FAHControl-0.0.0' (and everything under it)
This version of stdeb requires python-all >= 2.6.6-3, but you do not have this package installed. Could not check compatibility.
dpkg-buildpackage: info: source package fahcontrol
dpkg-buildpackage: info: source version 0.0.0-1
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by Joseph Coffland <[email protected]>
dpkg-source --before-build .
dpkg-source: info: using options from fahcontrol-0.0.0/debian/source/options: --extend-diff-ignore=\.egg-info$
fakeroot debian/rules clean
dh clean --with python3 --buildsystem=python_distutils
dh: warning: Compatibility levels before 9 are deprecated (level 7 in use)
dh: error: unable to load addon python3: Can't locate Debian/Debhelper/Sequence/python3.pm in @INC (you may need to install the Debian::Debhelper::Sequence::python3 module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at (eval 3) line 1.
BEGIN failed--compilation aborted at (eval 3) line 1.
make: *** [debian/rules:7: clean] エラー 255
dpkg-buildpackage: error: fakeroot debian/rules clean subprocess returned exit status 2
Traceback (most recent call last):
File "setup.py", line 119, in <module>
setup(
File "/home/yumetodo/.pyenv/versions/3.8.3/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/home/yumetodo/.pyenv/versions/3.8.3/lib/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/yumetodo/.pyenv/versions/3.8.3/lib/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/home/yumetodo/.pyenv/versions/3.8.3/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/yumetodo/.local/lib/python3.8/site-packages/stdeb/command/sdist_dsc.py", line 135, in run
build_dsc(debinfo,
File "/home/yumetodo/.local/lib/python3.8/site-packages/stdeb/util.py", line 1441, in build_dsc
dpkg_buildpackage('-S','-sa',*args,cwd=fullpath_repackaged_dirname)
File "/home/yumetodo/.local/lib/python3.8/site-packages/stdeb/util.py", line 538, in dpkg_buildpackage
process_command(args, cwd=cwd)
File "/home/yumetodo/.local/lib/python3.8/site-packages/stdeb/util.py", line 191, in process_command
check_call(args, cwd=cwd)
File "/home/yumetodo/.local/lib/python3.8/site-packages/stdeb/util.py", line 46, in check_call
raise CalledProcessError(retcode)
stdeb.util.CalledProcessError: 2
@cdberkstresser are the steps in the github action specific to ubuntu18 or do they work on your ubuntu20 as well? I haven't yet upgraded and github actions support only ubuntu18 at the moment
@yumetodo @ffissore Unfortunately, I had differences between 18.04 in the github docker image, 18.04 desktop, and 20.04 desktop.
On 20.04, I get a crash on the sdist or bdist commands and ended up using
debuild -us -uc to get an image on 20.04.
For users of Arch Linux: I made an AUR package with this fork here: https://aur.archlinux.org/packages/fahcontrol-gtk3-git/
I made it mostly as a test, but it turns out that it works quite well.
The only issue is icons, for some reason this fork uses relative paths for .ico files (I assume this is temporary?). This breaks the usual setup.py procedure, as the image files get put in a different location. I wrote a quick and dirty patch to fix this on Arch, but as you can see, that patch isn't exactly cross-platform. I've never worked with Python or GTK before, so I couldn't come up with anything better.
Anyway, Arch users can install that package and this should work just fine.
@gardenappl any chance the .ico file can be left where it is rather than moved to /usr/share/pixmaps ?
ok, sorry my fault: it's setup that is "installing" that file under /usr/share/pixmaps: I'll fix it asap
@gardenappl I've pushed a fix to address your feedback. Can you give it a try? Your patch could be removed now
@ffissore Just checked it, seems to work fine without the patch now.
But I was kinda hoping that GTK3 would offer a more robust way of finding the icon path.
I've been doing a bit of searching and, apparently, the freedesktop.org standard requires programs to look for icons in these folders:
- $HOME/.icons
- $XDG_DATA_DIRS/icons
- /usr/share/pixmaps
In that order.
@gardenappl Done. Can you give it a try?
@ffissore That worked fine. It kinda sucks that you had to hardcode those paths, though.
Tested on Ubuntu 20.10 and it works for me.
FYI resolved conflicts and merged commits 3189958e4ea40516dc2956a4d6b1797ff75acd02 and ec5852b1766d9dba65c615dca7e59d1dcdc50fcd into this branch
Moving to Gtk3 would also help with HiDPI on Windows!
any progress ?
@Davilink I'm not sure there is a viable path for this pull request to be accepted. There seem to be substantial problems building a python3 executable on Windows.
Sounds fishy, will clone and try on Windows.
Looks like a typelib issue, per https://github.com/pyinstaller/pyinstaller/issues/1966. Working on manually adding it.
Please do, @Artoria2e5: the windows ecosystem is full of users, and without hackers. We need a windows hacker to make this work