markusschloesser / MackieC4_P3

A Mackie C4 Midi Remote Script for Ableton 11
16 stars 2 forks source link

Live10 can't import "old_hasattr" #54

Closed BilldarBagdar closed 3 years ago

BilldarBagdar commented 3 years ago

This is the error:

2021-04-07T00:00:57.693400: info: RemoteScriptError:     
2021-04-07T00:00:57.693400: info: RemoteScriptError: from . import track_util

2021-04-07T00:00:57.693400: info: RemoteScriptError:   File "C:\ProgramData\Ableton\Live 10 Suite\Resources\MIDI Remote Scripts\MarkusC4test\track_util.py", line 9, in <module>

2021-04-07T00:00:57.693400: info: RemoteScriptError:     
2021-04-07T00:00:57.693400: info: RemoteScriptError: from ableton.v2.base import const, compose, depends, find_if, liveobj_valid, old_hasattr

2021-04-07T00:00:57.693400: info: RemoteScriptError: ImportError
2021-04-07T00:00:57.693400: info: RemoteScriptError: : 
2021-04-07T00:00:57.693400: info: RemoteScriptError: cannot import name old_hasattr
2021-04-07T00:00:57.693400: info: RemoteScriptError: 

unless there is a replacement strategy, like if we can find a Live 10 equivalent or whatever for 'old_hasattr' then we could create an alias name and assign 'old_hasattr' to the alias for Live 11 and the equivalent to the alias for Live 10.

Without such a strategy, we may need to cut the cord and just declare the Live 10 version doesn't support track folding / unfolding. But I'm not ready to throw in that towel yet...

markusschloesser commented 3 years ago

old_hasattr is currently not needed for grouptrack folding. the stuff starting at https://github.com/markusschloesser/MackieC4_P3/blob/c519a53e1fee84d0d55b76b16ded5ddffbd76c17/wip/MackieC4/track_util.py#L88 is only in there for later. I use https://github.com/markusschloesser/MackieC4_P3/blob/c519a53e1fee84d0d55b76b16ded5ddffbd76c17/wip/MackieC4/track_util.py#L40 for folding and that uses liveObjValid I actually deleted L88 and following in my newest branch

markusschloesser commented 3 years ago

also see https://github.com/gluon/AbletonLive11_MIDIRemoteScripts/blob/e6e80f2b5218cef15068f8039931ff5acfa29de5/ableton/v2/base/util.py#L764 imho it means old_hasattr is only there for backwards compatibility and could be worked around (should we come to this) by if sys Live 10 etc

BilldarBagdar commented 3 years ago

Interesting. I either didn't even try Live again after I updated that specific import, or I didn't realize Live had completely booted my "MarkusC4Test" remote script (and reloaded something else) from the options>midi preferences because of the failed import. Anyway, false alarm it seems. IIRC, when an import fails, it means the script won't compile and if it won't compile, it won't appear for you to select as a remote device. But I didn't check the Options first, I went straight to the log saw the error and "fixed the import" with the Py3 guard. I guess I tried Live again without checking the Options to confirm this remote script was loaded. I know I intended to come back tonight and "have a look at it". As soon as I started looking around, I checked options, and boom.