Skip to content

Commit 8d2cfbb

Browse files
committed
diff.py: now copying the history logs and PIs to repository
1 parent 03571b7 commit 8d2cfbb

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

diff.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@
1414

1515
import os.path as osp
1616
import re
17+
import shutil
1718

1819
# Local imports
19-
from winpython import utils
20+
from winpython import utils, config
21+
22+
23+
CHANGELOGS_DIR = osp.join(config.get_data_path(), osp.pardir, osp.pardir,
24+
'changelogs')
25+
assert osp.isdir(CHANGELOGS_DIR)
2026

2127

2228
class Package(object):
@@ -69,6 +75,9 @@ def from_file(self, basedir):
6975
with open(fname, 'rb') as fdesc:
7076
text = fdesc.read()
7177
self.from_text(text)
78+
79+
# Copy to winpython/changelogs
80+
shutil.copyfile(fname, osp.join(CHANGELOGS_DIR, osp.basename(fname)))
7281

7382
def from_text(self, text):
7483
version = re.match(self.WINPYTHON_PATTERN, text).groups()[0]
@@ -149,6 +158,8 @@ def write_changelog(version1, version2, rootdir=None):
149158
fname = osp.join(basedir, 'build', 'WinPython-%s_History.txt' % version2)
150159
with open(fname, 'wb') as fdesc:
151160
fdesc.write(text)
161+
# Copy to winpython/changelogs
162+
shutil.copyfile(fname, osp.join(CHANGELOGS_DIR, osp.basename(fname)))
152163

153164

154165
def test_parse_package_index_wiki(version, rootdir=None):
@@ -171,14 +182,9 @@ def test_compare(basedir, version1, version2):
171182

172183
if __name__ == '__main__':
173184
# test_parse_package_index_wiki('2.7.3.3')
174-
# print(compare_package_indexes('2.7.3.1', '2.7.3.3'))
175-
write_changelog('2.7.3.0', '2.7.3.1')
176-
write_changelog('2.7.3.1', '2.7.3.2')
177-
write_changelog('2.7.3.2', '2.7.3.3')
178-
write_changelog('2.7.3.3', '2.7.4.0')
179-
write_changelog('2.7.4.0', '2.7.4.1')
180-
write_changelog('2.7.4.1', '2.7.4.2')
185+
print(compare_package_indexes('2.7.3.1', '2.7.3.3'))
186+
# write_changelog('2.7.4.0', '2.7.4.1')
187+
# write_changelog('2.7.4.1', '2.7.5.0')
181188
# write_changelog('3.3.0.0beta1', '3.3.0.0beta2')
182-
write_changelog('3.3.0.0beta2', '3.3.1.0')
183-
write_changelog('3.3.1.0', '3.3.1.1')
184-
write_changelog('3.3.1.1', '3.3.1.2')
189+
# write_changelog('3.3.1.0', '3.3.1.1')
190+
# write_changelog('3.3.1.1', '3.3.2.0')

0 commit comments

Comments
 (0)