Opened 15 years ago

Closed 13 years ago

Last modified 11 years ago

#638 closed defect (fixed)

"Playwave" example not working: directory not found?

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

Description (last modified by tomeu)

The "Playwave" example isn't working:

Traceback (most recent call last):

File "/home/sugar/.sugar/default/org.laptop.Pippy/tmp/", 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/", line 157, in playWave

fullname = finddir() + str(sound)

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

Attachments (2)

0001-Add-error-message-to-PlayWave-to-explain-missing-dep.patch (847 bytes) - added by jpichon 14 years ago.
Display error message when sound is not found
0001-Add-platform-independent-path-638.patch (845 bytes) - added by jpichon 14 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 14 years ago by tomeu

  • Description modified (diff)
  • Milestone changed from Unspecified by Release Team to 0.86
  • Priority changed from Unspecified by Maintainer to Normal
  • Severity changed from Unspecified to Major

Changed 14 years ago by jpichon

Display error message when sound is not found

comment:2 Changed 14 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.

comment:3 Changed 14 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.

comment:4 Changed 14 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 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 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)

comment:5 Changed 14 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.

comment:6 Changed 13 years ago by RafaelOrtiz

This should be fixed in v40 of pippy.

comment:7 Changed 13 years ago by RafaelOrtiz

  • Resolution set to fixed
  • Status changed from new to closed

confirmed as fixed.

comment:8 Changed 11 years ago by dnarvaez

  • Milestone 0.86 deleted

Milestone 0.86 deleted

Note: See TracTickets for help on using tickets.