Philipp Hörist pushed to branch master at gajim / gajim
Commits:
-
3d8be9eb
by Philipp Hörist at 2017-07-03T11:32:47+02:00
1 changed file:
Changes:
| ... | ... | @@ -16,6 +16,7 @@ |
| 16 | 16 |
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 17 | 17 |
|
| 18 | 18 |
import os
|
| 19 |
+import sys
|
|
| 19 | 20 |
import logging
|
| 20 | 21 |
import importlib.util as imp
|
| 21 | 22 |
from collections import OrderedDict
|
| ... | ... | @@ -58,8 +59,13 @@ class SubPixbuf: |
| 58 | 59 |
return subpixbuf
|
| 59 | 60 |
|
| 60 | 61 |
def load(path):
|
| 61 |
- theme_path = os.path.join(path, 'emoticons_theme.py')
|
|
| 62 |
- spec = imp.spec_from_file_location("emoticons_theme.py", theme_path)
|
|
| 62 |
+ module_name = 'emoticons_theme.py'
|
|
| 63 |
+ theme_path = os.path.join(path, module_name)
|
|
| 64 |
+ if sys.platform == 'win32' and not os.path.exists(theme_path):
|
|
| 65 |
+ module_name = 'emoticons_theme.pyc'
|
|
| 66 |
+ theme_path = os.path.join(path, module_name)
|
|
| 67 |
+ |
|
| 68 |
+ spec = imp.spec_from_file_location(module_name, theme_path)
|
|
| 63 | 69 |
try:
|
| 64 | 70 |
theme = imp.module_from_spec(spec)
|
| 65 | 71 |
spec.loader.exec_module(theme)
|