Ticket #638 (closed defect: fixed)

Opened 4 years ago

Last modified 2 years ago

"Playwave" example not working: directory not found?

Reported by: sascha_silbe Owned by: lfaraone
Priority: Normal Milestone: 0.86
Component: Pippy Version: Git as of bugdate
Severity: Major Keywords: r?
Cc: jpichon Distribution/OS: Unspecified
Bug Status: Unconfirmed

Description (last modified by tomeu) (diff)

The "Playwave" example isn't working:

Traceback (most recent call last):

File "/home/sugar/.sugar/default/org.laptop.Pippy/tmp/pippy_app.py", line 5, in <module>

pippy.sound.playWave(sound='didjeridu', loop=True, duration=5)

File "/home/sugar/sugar-jhbuild/install/share/sugar/activities/Pippy.activity/library/pippy/sound.py", line 157, in playWave

fullname = finddir() + str(sound)

TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

Attachments

0001-Add-error-message-to-PlayWave-to-explain-missing-dep.patch Download (0.8 KB) - added by jpichon 3 years ago.
Display error message when sound is not found
0001-Add-platform-independent-path-638.patch Download (0.8 KB) - added by jpichon 3 years ago.

Change History

Changed 4 years ago by tomeu

  • priority changed from Unspecified by Maintainer to Normal
  • severity changed from Unspecified to Major
  • description modified (diff)
  • milestone changed from Unspecified by Release Team to 0.86

Changed 3 years ago by jpichon

Display error message when sound is not found

Changed 3 years ago by jpichon

  • cc jpichon added

This is happening because PlayWave relies on TamTamEdit to provide the sound, which isn't always installed by default.

The Getsound example works around this by providing a helpful error message when finddir() returns None, so I'm attaching a patch to do the same for Playwave. Let me know if there would be a better way to deal with this.

Changed 3 years ago by sascha_silbe

I get the same error even after installing TamTam Edit. TamTam Edit itself doesn't play any sound, but that's a different bug.

Changed 3 years ago by jpichon

Thank you for the feedback. I was so keen on removing the stack trace and displaying an error message that I didn't properly check the validity of the message itself, sorry! It looks like the directory paths for TamTamEdit are hardcoded incorrectly in sound.py. Installing TamTamEdit doesn't work for the "Getsound" example either, I'm looking into it at the same time.

Is there a recommended way to access activity directories from Sugar? I've had some success with adding the following to finddir() in sound.py so far, though I still need to test it further and on different configurations:

    tamtam_dir = "TamTamEdit.activity/common/Resources/Sounds/"
    if "SUGAR_PATH" in os.environ:
        dirs.append(os.environ["SUGAR_PATH"] + "/activities/" + tamtam_dir)
    dirs.append(os.path.expanduser("~") + "/Activities/" + tamtam_dir)

Changed 3 years ago by jpichon

Changed 3 years ago by jpichon

  • keywords r? added

Here's a second patch that complements the first one and works for the "Getsoundlist" example as well. With the patch, they should both show the correct output if TamTamEdit is installed, and display an error message if it isn't.

Changed 2 years ago by RafaelOrtiz

This should be fixed in v40 of pippy.


Changed 2 years ago by RafaelOrtiz

  • status changed from new to closed
  • resolution set to fixed

confirmed as fixed.

Note: See TracTickets for help on using tickets.