bharadwaj-raju / TextSuggest

MOVED: https://gitlab.com/bharadwaj-raju/TextSuggest
https://gitlab.com/bharadwaj-raju/TextSuggest
GNU General Public License v3.0
241 stars 20 forks source link

TextSuggest crash after starting #39

Closed vickneshmachasuperpower closed 7 years ago

vickneshmachasuperpower commented 7 years ago

Hi Bharad.

I installed your TextExpander but it keep crashing when it's started with the following error message:

vicknesh@zebra:~$ textsuggest
awk: line 0: regular expression compile failed (missing operand)
(+|\()
Traceback (most recent call last):
  File "/usr/bin/textsuggest", line 161, in <module>
    language = [get_language_name()]
  File "/usr/lib/python3.5/languages.py", line 44, in get_language_name
    keyboard_layout = sp.check_output(keyboard_layout_cmd_str, shell=True).decode('utf-8').rstrip()
  File "/usr/lib/python3.5/subprocess.py", line 626, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.5/subprocess.py", line 708, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'setxkbmap -print | awk -F '(+|\\()' '/xkb_symbols/ {print $2}'' returned non-zero exit status 2

It looks like problem is caused by code from here : https://github.com/bharadwaj-raju/TextSuggest/blob/master/languages.py. Do you have workaround for this problem?

bharadwaj-raju commented 7 years ago

This seems to be a very old version. This problem was reported and fixed long ago.

bharadwaj-raju commented 7 years ago

@vickneshmachasuperpower Does a new version fix it? Please respond.

vickneshmachasuperpower commented 7 years ago

I'm using the latest deb file provided here : https://github.com/bharadwaj-raju/TextSuggest I believe this is the latest version of TextSuggest?

bharadwaj-raju commented 7 years ago

@vickneshmachasuperpower It is. It downloads and installs the latest version each time you install it.

Can you post the output of these:

  1. textsuggest --version
  2. setxkbmap -print | awk -F '(+|\()' '/xkb_symbols/ {print $2}'

?

vickneshmachasuperpower commented 7 years ago

Hi.

Result of version:

vicknesh@zebra:~$ textsuggest --version
TextSuggest 1570

Copyright © 2016 Bharadwaj Raju <bharadwaj.raju@keemail.me>
License GPLv3+: GNU GPL (General Public License) version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Result of keyboard map:

vicknesh@zebra:~$ setxkbmap -print | awk -F '(+|\()' '/xkb_symbols/ {print $2}'
awk: line 0: regular expression compile failed (missing operand)
(+|\()

Let me know if you have specific way to correct the 2nd command

bharadwaj-raju commented 7 years ago

@vickneshmachasuperpower I have a way, I'll apply it tomorrow.

bharadwaj-raju commented 7 years ago

@vickneshmachasuperpower Done, now the awk is done in pure Python.