@@ -62,24 +62,26 @@ def upgrade_wiki(self, other):
62
62
63
63
64
64
class PackageIndex (object ):
65
- WINPYTHON_PATTERN = r'\#\# WinPython ([0-9\.a-zA-Z]*)'
65
+ WINPYTHON_PATTERN = r'\#\# WinPython\-*[0-9b-t]* ([0-9\.a-zA-Z]*)'
66
66
TOOLS_LINE = '### Tools'
67
67
PYTHON_PACKAGES_LINE = '### Python packages'
68
68
HEADER_LINE1 = 'Name | Version | Description'
69
69
HEADER_LINE2 = '-----|---------|------------'
70
70
71
- def __init__ (self , version , basedir = None , flavor = '' ):
71
+ def __init__ (self , version , basedir = None , flavor = '' , architecture = 64 ):
72
72
self .version = version
73
73
self .other_packages = {}
74
74
self .python_packages = {}
75
75
self .flavor = flavor
76
76
self .basedir = basedir
77
+ self .architecture = architecture
77
78
self .from_file (basedir )
78
79
79
80
def from_file (self , basedir ):
80
81
#fname = osp.join(basedir, 'build%s' % self.flavor,
81
82
fname = osp .join (CHANGELOGS_DIR ,
82
- 'WinPython%s-%s.md' % (self .flavor , self .version ))
83
+ 'WinPython%s-%sbit-%s.md' % (self .flavor ,
84
+ self .architecture , self .version ))
83
85
with open (fname , 'r' ) as fdesc : # python3 doesn't like 'rb'
84
86
text = fdesc .read ()
85
87
self .from_text (text )
@@ -178,8 +180,8 @@ def compare_package_indexes(version2, version1=None, basedir=None, flavor='',
178
180
" distribution since version %s." % (architecture ,
179
181
version1 + flavor1 ),
180
182
"" , "" ])
181
- pi1 = PackageIndex (version1 , basedir = basedir , flavor = flavor1 )
182
- pi2 = PackageIndex (version2 , basedir = basedir , flavor = flavor )
183
+ pi1 = PackageIndex (version1 , basedir = basedir , flavor = flavor1 , architecture = architecture )
184
+ pi2 = PackageIndex (version2 , basedir = basedir , flavor = flavor , architecture = architecture )
183
185
tools_text = diff_package_dicts (pi1 .other_packages , pi2 .other_packages )
184
186
if tools_text :
185
187
text += PackageIndex .TOOLS_LINE + '\r \n \r \n ' + tools_text
@@ -215,9 +217,9 @@ def write_changelog(version2, version1=None, basedir=None, flavor='',
215
217
shutil .copyfile (fname , osp .join (CHANGELOGS_DIR , osp .basename (fname )))
216
218
217
219
218
- def test_parse_package_index_wiki (version , basedir = None , flavor = '' ):
220
+ def test_parse_package_index_wiki (version , basedir = None , flavor = '' , architecture = 64 ):
219
221
"""Parse the package index Wiki page"""
220
- pi = PackageIndex (version , basedir = basedir , flavor = flavor )
222
+ pi = PackageIndex (version , basedir = basedir , flavor = flavor , architecture = architecture )
221
223
utils .print_box ("WinPython %s:" % pi .version )
222
224
utils .print_box ("Tools:" )
223
225
for package in pi .other_packages .values ():
@@ -235,8 +237,8 @@ def test_compare(basedir, version2, version1, architecture=64):
235
237
236
238
237
239
if __name__ == '__main__' :
238
- print (compare_package_indexes ('3.4.4 .1' , '3.4.3.6 ' ,
239
- basedir = 'D:\Winpython\b asedir34 ' , flavor = 'Slim ' , flavor1 = '' ))
240
+ print (compare_package_indexes ('3.6.1 .1' , '3.6.1.0 ' ,
241
+ basedir = 'D:\Winpython\b asedir36 ' , flavor = 'Qt5 ' , flavor1 = 'Qt5' , architecture = 32 ))
240
242
# test_parse_package_index_wiki('2.7.3.3')
241
243
# print(compare_package_indexes('2.7.3.3', '2.7.3.1'))
242
244
# write_changelog('2.7.4.1', '2.7.4.0')
0 commit comments