1919except IOError :
2020 long_description = ''
2121
22- ################################################################################
22+ #############################################################################
2323# find_package_data is an Ian Bicking creation.
2424
2525# Provided as an attribute, so you can append to these instead
2929 './dist' , 'EGG-INFO' , '*.egg-info' )
3030
3131
32- def find_package_data (
33- where = '.' , package = '' ,
34- exclude = standard_exclude ,
35- exclude_directories = standard_exclude_directories ,
36- only_in_packages = True ,
37- show_ignored = False ):
32+ def find_package_data (where = '.' ,
33+ package = '' ,
34+ exclude = standard_exclude ,
35+ exclude_directories = standard_exclude_directories ,
36+ only_in_packages = True ,
37+ show_ignored = False ,
38+ ):
3839 """
3940 Return a dictionary suitable for use in ``package_data``
4041 in a distutils ``setup.py`` file.
@@ -74,7 +75,7 @@ def find_package_data(
7475 bad_name = False
7576 for pattern in exclude_directories :
7677 if (fnmatchcase (name , pattern )
77- or fn .lower () == pattern .lower ()):
78+ or fn .lower () == pattern .lower ()):
7879 bad_name = True
7980 if show_ignored :
8081 print >> sys .stderr , (
@@ -90,13 +91,16 @@ def find_package_data(
9091 new_package = package + '.' + name
9192 stack .append ((fn , '' , new_package , False ))
9293 else :
93- stack .append ((fn , prefix + name + '/' , package , only_in_packages ))
94+ stack .append ((fn ,
95+ prefix + name + '/' ,
96+ package ,
97+ only_in_packages ))
9498 elif package or not only_in_packages :
9599 # is a file
96100 bad_name = False
97101 for pattern in exclude :
98102 if (fnmatchcase (name , pattern )
99- or fn .lower () == pattern .lower ()):
103+ or fn .lower () == pattern .lower ()):
100104 bad_name = True
101105 if show_ignored :
102106 print >> sys .stderr , (
@@ -107,8 +111,66 @@ def find_package_data(
107111 continue
108112 out .setdefault (package , []).append (prefix + name )
109113 return out
110- ################################################################################
111-
114+ ############################################################################
115+
116+ us_pkg = 'virtualenvwrapper.user_scripts'
117+
118+ entry_points = {
119+ 'virtualenvwrapper.initialize' : [
120+ 'user_scripts = %s:initialize' % us_pkg ,
121+ 'project = virtualenvwrapper.project:initialize' ,
122+ ],
123+ 'virtualenvwrapper.initialize_source' : [
124+ 'user_scripts = %s:initialize_source' % us_pkg ,
125+ ],
126+
127+ 'virtualenvwrapper.pre_mkvirtualenv' : [
128+ 'user_scripts = %s:pre_mkvirtualenv' % us_pkg ,
129+ ],
130+ 'virtualenvwrapper.post_mkvirtualenv_source' : [
131+ 'user_scripts = %s:post_mkvirtualenv_source' % us_pkg ,
132+ ],
133+
134+ 'virtualenvwrapper.pre_cpvirtualenv' : [
135+ 'user_scripts = %s:pre_cpvirtualenv' % us_pkg ,
136+ ],
137+ 'virtualenvwrapper.post_cpvirtualenv_source' : [
138+ 'user_scripts = %s:post_cpvirtualenv_source' % us_pkg ,
139+ ],
140+
141+ 'virtualenvwrapper.pre_rmvirtualenv' : [
142+ 'user_scripts = %s:pre_rmvirtualenv' % us_pkg ,
143+ ],
144+ 'virtualenvwrapper.post_rmvirtualenv' : [
145+ 'user_scripts = %s:post_rmvirtualenv' % us_pkg ,
146+ ],
147+
148+ 'virtualenvwrapper.project.pre_mkproject' : [
149+ 'project = virtualenvwrapper.project:pre_mkproject' ,
150+ ],
151+ 'virtualenvwrapper.project.post_mkproject_source' : [
152+ 'project = virtualenvwrapper.project:post_mkproject_source' ,
153+ ],
154+
155+ 'virtualenvwrapper.pre_activate' : [
156+ 'user_scripts = %s:pre_activate' % us_pkg ,
157+ ],
158+ 'virtualenvwrapper.post_activate_source' : [
159+ 'user_scripts = %s:post_activate_source' % us_pkg ,
160+ 'project = virtualenvwrapper.project:post_activate_source' ,
161+ ],
162+
163+ 'virtualenvwrapper.pre_deactivate_source' : [
164+ 'user_scripts = %s:pre_deactivate_source' % us_pkg ,
165+ ],
166+ 'virtualenvwrapper.post_deactivate_source' : [
167+ 'user_scripts = %s:post_deactivate_source' % us_pkg ,
168+ ],
169+
170+ 'virtualenvwrapper.get_env_details' : [
171+ 'user_scripts = %s:get_env_details' % us_pkg ,
172+ ],
173+ }
112174
113175setup (
114176 name = PROJECT ,
@@ -155,68 +217,12 @@ def find_package_data(
155217 # Scan the input for package information
156218 # to grab any data files (text, images, etc.)
157219 # associated with sub-packages.
158- package_data = find_package_data (PROJECT ,
220+ package_data = find_package_data (PROJECT ,
159221 package = PROJECT ,
160222 only_in_packages = False ,
161223 ),
162224
163- entry_points = {
164- #'console_scripts': [ 'venvw_hook = virtualenvwrapper.hook_loader:main' ],
165- 'virtualenvwrapper.initialize' : [
166- 'user_scripts = virtualenvwrapper.user_scripts:initialize' ,
167- 'project = virtualenvwrapper.project:initialize' ,
168- ],
169- 'virtualenvwrapper.initialize_source' : [
170- 'user_scripts = virtualenvwrapper.user_scripts:initialize_source' ,
171- ],
172-
173- 'virtualenvwrapper.pre_mkvirtualenv' : [
174- 'user_scripts = virtualenvwrapper.user_scripts:pre_mkvirtualenv' ,
175- ],
176- 'virtualenvwrapper.post_mkvirtualenv_source' : [
177- 'user_scripts = virtualenvwrapper.user_scripts:post_mkvirtualenv_source' ,
178- ],
179-
180- 'virtualenvwrapper.pre_cpvirtualenv' : [
181- 'user_scripts = virtualenvwrapper.user_scripts:pre_cpvirtualenv' ,
182- ],
183- 'virtualenvwrapper.post_cpvirtualenv_source' : [
184- 'user_scripts = virtualenvwrapper.user_scripts:post_cpvirtualenv_source' ,
185- ],
186-
187- 'virtualenvwrapper.pre_rmvirtualenv' : [
188- 'user_scripts = virtualenvwrapper.user_scripts:pre_rmvirtualenv' ,
189- ],
190- 'virtualenvwrapper.post_rmvirtualenv' : [
191- 'user_scripts = virtualenvwrapper.user_scripts:post_rmvirtualenv' ,
192- ],
193-
194- 'virtualenvwrapper.project.pre_mkproject' : [
195- 'project = virtualenvwrapper.project:pre_mkproject' ,
196- ],
197- 'virtualenvwrapper.project.post_mkproject_source' : [
198- 'project = virtualenvwrapper.project:post_mkproject_source' ,
199- ],
200-
201- 'virtualenvwrapper.pre_activate' : [
202- 'user_scripts = virtualenvwrapper.user_scripts:pre_activate' ,
203- ],
204- 'virtualenvwrapper.post_activate_source' : [
205- 'user_scripts = virtualenvwrapper.user_scripts:post_activate_source' ,
206- 'project = virtualenvwrapper.project:post_activate_source' ,
207- ],
208-
209- 'virtualenvwrapper.pre_deactivate_source' : [
210- 'user_scripts = virtualenvwrapper.user_scripts:pre_deactivate_source' ,
211- ],
212- 'virtualenvwrapper.post_deactivate_source' : [
213- 'user_scripts = virtualenvwrapper.user_scripts:post_deactivate_source' ,
214- ],
215-
216- 'virtualenvwrapper.get_env_details' : [
217- 'user_scripts = virtualenvwrapper.user_scripts:get_env_details' ,
218- ],
219- },
225+ entry_points = entry_points ,
220226
221227 zip_safe = False ,
222- )
228+ )
0 commit comments