weechat / scripts

Official scripts for WeeChat.
https://weechat.org/scripts/
232 stars 223 forks source link

axolotl.py: is this python3? iteritems #549

Open emdee-is opened 9 months ago

emdee-is commented 9 months ago

Is axolotl.py python3 ? iteritems is python2 only.

        for option, default_value in script_options.iteritems():
            if not weechat.config_is_set_plugin(option):
                weechat.config_set_plugin(option, default_value)

My suggestion is:


        for option in script_options:
            if not weechat.config_is_set_plugin(option):
                weechat.config_set_plugin(option, script_options[option])
flashcode commented 9 months ago

Hi,

This script is marked as Python 2 only and it not compatible with Python 3 (yet), that means you can not install it in WeeChat, see on https://weechat.org/scripts/:

image

A pull request with a port to Python 3 is welcome!

emdee-is commented 9 months ago

Sorry - there's nothing on the file to say it's python2 only. I missed were it's marked as Python 2 only - where is that?

There's also the use of string.split in "axolotl.py", line 70, in decrypt

I think you should pull or port things that are python2 only at this point.

It would be nice if you ran pylint -E as a part of the commit process to get some minimal quality control into the repo.

flashcode commented 9 months ago

It's mentioned on the WeeChat scripts page: https://weechat.org/scripts/.

This repository is a collection of scripts from external contributors. There was a long period of transition from 2018 to 2022 to port all scripts to Python 3, all authors were contacted, and the scripts not yet compatible are now marked as "Python 2 only" and disabled (they can not be installed in WeeChat with /script command), see: https://weechat.org/scripts/python3/.

Unfortunately, I don't have enough time to port all scripts to Python 3, that's why pull requests are welcome.