inprove python interface.

This commit is contained in:
Vitor Santos Costa
2012-11-27 00:16:34 +00:00
parent 46cec46fa8
commit f1874ecec0
3 changed files with 255 additions and 5 deletions

View File

@@ -98,6 +98,10 @@ python_eval_term(Expression, O) :-
atom(Exp)
->
python_access(MRef, Exp, O)
;
Exp = Obj:Method
->
python_access(MRef, Exp, O)
;
functor(Exp, F, _),
python_f(MRef, F, FRef),
@@ -115,12 +119,12 @@ python_check_args(FRef, Exp, NExp) :-
Exp =.. [F|LArgs],
match_args(LArgs, Dict, NLArgs, _),
NExp =.. [F|NLArgs].
python_check_args(FRef, Exp, NExp).
python_check_args(FRef, Exp, Exp).
fetch_args(FRef, Args) :-
python_import('inspect', M),
python_f(M, getargspec, F),
python_apply(F, getargspec(FRef), ExtraArgs),
python_apply(F, getargspec(FRef), Args),
ExtraArgs=t(Args, _, _, _).