Skip to content

Commit

Permalink
Add CallTargetBrowserPython
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Oct 1, 2021
1 parent 000b812 commit 52483bd
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 0 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
helpers
callTargetFor: aMethodName of: aModuleName
| vmObject |
vmObject := (self methodFor: aMethodName of: aModuleName) vmObject.
^ (vmObject respondsTo: #function)
ifTrue: [ (vmObject function respondsTo: #callTarget)
ifTrue: [ vmObject function callTarget ]
ifFalse: nil ]
ifFalse: nil
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
helpers
methodGetter
"MethodGetter := nil"
^ MethodGetter ifNil: [ MethodGetter := Polyglot eval: #python string:
'import sys; lambda mod_name, meth_name : getattr(sys.modules[str(mod_name)], str(meth_name))' ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
helpers
methodListGetter
"MethodListGetter := nil"
^ MethodListGetter ifNil: [ MethodListGetter := Polyglot eval: #python string:
'import sys; lambda mod_name : [x for x in dir(sys.modules[str(mod_name)]) if x[0].islower()]' ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
toolbuilder
labelString
| label |
label := 'CallTargetBrowser for GraalPython'.
self selectedModuleName
ifNotNil: [ :name | label := label, ': ', name ].
^ label
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
toolbuilder
moduleAndClassList
^ ((Polyglot eval: #python string: 'import sys; list(sys.modules.keys())')
asCollection collect: [ :ea | ea asString ]) sorted
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"class" : {
"callTargetFor:of:" : "fn 10/1/2021 13:15",
"methodGetter" : "fn 10/1/2021 13:00",
"methodListGetter" : "fn 10/1/2021 13:16" },
"instance" : {
"labelString" : "fn 10/1/2021 13:04",
"moduleAndClassList" : "fn 10/1/2021 13:05" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"category" : "TruffleSqueak-Utilities",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "CallTargetBrowserPython",
"pools" : [
],
"super" : "CallTargetBrowserRuby",
"type" : "normal" }

0 comments on commit 52483bd

Please sign in to comment.