sugarlabs / Pippy

Pippy allows the student to examine, execute, and modify simple Python programs. In addition it is possible to write Python statements to play sounds, calculate expressions, or make simple text based interactive games.
GNU General Public License v2.0
11 stars 34 forks source link

Port to Python 3 #63

Closed Aniket21mathur closed 5 years ago

Aniket21mathur commented 5 years ago

Porting the activity to python 3. Tested with toolkit-gtk3(HEAD).

quozl commented 5 years ago
Traceback (most recent call last):
  File "/usr/bin/sugar-activity3", line 5, in <module>
    activityinstance.main()
  File "/usr/lib/python3.7/dist-packages/sugar3/activity/activityinstance.py", line 179, in main
    module = __import__(module_name)
  File "/usr/share/sugar/activities/Pippy.activity/pippy_app.py", line 82, in <module>
    from collabwrapper import CollabWrapper
  File "/usr/share/sugar/activities/Pippy.activity/collabwrapper.py", line 77, in <module>
    from telepathy.interfaces import \
ModuleNotFoundError: No module named 'telepathy'
Aniket21mathur commented 5 years ago

Thanks for pointing out please see #65 .

quozl commented 5 years ago

Rebased on https://github.com/sugarlabs/Pippy/pull/65 but it still doesn't work, this time;

Traceback (most recent call last):
  File "/usr/share/sugar/activities/Pippy.activity/pippy_app.py", line 635, in _go_button_cb
    self._reset_vte()
  File "/usr/share/sugar/activities/Pippy.activity/pippy_app.py", line 608, in _reset_vte
    self._vte.feed('\x1B[H\x1B[J\x1B[0;39m')
TypeError: Item 0: Must be number, not str
Traceback (most recent call last):
  File "/usr/share/sugar/activities/Pippy.activity/pippy_app.py", line 635, in _go_button_cb
    self._reset_vte()
  File "/usr/share/sugar/activities/Pippy.activity/pippy_app.py", line 608, in _reset_vte
    self._vte.feed('\x1B[H\x1B[J\x1B[0;39m')
TypeError: Item 0: Must be number, not str
Traceback (most recent call last):
  File "/usr/share/sugar/activities/Pippy.activity/pippy_app.py", line 635, in _go_button_cb
    self._reset_vte()
  File "/usr/share/sugar/activities/Pippy.activity/pippy_app.py", line 608, in _reset_vte
    self._vte.feed('\x1B[H\x1B[J\x1B[0;39m')
TypeError: Item 0: Must be number, not str
Traceback (most recent call last):
  File "/usr/share/sugar/activities/Pippy.activity/pippy_app.py", line 635, in _go_button_cb
    self._reset_vte()
  File "/usr/share/sugar/activities/Pippy.activity/pippy_app.py", line 608, in _reset_vte
    self._vte.feed('\x1B[H\x1B[J\x1B[0;39m')
TypeError: Item 0: Must be number, not str
1565938120.346632 ERROR root: Error saving activity object to datastore
Traceback (most recent call last):
  File "/usr/lib/python3.7/dist-packages/sugar3/activity/activity.py", line 1277, in _prepare_close
    self.save()
  File "/usr/lib/python3.7/dist-packages/sugar3/activity/activity.py", line 978, in save
    self.write_file(file_path)
  File "/usr/share/sugar/activities/Pippy.activity/pippy_app.py", line 1074, in write_file
    pippy_data = json.dumps(session_list)
  File "/usr/lib/python3.7/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python3.7/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.7/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python3.7/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type bytes is not JSON serializable

Test case is to type print("hello world") into the buffer and press the play (run) button.