-
Notifications
You must be signed in to change notification settings - Fork 53
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
[spinel-cli] add vendor path option #106
Conversation
aa5840d
to
ba5ad09
Compare
if options.vendor_path: | ||
options.vendor_path = os.path.abspath(options.vendor_path) | ||
vendor_path, vendor_module = os.path.split(options.vendor_path) | ||
sys.path.insert(0, vendor_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I discussed this briefly with @rlubos today. I think this is more than warranted in this particular case, in order to solve this problem without extra complications and with very little risk. That said, I'd very much like @mbolivar-nordic to confirm this view.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said, I'd very much like @mbolivar-nordic to confirm this view.
Yep, I think that's reasonable if you want the vendor module to be able to import other modules next to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, tested with @rlubos locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this enhancement! 👍
d73ca75
to
a6d96d4
Compare
…d#106) There's no need to join VendorSpinelPropertyHandler class with SpinelPropertyHandler since the methods in SPINEL_PROP_DISPATCH are located in different objects anyway. This allows to move vendor properties initialization into WpanApi class initializator, therefore allowing to use custom Vendor module based on the command line argument. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Introduce a --vendor-path option which allows to provide a custom location of the vendor package. It is also possible to provide this location with SPINEL_VENDOR_PATH environmental variable. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
a6d96d4
to
bb70dc6
Compare
There's no need to join VendorSpinelPropertyHandler class with SpinelPropertyHandler since the methods in SPINEL_PROP_DISPATCH are located in different objects anyway. This allows to move vendor properties initialization into WpanApi class initializator, therefore allowing to use custom Vendor module based on the command line argument. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Introduce a
--vendor-path
option which allows to provide a custom location of the vendor package. It is also possible to provide this location withSPINEL_VENDOR_PATH
environmental variable.