Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
da1dcf42
Commit
da1dcf42
authored
Mar 11, 2017
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract variables to remove hanging indents.
parent
09c78aed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
setuptools/command/upload_docs.py
setuptools/command/upload_docs.py
+10
-11
No files found.
setuptools/command/upload_docs.py
View file @
da1dcf42
...
...
@@ -77,9 +77,8 @@ class upload_docs(upload):
self
.
mkpath
(
self
.
target_dir
)
# just in case
for
root
,
dirs
,
files
in
os
.
walk
(
self
.
target_dir
):
if
root
==
self
.
target_dir
and
not
files
:
raise
DistutilsOptionError
(
"no files found in upload directory '%s'"
%
self
.
target_dir
)
tmpl
=
"no files found in upload directory '%s'"
raise
DistutilsOptionError
(
tmpl
%
self
.
target_dir
)
for
name
in
files
:
full
=
os
.
path
.
join
(
root
,
name
)
relative
=
root
[
len
(
self
.
target_dir
):].
lstrip
(
os
.
path
.
sep
)
...
...
@@ -159,8 +158,8 @@ class upload_docs(upload):
body
,
ct
=
self
.
_build_multipart
(
data
)
self
.
announce
(
"Submitting documentation to %s"
%
(
self
.
repository
),
log
.
INFO
)
msg
=
"Submitting documentation to %s"
%
(
self
.
repository
)
self
.
announce
(
msg
,
log
.
INFO
)
# build the Request
# We can't use urllib2 since we need to send the Basic
...
...
@@ -191,16 +190,16 @@ class upload_docs(upload):
r
=
conn
.
getresponse
()
if
r
.
status
==
200
:
self
.
announce
(
'Server response (%s): %s'
%
(
r
.
status
,
r
.
reason
),
log
.
INFO
)
msg
=
'Server response (%s): %s'
%
(
r
.
status
,
r
.
reason
)
self
.
announce
(
msg
,
log
.
INFO
)
elif
r
.
status
==
301
:
location
=
r
.
getheader
(
'Location'
)
if
location
is
None
:
location
=
'https://pythonhosted.org/%s/'
%
meta
.
get_name
()
self
.
announce
(
'Upload successful. Visit %s'
%
location
,
log
.
INFO
)
msg
=
'Upload successful. Visit %s'
%
location
self
.
announce
(
msg
,
log
.
INFO
)
else
:
self
.
announce
(
'Upload failed (%s): %s'
%
(
r
.
status
,
r
.
reason
),
log
.
ERROR
)
msg
=
'Upload failed (%s): %s'
%
(
r
.
status
,
r
.
reason
)
self
.
announce
(
msg
,
log
.
ERROR
)
if
self
.
show_response
:
print
(
'-'
*
75
,
r
.
read
(),
'-'
*
75
)
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