-
Notifications
You must be signed in to change notification settings - Fork 20
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
dylink
should use introspection instead of hardcoded RepyV2 API call names
#184
Comments
This would make API functions implicitly callable when provided by the On Tue, Aug 16, 2016 at 10:46 AM, aaaaalbert [email protected]
|
Note: This was previously filed as SeattleTestbed/repy_v2#70, but is not a problem of Repy. I slightly update / summarize the description here.
Calls can be added to the RepyV2 API by editing
namespace.py
. Unfortunately, libraries that aredylink
ed in do not get immediate access to new API calls unlessdylink.r2py
is also modified so that its understanding ofSTOCK_API
includes the added call's name. Otherwise, aNameError
is raised.To confuse matters, the
NameError
is only present when that code isdylink
ed in from another program. You can directly run it just fine, and it's also fine to run it as the main program underdylink
, i.e.repy.py restrictionsfile dylink.r2py that_code.r2py
.Instead of requiring manual changes triggered by peculiar-to-obscure error conditions, we can change
dylink
to just introspect its execution context (_context
) and recreateSTOCK_API
from all the objects oftype 'instancemethod'
.The reason for this seemingly weird type is that the Repy API functions are not visible as Python
function
types, but bound methodsNamespaceAPIFunctionWrapper.wrapped_function
. A template method for comparison may be created like so:The text was updated successfully, but these errors were encountered: