facelessuser / ColorHelper

Sublime plugin that provides helpful color previews and tooltips
https://facelessuser.github.io/ColorHelper/
MIT License
254 stars 30 forks source link

Restrict version in package_control_channel. #231

Closed deathaxe closed 1 year ago

deathaxe commented 1 year ago

Description

ColorHelper uses TextInputHandler.

Maybe restrict installation via package_control_channel, so it can't be installed on earlier ST versions, which don't support it?

Traceback (most recent call last):
  File "C:\Apps\Sublime Text 3143\sublime_plugin.py", line 109, in reload_plugin
    m = importlib.import_module(modulename)
  File "./python3.3/importlib/__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "C:\Apps\Sublime Text 3143\sublime_plugin.py", line 915, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "ch_tool_edit in C:\Apps\Sublime Text 3143\Data\Installed Packages\ColorHelper.sublime-package", line 9, in <module>
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "C:\Apps\Sublime Text 3143\sublime_plugin.py", line 915, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "ch_tools in C:\Apps\Sublime Text 3143\Data\Installed Packages\ColorHelper.sublime-package", line 50, in <module>
AttributeError: 'module' object has no attribute 'TextInputHandler'
reloading plugin ColorHelper.ch_tools
Traceback (most recent call last):
  File "C:\Apps\Sublime Text 3143\sublime_plugin.py", line 109, in reload_plugin
    m = importlib.import_module(modulename)
  File "./python3.3/importlib/__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "C:\Apps\Sublime Text 3143\sublime_plugin.py", line 915, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "ch_tools in C:\Apps\Sublime Text 3143\Data\Installed Packages\ColorHelper.sublime-package", line 50, in <module>
AttributeError: 'module' object has no attribute 'TextInputHandler'
facelessuser commented 1 year ago

You can tell I haven't tested on ST 3 in a while. I may place a switch around unsupported features. The plan was to drop ST3 as soon as PC supported PY 3.8. I guess ST3 users may not be using this package though as I haven't heard any complaints until now.

deathaxe commented 1 year ago

Just sumbled on it while testing PC compatibility with ST3143. Maybe not of high prio.

facelessuser commented 1 year ago

Yeah, I imagine the new input handle tools just need to be switched out. I'll take a look though. I don't think it'll be too much work.

facelessuser commented 1 year ago

Hmm, seems TextInputHandler was added in 3170. So, maybe I just need to bump the minimum version. I'll test this out on the latest ST3. This would explain why I don't get complaints. I assume most ST3 users are on the latest.

facelessuser commented 1 year ago

Okay, it is working on ST3 latest, so I can maybe bump the minimum version to 3170. I thought maybe I had added features completely incompatible with ST3, but it looks like I did test them on ST3 before I added them 😅.

facelessuser commented 1 year ago

Fix for PC https://github.com/wbond/package_control_channel/pull/8608

Closing this issue as the required changes have been requested. Now we wait for PC to accept them.