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
Łukasz Nowak
slapos.buildout
Commits
87788f7b
Commit
87788f7b
authored
Jun 13, 2013
by
Tres Seaver
Browse files
Options
Browse Files
Download
Plain Diff
Merge 'tseaver-suppress_allow_hosts_noise' branch.
parents
d2beb63d
dd1052d7
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 @
87788f7b
...
@@ -4,6 +4,9 @@ Change History
...
@@ -4,6 +4,9 @@ Change History
2.2.0dev (unreleased)
2.2.0dev (unreleased)
=====================
=====================
- Suppress the useless ``Link to <URL> ***BLOCKED*** by --allow-hosts``
error message being emitted by distribute / setuptools.
- Extend distutils script generation to support module docstrings and
- Extend distutils script generation to support module docstrings and
__future__ imports.
__future__ imports.
...
...
src/zc/buildout/easy_install.py
View file @
87788f7b
...
@@ -82,6 +82,25 @@ buildout_and_setuptools_path = [
...
@@ -82,6 +82,25 @@ buildout_and_setuptools_path = [
FILE_SCHEME
=
re
.
compile
(
'file://'
,
re
.
I
).
match
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
):
class
AllowHostsPackageIndex
(
setuptools
.
package_index
.
PackageIndex
):
"""Will allow urls that are local to the system.
"""Will allow urls that are local to the system.
...
@@ -91,7 +110,12 @@ class AllowHostsPackageIndex(setuptools.package_index.PackageIndex):
...
@@ -91,7 +110,12 @@ class AllowHostsPackageIndex(setuptools.package_index.PackageIndex):
def
url_ok
(
self
,
url
,
fatal
=
False
):
def
url_ok
(
self
,
url
,
fatal
=
False
):
if
FILE_SCHEME
(
url
):
if
FILE_SCHEME
(
url
):
return
True
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
=
{}
_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