diff options
| author | tassaron | 2017-07-13 17:03:25 -0400 |
|---|---|---|
| committer | tassaron | 2017-07-13 17:03:25 -0400 |
| commit | 06c27a48bc3f52e15c15445d822e8a6f523ab98f (patch) | |
| tree | d238a05980dddef9c76786a755de04c33028088c /src/components/sound.py | |
| parent | b7931572a73d408dceecc4b17b784a0338e0e35b (diff) | |
more error messages for blank components
Diffstat (limited to 'src/components/sound.py')
| -rw-r--r-- | src/components/sound.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/components/sound.py b/src/components/sound.py index 9c114a8..2ffb682 100644 --- a/src/components/sound.py +++ b/src/components/sound.py @@ -34,7 +34,16 @@ class Component(Component): pass def properties(self): - return ['static', 'audio'] + props = ['static', 'audio'] + if not os.path.exists(self.sound): + props.append('error') + return props + + def error(self): + if not self.sound: + return "No audio file selected." + if not os.path.exists(self.sound): + return "The audio file selected no longer exists!" def audio(self): return (self.sound, {}) |
