JetBrains / colorSchemeTool

Apache License 2.0
452 stars 81 forks source link

any update to python 3.11.2? #43

Open NEVH26 opened 1 year ago

NEVH26 commented 1 year ago

Whenever I try to run convert.sh many errors appear (syntax among others) and was wondering if there's a need to update this to make it run on current software.

melindayeoh commented 1 year ago

Yeah for me, I had to download pyenv: https://github.com/pyenv/pyenv so I could downgrade to 2.7 to run convert.sh

Install, and set up your shell environment for pyenv

then I had to run:

pyenv install 2.7

(it installs the latest 2.7 version, in this case for me, it was 2.7.18)

then switch to that python version on your current shell that you intend to run the script on:

pyenv shell 2.7.18

then I could run

sh convert.sh

and there were no errors in my file. 😅

caiovncius commented 1 year ago

install pyenv 2.7.18 and edit convert.sh. Put you full path of python 2 in line 31.

for FILE in $TM_FILES
do
    FN="${FILE##*/}"
    DIR="${FILE:0:${#FILE} - ${#FN}}"
    BASE="${FN%.[^.]*}"
    EXT="${FN:${#BASE} + 1}"
    echo converting $DIR$FN to $IJ_OUTDIR$BASE.icls ...
    ~/.pyenv/versions/2.7.18/bin/python2 colorSchemeTool.py "$FILE" "$IJ_OUTDIR$BASE.icls" >> ./colorSchemeTool.log
done
carlca commented 8 months ago

This information is out of date. If you move back to Python 2.7.18, the line themeDict = plistlib.load(f) fails because load only became a method of plistlib under python 3.0.0+