iTerm2-Color-Schemes icon indicating copy to clipboard operation
iTerm2-Color-Schemes copied to clipboard

The update_all.py script appears to be broken

Open mbadolato opened this issue 3 years ago • 11 comments

I and several users have noted that running update_all.py in the tools/ directory is not generating any files, even when there are new schemes added

mbadolato avatar Mar 03 '21 04:03 mbadolato

Python 3.9.2

mbadolato avatar Mar 03 '21 04:03 mbadolato

Python 2.7 giving an error:

Traceback (most recent call last):
  File "update_all.py", line 10, in <module>
    import xrdb2Xresources
  File "/Users/mbadolato/development/projects/iTerm2-Color-Schemes/tools/xrdb2Xresources.py", line 62
    def __init__(self, define: str, key: str, value: str, *args: str):
                             ^
SyntaxError: invalid syntax```

mbadolato avatar Mar 03 '21 04:03 mbadolato

Pretty sure type hinting was introduced in 3.5, so it's no surprise the above breaks in 2.7.

Are there additional details around what breaks?

I have noticed that PyYAML is required, though there's no requirements.txt to hold dependencies for tooling. With that installed, everything has been working fine for me.

jdhmtl avatar Jun 14 '21 21:06 jdhmtl

I tried with PyYAML installed and saw no diff but I didn't try in 2.x and 3.x so maybe that helps

mbadolato avatar Jun 28 '21 19:06 mbadolato

I'm having a similar issue. I'm on Arch Linux trying to convert some of these. This is what Python exits on:

  File "/home/thomas/Projects/iTerm2-Color-Schemes/tools/./update_all.py", line 39, in <module>
    xrdb2konsole.main('../xrdb/', '../konsole/')
  File "/home/thomas/Projects/iTerm2-Color-Schemes/tools/xrdb2konsole.py", line 60, in main
    bg_color = hex_to_rgb(bg_regex.search(xrdb_data).group(1))
AttributeError: 'NoneType' object has no attribute 'group' 

I'm running Python 3.10.4

thomascft avatar Jun 08 '22 21:06 thomascft

@thomascft It may be missing some plugins?

I just went into the tools directory, ran python3 update_all.py and it ran completely, and updated a few files that needed it

$ python3 --version
Python 3.9.13
$ cd tools
$ python3 ./update_all.py
OK --> ../xrdb/Dark+.xrdb
OK --> ../xrdb/Tomorrow Night Bright.xrdb
[snip]
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   ../electerm/Dark+.txt
	modified:   ../tilda/Dark+.itermcolors_config_0
	modified:   ../vscode/Dark+.json

mbadolato avatar Jun 08 '22 22:06 mbadolato

@thomascft It may be missing some plugins?

I just went into the tools directory, ran python3 update_all.py and it ran completely, and updated a few files that needed it

$ python3 --version
Python 3.9.13
$ cd tools
$ python3 ./update_all.py
OK --> ../xrdb/Dark+.xrdb
OK --> ../xrdb/Tomorrow Night Bright.xrdb
[snip]
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   ../electerm/Dark+.txt
	modified:   ../tilda/Dark+.itermcolors_config_0
	modified:   ../vscode/Dark+.json

Very Possible, what exactly do I need to install?

thomascft avatar Jun 08 '22 23:06 thomascft

@mbadolato, what plugins do I need to install for all the scripts to work?

thomascft avatar Jun 14 '22 04:06 thomascft

@thomascft I don't know. The script was a contribution and I apparently have the plugins on my system but I don't know offhand. If you look at the script you can see what libraries it's importing and trying installing one-by-one perhaps?

mbadolato avatar Jun 14 '22 19:06 mbadolato

Will do, I can push a requirements.txt or just add something to the README.md. I'll put it together in a docker container so I don't get any conflicts either.

thomascft avatar Jun 14 '22 21:06 thomascft

So... it spat this out and I ignored it cause sometimes I see this stuff with other programs. ./iterm2xrdb:12:in scan': invalid byte sequence in US-ASCII (ArgumentError) from ./iterm2xrdb:12:in <main>' Setting LANG=en_US.UTF-8 fixed it. The odd thing is that my locale is set to that.

thomascft avatar Jun 14 '22 22:06 thomascft