Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The update_all.py script appears to be broken #285

Open
mbadolato opened this issue Mar 3, 2021 · 11 comments
Open

The update_all.py script appears to be broken #285

mbadolato opened this issue Mar 3, 2021 · 11 comments

Comments

@mbadolato
Copy link
Owner

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
Copy link
Owner Author

Python 3.9.2

@mbadolato
Copy link
Owner Author

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```

@jdhmtl
Copy link
Collaborator

jdhmtl commented Jun 14, 2021

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.

@mbadolato
Copy link
Owner Author

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

@thomascft
Copy link
Contributor

thomascft commented Jun 8, 2022

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

@mbadolato
Copy link
Owner Author

@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

@thomascft
Copy link
Contributor

@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
Copy link
Contributor

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

@mbadolato
Copy link
Owner Author

@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?

@thomascft
Copy link
Contributor

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
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants