| 116 | |
| 117 | |
| 118 | def getSoundPath(name): |
| 119 | # create a directory for sounds in: |
| 120 | if os_type in OS.UNIX_LIKE: |
| 121 | # for linux and bsd |
| 122 | # ~/.local/share/persepolis_download_manager/sounds |
| 123 | sounds_directory = os.path.join(home_address, '.local/share/persepolis_download_manager/sounds') |
| 124 | elif os_type in OS.OSX: |
| 125 | # for mac |
| 126 | # ~/Library/Application Support/<YourAppName>/sounds/ |
| 127 | sounds_directory = os.path.join(home_address, 'Library/Application Support/persepolis_download_manager/sounds/') |
| 128 | # Windows |
| 129 | else: |
| 130 | return None |
| 131 | |
| 132 | file_name = name + '.wav' |
| 133 | |
| 134 | file_path = os.path.join(sounds_directory, file_name) |
| 135 | |
| 136 | # return file_path if it exists. |
| 137 | if os.path.exists(file_path): |
| 138 | return file_path |
| 139 | else: |
| 140 | return None |
| 141 | |
| 142 | |
| 143 | def notifySend(message1, message2, time, sound, parent=None): |