X Tutup
Skip to content

Commit 501d00d

Browse files
committed
small cleanup
1 parent c76927a commit 501d00d

File tree

1 file changed

+15
-25
lines changed

1 file changed

+15
-25
lines changed

make.py

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -218,17 +218,23 @@ def __init__(self, build_number, release_level, target, wheeldir,
218218
self._docsdirs = docsdirs
219219
self.verbose = verbose
220220
self.winpydir = None
221-
self.python_fname = None
222-
self.python_name = None
223-
self.python_version = None
224-
self.python_fullversion = None
225221
self.distribution = None
226222
self.installed_packages = []
227223
self.simulation = simulation
228224
self.basedir = basedir # added to build from winpython
229225
self.install_options = install_options
230226
self.flavor = flavor
231227

228+
self.python_fname = self.get_package_fname(
229+
r'python-([0-9\.rcba]*)((\.|\-)amd64)?\.(zip|zip)')
230+
self.python_name = osp.basename(self.python_fname)[:-4]
231+
self.distname = 'win%s' % self.python_name
232+
vlst = re.match(r'winpython-([0-9\.]*)', self.distname
233+
).groups()[0].split('.')
234+
self.python_version = '.'.join(vlst[:2])
235+
self.python_fullversion = '.'.join(vlst[:3])
236+
237+
232238
@property
233239
def package_index_wiki(self):
234240
"""Return Package Index page in Wiki format"""
@@ -278,7 +284,6 @@ def get_tool_path(relpath, checkfunc):
278284
tools += ['[%s](%s) | %s | %s' % (name, url, ver, desc)]
279285

280286
# get all packages installed in the changelog, whatever the method
281-
self.installed_packages = []
282287
self.installed_packages = self.distribution.get_installed_packages()
283288

284289
packages = ['[%s](%s) | %s | %s'
@@ -305,6 +310,7 @@ def get_tool_path(relpath, checkfunc):
305310
(' %s' % self.release_level), '\n'.join(tools),
306311
self.python_fullversion, python_desc, '\n'.join(packages))
307312

313+
# @property makes self.winpyver becomes a call to self.winpyver()
308314
@property
309315
def winpyver(self):
310316
"""Return WinPython version (with flavor and release level!)"""
@@ -321,11 +327,6 @@ def winpy_arch(self):
321327
"""Return WinPython architecture"""
322328
return '%d' % self.distribution.architecture
323329

324-
@property
325-
def pyqt_arch(self):
326-
"""Return distribution architecture, in PyQt format: x32/x64"""
327-
return 'x%d' % self.distribution.architecture
328-
329330
@property
330331
def py_arch(self):
331332
"""Return distribution architecture, in Python distutils format:
@@ -1296,20 +1297,12 @@ def make(self, remove_existing=True, requirements=None, my_winpydir=None): #, f
12961297
if self.simulation:
12971298
print("WARNING: this is just a simulation!", file=sys.stderr)
12981299

1299-
self.python_fname = self.get_package_fname(
1300-
r'python-([0-9\.rcba]*)((\.|\-)amd64)?\.(zip|zip)')
1301-
self.python_name = osp.basename(self.python_fname)[:-4]
1302-
distname = 'win%s' % self.python_name
1303-
vlst = re.match(r'winpython-([0-9\.]*)', distname
1304-
).groups()[0].split('.')
1305-
self.python_version = '.'.join(vlst[:2])
1306-
self.python_fullversion = '.'.join(vlst[:3])
1307-
print(self.python_fname,self.python_name , distname, self.python_version, self.python_fullversion)
1300+
print(self.python_fname,self.python_name , self.distname, self.python_version, self.python_fullversion)
13081301
# Create the WinPython base directory
13091302
self._print("Creating WinPython %s base directory"
13101303
% self.python_version)
13111304
if my_winpydir is None:
1312-
self.winpydir = osp.join(self.target, distname)
1305+
self.winpydir = osp.join(self.target, self.distname)
13131306
else:
13141307
self.winpydir = osp.join(self.target, my_winpydir)
13151308
if osp.isdir(self.winpydir) and remove_existing \
@@ -1334,10 +1327,9 @@ def make(self, remove_existing=True, requirements=None, my_winpydir=None): #, f
13341327
if remove_existing:
13351328
if not self.simulation:
13361329
self._add_msvc_files()
1337-
if not self.simulation:
13381330
self._create_batch_scripts_initial()
1339-
self._create_batch_scripts() # which set mingwpy as compiler
1340-
# launchers at the beginning
1331+
self._create_batch_scripts()
1332+
# always create all launchers (as long as it is NSIS-based)
13411333
self._create_launchers()
13421334

13431335

@@ -1499,8 +1491,6 @@ def make_all(build_number, release_level, pyver, architecture,
14991491
# define a pre-defined winpydir, instead of having to guess
15001492

15011493
# extract the python subversion to get WPy64-3671b1
1502-
dist.python_fname = dist.get_package_fname(
1503-
r'python-([0-9\.rcba]*)((\.|\-)amd64)?\.(zip|zip)')
15041494
my_x = ''.join(dist.python_fname.replace('.amd64','').split('.')[-2:-1])
15051495
while not my_x.isdigit() and len(my_x)>0:
15061496
my_x = my_x[:-1]

0 commit comments

Comments
 (0)
X Tutup