Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
f3318757
Commit
f3318757
authored
May 24, 2009
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a little still stupid helper script to check PyPi for any new releases
parent
57f00e7a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
inst/checknew.py
inst/checknew.py
+53
-0
No files found.
inst/checknew.py
0 → 100644
View file @
f3318757
import
sys
def
main
():
import
pkg_resources
from
pkg_resources
import
parse_requirements
from
setuptools.package_index
import
PackageIndex
ws
=
pkg_resources
.
require
(
'Zope2'
)
pi
=
PackageIndex
()
names
=
[]
installed
=
[]
for
dist
in
ws
:
name
=
dist
.
project_name
if
name
not
in
names
:
names
.
append
(
name
)
installed
.
append
(
dict
(
dist
=
dist
,
name
=
name
,
req
=
parse_requirements
(
name
).
next
(),
))
def
_key
(
value
):
return
value
[
'name'
]
installed
.
sort
(
key
=
_key
)
upgrade
=
False
for
info
in
installed
:
print
(
"Checking for new version of %s."
%
info
[
'name'
])
new_dist
=
pi
.
obtain
(
info
[
'req'
])
if
new_dist
.
parsed_version
>
info
[
'dist'
].
parsed_version
:
upgrade
=
True
print
()
print
(
"Newer version for %s found. Installed: %s - found: %s"
%
(
info
[
'name'
],
info
[
'dist'
].
version
,
new_dist
.
version
))
print
(
"Newer version available at: %s"
%
new_dist
.
location
)
print
()
if
not
upgrade
:
print
(
"No updates have been found. All packages use current versions."
)
def
help
():
print
(
"Use this script via ./bin/zopepy inst/checknew.py."
)
if
__name__
==
'__main__'
:
args
=
sys
.
argv
[
1
:]
if
'--help'
in
args
:
help
()
else
:
main
()
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