Skip to content

Commit fc849b3

Browse files
setup fix
1 parent 56bdda4 commit fc849b3

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

CodeReview/Config/ConfigInstall.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
####################################################################################################
2-
#
3-
# This file is Autogenerated by make-ConfigInstall
4-
#
5-
####################################################################################################
6-
71
####################################################################################################
82

93
import os
4+
import sys
105

116
####################################################################################################
127

@@ -20,7 +15,17 @@ class Path(object):
2015

2116
CodeReview_module_directory = PathTools.parent_directory_of(_this_file, step=2)
2217
config_directory = os.path.dirname(_this_file)
23-
share_directory = os.path.realpath(os.path.join(config_directory, '..', '..', 'share'))
18+
19+
##############################################
20+
21+
@staticmethod
22+
def share_directory():
23+
24+
path = os.path.dirname(Path.CodeReview_module_directory)
25+
if path.startswith(sys.exec_prefix):
26+
return os.path.join(sys.exec_prefix, 'share', 'CodeReview')
27+
else:
28+
return os.path.join(path, 'share')
2429

2530
####################################################################################################
2631

@@ -40,7 +45,7 @@ def find(config_file):
4045

4146
class Icon(object):
4247

43-
icon_directory = os.path.join(Path.share_directory, 'icons')
48+
icon_directory = os.path.join(Path.share_directory(), 'icons')
4449

4550
##############################################
4651

setup_data.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
####################################################################################################
2222

23+
import glob
2324
import os
2425

2526
from distutils.core import Extension
@@ -97,14 +98,18 @@ def read(file_name):
9798
'CodeReview.Logging',
9899
'CodeReview.Math',
99100
'CodeReview.PatienceDiff',
101+
'CodeReview.Repository',
100102
'CodeReview.Tools',
101103
],
102104
ext_modules=[Extension('CodeReview.PatienceDiff._patiencediff_c',
103105
['CodeReview/PatienceDiff/_patiencediff_c.c'])],
104106
# package_dir = {'CodeReview': 'CodeReview'},
105107
data_files=[
106-
(os.path.join(CodeReview_path, 'Config'),
107-
[os.path.join('CodeReview', 'Config', 'logging.yml')]),
108+
(os.path.join(CodeReview_path, 'Config'), [os.path.join('CodeReview', 'Config', 'logging.yml')]),
109+
('share/CodeReview/icons', glob.glob('share/icons/*.png')),
110+
('share/CodeReview/icons/32x32', glob.glob('share/icons/32x32/*.png')),
111+
('share/CodeReview/icons/48x48', glob.glob('share/icons/48x48/*.png')),
112+
('share/CodeReview/icons/svg', glob.glob('share/icons/svg/*.svg')),
108113
],
109114
long_description=long_description,
110115
# cf. http://pypi.python.org/pypi?%3Aaction=list_classifiers

0 commit comments

Comments
 (0)