Getting TypeCatcher to run under Linux Mint 21

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
it-place
Level 3
Level 3
Posts: 188
Joined: Thu Jul 05, 2018 4:42 am

Getting TypeCatcher to run under Linux Mint 21

Post by it-place »

Hi all,

I've installed the package typecatcher 0.3-1.2 in Linux Mint 21. Starting the program via icon seems to have no effect. Starting the program on the terminal leads to the following error message: AttributeError: 'ElementTree' object has no attribute 'getiterator'

After a little investigation I figured out that the attribute getiterator cannot be used in python 3.10.4 anymore. So changing two lines in the file /usr/lib/python3/dist-packages/typecatcher_lib/Builder.py helped me out here. :) Here is a little bash script that will do the job for you:

Code: Select all

#!/bin/bash

_version=$(cat /etc/os-release | grep "^VERSION_ID=" | gawk -F\" '{ print $2 }')
_typecatcher="/usr/lib/python3/dist-packages/typecatcher_lib/Builder.py"

if [ -e $_typecatcher ] && [ "$_version" == "21" ]; then
  sudo sed -i 's/ele_widgets = tree.getiterator("object")/ele_widgets = tree.iter("object")/' $_typecatcher
  sudo sed -i 's/ele_signals = tree.getiterator("signal")/ele_signals = tree.iter("signal")/' $_typecatcher
fi

# EOF
Here you can find more about TypeCatcher: https://github.com/andrewsomething/typecatcher/

Best Regards - Olli
Last edited by LockBot on Fri Feb 17, 2023 11:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
UFO-84
Level 1
Level 1
Posts: 14
Joined: Sun Oct 09, 2022 11:32 am
Location: India
Contact:

Re: Getting TypeCatcher to run under Linux Mint 21

Post by UFO-84 »

Thank you, it worked!
FamCompKid
Level 3
Level 3
Posts: 158
Joined: Thu Apr 25, 2019 1:18 am

Re: Getting TypeCatcher to run under Linux Mint 21

Post by FamCompKid »

Also worked for me! THANK YOU! :)
A very average user on two PC's on Linux Mint 21.x Cinnamon. Thank you.
proulxf012
Level 1
Level 1
Posts: 27
Joined: Wed May 23, 2012 6:54 pm

Re: Getting TypeCatcher to run under Linux Mint 21

Post by proulxf012 »

Hi. I am unable to get this solution working for me: I am not a coder. Just a 64 y.o. user that cannot use typecatcher anymore. First: how do I run a script like this one in LM 21.1? I tried: I copy/pasted it in a terminal and pressed "enter". No indication it worked and no indication it did not work but it did nothing. Tried it after doing "sudo su" + password, and that also did not work. Tried to look at the file to modify and could not make head or tail of it. Again: I am not a coder.
A little help please. Bear in mind: I am not a coder.
Regards
François Proulx, Longueuil, Québec, Canada
User avatar
it-place
Level 3
Level 3
Posts: 188
Joined: Thu Jul 05, 2018 4:42 am

Re: Getting TypeCatcher to run under Linux Mint 21

Post by it-place »

Hello François,
please try do do the following:
  1. open "Text Editor"
  2. copy & paste my script into the editor
  3. change the following line
    if [ -e $_typecatcher ] && [ "$_version" == "21" ]; then
    to
    if [ -e $_typecatcher ] && [ "$_version" == "21.1" ]; then
  4. save file as "typecatcher_patch"
  5. open a terminal windows where the file is located
  6. make the file executeable with chmod a+x typecatcher_patch
  7. execute the file from terminal with ./typecatcher_patch
My original script was writen for LM 21 so the above test will fail in LM 21.1. I've tested this in a VM a few minutes ago and it worked. :wink:

Have a nice day! Olli
proulxf012
Level 1
Level 1
Posts: 27
Joined: Wed May 23, 2012 6:54 pm

Re: Getting TypeCatcher to run under Linux Mint 21

Post by proulxf012 »

Hello. Thank you very much. It worked perfectly. Plus: I finally learned how to run a script (patch). Nice
Thank you again
Regards
François Proulx, Longueuil, Québec, Canada
Locked

Return to “Software & Applications”