CudaExt seems not to work in Linux with Py 3.5

Solved bugs are moved into this topic...
tmsg
Posts: 120
Joined: 20.05.2020 12:08

CudaExt seems not to work in Linux with Py 3.5

Post by tmsg »

Well, the title says it all. I've installed the cuda_ext plugin on Linux and the plugin just doesn't seem to do anything. No function I tried seems to work. The console shows no error messages.

EDIT: I think I've found the reason (or at least part of it). On my Windows boxes the Python used is the v3.6 included with Cud. Under Linux I have a slightly older v3.5. And the cd_kv_dlg.py module uses f-strings... which are only available starting with v3.6. ;)

I will patch the file so it doesn't use those strings anymore but IMHO it would probably be a good idea to remove this as there are a few backward-compatible methods to format a string.

EDIT2: Well, patching away these strings is easier said than done as they're used in many places. I do have a running version now but I am not at all sure it's correct. So I've abandoned the Linux version of the plugin for now. :cry:
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

The outdated version is in addons:
CudaExt_py35
tmsg
Posts: 120
Joined: 20.05.2020 12:08

Post by tmsg »

Alexey wrote:The outdated version is in addons:
CudaExt_py35
\Hm.. does "outdated" mean that v3.6 is a minimum requirement across the supported platforms?
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

yes, we assume that people have 3.6. CudaExt_py35 is old.
tmsg
Posts: 120
Joined: 20.05.2020 12:08

Post by tmsg »

Alexey wrote:yes, we assume that people have 3.6. CudaExt_py35 is old.
I think that assumption is less problematic under Windows where many people don't have Python at all and so will use the Python that comes with Cud anyway. However, I am a lot less sure about Linux. Different distros come with different versions of Python 3 and many people might be wary to touch their Python install. It is not that hard to install a second, third... Python in parallel -- if you know how to do it. But then again, it is also not that hard to write a text editor -- if you know how to do it :D

And then there's the question whether f-strings are such an important new and irreplaceable feature of Python 3.6 that Cud plugins can't be written without it? I am not a Python expert but I doubt it. Sticking with an older version may be less glamorous but it's also more defensive. Just my 2¢.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

Hm, it is the question to @kvichans, he likes f-strings and new Python
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

I fully agree and I don't use 3.6 features in my plugins (it seems).
tmsg
Posts: 120
Joined: 20.05.2020 12:08

Post by tmsg »

Anyway, I have now followed your advice and downloaded the py35 version of the plugin. After transplanting the two cd_kv_*.py files into my version of the FiL code, it seems to work with the local Python v3.5. Fingers crossed.
User avatar
kvichans
Posts: 203
Joined: 07.10.2012 05:45

Post by kvichans »

New version cude_ext-35 is published. Now FiL is equal to cude_ext.
News:
- Resize in non-docked mode both inputs.
- In docked-mode inputs have widths as in non-docked mode.
CudaText 1.163, TC9.51x32, Win10x64(1920x1080)
tmsg
Posts: 120
Joined: 20.05.2020 12:08

Post by tmsg »

@kvichans: I've checked the new py35 version, there's an error:

Code: Select all

 File "Z:\q\py\cuda_ext_py35\cd_kv_dlg.py", line 467, in _check_data
    raise ValueError(f('Repeated names: {}', set(cids_d)))
ValueError: Repeated names: {'what'}
I think you copied and changed line 146 in cd_ext_find_repl.py and forgot to comment the original line ;)

Otherwise that looks good. Resizing both fields is better (I almost never use the cmbx anyway).
Post Reply