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
130d9fa5
Commit
130d9fa5
authored
Jun 15, 2009
by
Tarek Ziadé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code cleanup
parent
f7d0cca6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
13 deletions
+9
-13
command/upload.py
command/upload.py
+9
-13
No files found.
command/upload.py
View file @
130d9fa5
"""distutils.command.upload
Implements the Distutils 'upload' subcommand (upload package to PyPI)."""
from
distutils.errors
import
*
from
distutils.core
import
PyPIRCCommand
from
distutils.spawn
import
spawn
from
distutils
import
log
import
sys
import
os
import
socket
...
...
@@ -15,12 +10,12 @@ import base64
import
urlparse
import
cStringIO
as
StringIO
from
ConfigParser
import
ConfigParser
from
hashlib
import
md5
# this keeps compatibility for 2.3 and 2.4
if
sys
.
version
<
"2.5"
:
from
md5
import
md5
else
:
from
hashlib
import
md5
from
distutils.errors
import
*
from
distutils.core
import
PyPIRCCommand
from
distutils.spawn
import
spawn
from
distutils
import
log
class
upload
(
PyPIRCCommand
):
...
...
@@ -125,7 +120,8 @@ class upload(PyPIRCCommand):
open
(
filename
+
".asc"
).
read
())
# set up the authentication
auth
=
"Basic "
+
base64
.
encodestring
(
self
.
username
+
":"
+
self
.
password
).
strip
()
auth
=
"Basic "
+
base64
.
encodestring
(
self
.
username
+
":"
+
self
.
password
).
strip
()
# Build up the MIME payload for the POST data
boundary
=
'--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'
...
...
@@ -134,10 +130,10 @@ class upload(PyPIRCCommand):
body
=
StringIO
.
StringIO
()
for
key
,
value
in
data
.
items
():
# handle multiple entries for the same name
if
type
(
value
)
!=
type
([]
):
if
not
isinstance
(
value
,
list
):
value
=
[
value
]
for
value
in
value
:
if
type
(
value
)
is
tuple
:
if
isinstance
(
value
,
tuple
)
:
fn
=
';filename="%s"'
%
value
[
0
]
value
=
value
[
1
]
else
:
...
...
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