Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f834ecbb
Commit
f834ecbb
authored
Oct 14, 2002
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor refactoring to avoid code duplication.
parent
19697bc3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
17 deletions
+10
-17
Doc/tools/mkpkglist
Doc/tools/mkpkglist
+10
-17
No files found.
Doc/tools/mkpkglist
View file @
f834ecbb
...
...
@@ -59,6 +59,13 @@ def get_size(prefix, ext):
fn
=
"%s-%s%s"
%
(
prefix
,
release
,
ext
)
return
int
(
round
(
os
.
path
.
getsize
(
fn
)
/
1024.0
))
def
get_file_cell
(
prefix
,
ext
,
have
):
if
have
:
kb
=
get_size
(
prefix
,
ext
)
return
FILE_TEMPLATE
%
(
release
,
prefix
,
release
,
ext
,
kb
)
else
:
return
NO_FILE_TEMPLATE
for
name
,
prefix
in
PKG_TYPES
:
zip_fn
=
"%s-%s.zip"
%
(
prefix
,
release
)
tgz_fn
=
"%s-%s.tgz"
%
(
prefix
,
release
)
...
...
@@ -71,23 +78,9 @@ for name, prefix in PKG_TYPES:
if
have_zip
or
have_tgz
or
have_bz2
:
print
" <tr><td>%s</td>"
%
name
if
have_zip
:
kb
=
get_size
(
prefix
,
".zip"
)
print
FILE_TEMPLATE
%
(
release
,
prefix
,
release
,
".zip"
,
kb
)
else
:
print
NO_FILE_TEMPLATE
if
have_tgz
:
kb
=
get_size
(
prefix
,
".tgz"
)
print
FILE_TEMPLATE
%
(
release
,
prefix
,
release
,
".tgz"
,
kb
)
else
:
print
NO_FILE_TEMPLATE
if
have_bz2
:
kb
=
get_size
(
prefix
,
".tar.bz2"
)
print
FILE_TEMPLATE
%
(
release
,
prefix
,
release
,
".tar.bz2"
,
kb
)
else
:
print
NO_FILE_TEMPLATE
print
get_file_cell
(
prefix
,
".zip"
,
have_zip
)
print
get_file_cell
(
prefix
,
".tgz"
,
have_tgz
)
print
get_file_cell
(
prefix
,
".tar.bz2"
,
have_bz2
)
print
" </tr>"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment