Browse Source

Add /usr/share/pixmaps as fallback icons path #14

Add '/usr/share/pixmaps' as a fallback icons path as suggested
on issue #14 when XDG_DATA_DIRS is not defined.
doc-issue-template
MrS0m30n3 10 years ago
parent
commit
24ca2c82d6
1 changed files with 14 additions and 6 deletions
  1. 20
      setup.py

20
setup.py

@ -1,7 +1,7 @@
#!/usr/bin/env python2
import os
import sys
from os import name
PY2EXE = len(sys.argv) >= 2 and sys.argv[1] == 'py2exe'
@ -56,7 +56,12 @@ if PY2EXE:
icons_path = 'icons'
else:
# On windows you have to copy the icons manually if you dont use py2exe
icons_path = '/usr/local/share/icons/hicolor/'
xdg_data_dirs = os.getenv('XDG_DATA_DIRS')
if xdg_data_dirs is None:
icons_path = '/usr/share/pixmaps/'
else:
icons_path = '/usr/local/share/icons/hicolor/'
# Set params
if PY2EXE:
@ -72,10 +77,13 @@ if PY2EXE:
}
else:
data_files = []
if name != 'nt':
for index, size in enumerate(ICONS_SIZE):
data_file = (icons_path + size + '/apps', [ICONS_LIST[index]])
data_files.append(data_file)
if os.name != 'nt':
if xdg_data_dirs is not None:
for index, size in enumerate(ICONS_SIZE):
data_file = (icons_path + size + '/apps', [ICONS_LIST[index]])
data_files.append(data_file)
else:
data_files = [(icons_path, ICONS_LIST)]
params = {
'data_files': data_files

Loading…
Cancel
Save