opencog / atomspace

The OpenCog (hyper-)graph database and graph rewriting system
https://wiki.opencog.org/w/AtomSpace
Other
822 stars 234 forks source link

Python: coserver shell handling is broken. opencog/cogserver#3 #2413

Open linas opened 4 years ago

linas commented 4 years ago

Python printing in the cogserver shell is (was??) broken, due to changes in PythonEval in the atomspace. For details, see opencog/cogserver#3

linas commented 4 years ago

@noskill @vsbogd fyi

linas commented 4 years ago

See also opencog/cogserver#2 which might be a duplicate

noskill commented 4 years ago

Why cogserver uses PythonEval from atomspace? It can just call PyRun_InteractiveLoopFlags

linas commented 4 years ago

Why?

History, I suppose. And simplicity. The Shell class is a generic class that takes one line of text input from, runs it, and then returns a text string. So it will work for "anything", and attaching it to PythonEval was easy.

We don''t quite have a good way of handing off the whole interactive loop to some handler; this is mostly due to the complexity of using boost::asio (which I'm unhappy about, because its .. complex, hard to use, and buggy.) I don't think it has an API where it can just hand off a socket to someone else to manage.

The cogserver python shell was used to communicate with ROS (since ROS is 90% python) but I don't think there are many (or any) unit tests for it.