Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
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
Jérome Perrin
slapos.buildout
Commits
dd1052d7
Commit
dd1052d7
authored
May 29, 2013
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
distribute / setuptools noise OFF.
parent
11571375
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
CHANGES.rst
CHANGES.rst
+3
-0
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+25
-1
No files found.
CHANGES.rst
View file @
dd1052d7
...
...
@@ -4,6 +4,9 @@ Change History
2.1.1dev (unreleased)
=====================
- Suppress the useless ``Link to <URL> ***BLOCKED*** by --allow-hosts``
error message being emitted by distribute / setuptools.
2.1.0 (2013-03-23)
==================
...
...
src/zc/buildout/easy_install.py
View file @
dd1052d7
...
...
@@ -81,6 +81,25 @@ buildout_and_distribute_path = [
FILE_SCHEME
=
re
.
compile
(
'file://'
,
re
.
I
).
match
class
_Monkey
(
object
):
def
__init__
(
self
,
module
,
**
kw
):
mdict
=
self
.
_mdict
=
module
.
__dict__
self
.
_before
=
mdict
.
copy
()
self
.
_overrides
=
kw
def
__enter__
(
self
):
self
.
_mdict
.
update
(
self
.
_overrides
)
return
self
def
__exit__
(
self
,
exc_type
,
exc_value
,
traceback
):
self
.
_mdict
.
clear
()
self
.
_mdict
.
update
(
self
.
_before
)
class
_NoWarn
(
object
):
def
warn
(
self
,
*
args
,
**
kw
):
pass
_no_warn
=
_NoWarn
()
class
AllowHostsPackageIndex
(
setuptools
.
package_index
.
PackageIndex
):
"""Will allow urls that are local to the system.
...
...
@@ -90,7 +109,12 @@ class AllowHostsPackageIndex(setuptools.package_index.PackageIndex):
def
url_ok
(
self
,
url
,
fatal
=
False
):
if
FILE_SCHEME
(
url
):
return
True
return
setuptools
.
package_index
.
PackageIndex
.
url_ok
(
self
,
url
,
False
)
# distutils has its own logging, which can't be hooked / suppressed,
# so we monkey-patch the 'log' submodule to suppress the stupid
# "Link to <URL> ***BLOCKED*** by --allow-hosts" message.
with
_Monkey
(
setuptools
.
package_index
,
log
=
_no_warn
):
return
setuptools
.
package_index
.
PackageIndex
.
url_ok
(
self
,
url
,
False
)
_indexes
=
{}
...
...
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