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
94f19788
Commit
94f19788
authored
Nov 20, 2008
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #4354: Fix distutils register command.
parent
f5f5810b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
13 deletions
+8
-13
command/register.py
command/register.py
+8
-13
No files found.
command/register.py
View file @
94f19788
...
...
@@ -15,11 +15,6 @@ from distutils.core import PyPIRCCommand
from
distutils.errors
import
*
from
distutils
import
log
def
raw_input
(
prompt
):
sys
.
stdout
.
write
(
prompt
)
sys
.
stdout
.
flush
()
return
sys
.
stdin
.
readline
()
class
register
(
PyPIRCCommand
):
description
=
(
"register the distribution with the Python package index"
)
...
...
@@ -154,7 +149,7 @@ class register(PyPIRCCommand):
3. have the server generate a new password for you (and email it to you), or
4. quit
Your selection [default 1]: '''
,
end
=
' '
)
choice
=
raw_
input
()
choice
=
input
()
if
not
choice
:
choice
=
'1'
elif
choice
not
in
choices
:
...
...
@@ -163,7 +158,7 @@ Your selection [default 1]: ''', end=' ')
if
choice
==
'1'
:
# get the username and password
while
not
username
:
username
=
raw_
input
(
'Username: '
)
username
=
input
(
'Username: '
)
while
not
password
:
password
=
getpass
.
getpass
(
'Password: '
)
...
...
@@ -182,7 +177,7 @@ Your selection [default 1]: ''', end=' ')
print
(
'(the login will be stored in %s)'
%
self
.
_get_rc_file
())
choice
=
'X'
while
choice
.
lower
()
not
in
'yn'
:
choice
=
raw_
input
(
'Save your login (y/N)?'
)
choice
=
input
(
'Save your login (y/N)?'
)
if
not
choice
:
choice
=
'n'
if
choice
.
lower
()
==
'y'
:
...
...
@@ -193,7 +188,7 @@ Your selection [default 1]: ''', end=' ')
data
[
'name'
]
=
data
[
'password'
]
=
data
[
'email'
]
=
''
data
[
'confirm'
]
=
None
while
not
data
[
'name'
]:
data
[
'name'
]
=
raw_
input
(
'Username: '
)
data
[
'name'
]
=
input
(
'Username: '
)
while
data
[
'password'
]
!=
data
[
'confirm'
]:
while
not
data
[
'password'
]:
data
[
'password'
]
=
getpass
.
getpass
(
'Password: '
)
...
...
@@ -204,7 +199,7 @@ Your selection [default 1]: ''', end=' ')
data
[
'confirm'
]
=
None
print
(
"Password and confirm don't match!"
)
while
not
data
[
'email'
]:
data
[
'email'
]
=
raw_
input
(
' EMail: '
)
data
[
'email'
]
=
input
(
' EMail: '
)
code
,
result
=
self
.
post_to_server
(
data
)
if
code
!=
200
:
print
(
'Server response (%s): %s'
%
(
code
,
result
))
...
...
@@ -215,7 +210,7 @@ Your selection [default 1]: ''', end=' ')
data
=
{
':action'
:
'password_reset'
}
data
[
'email'
]
=
''
while
not
data
[
'email'
]:
data
[
'email'
]
=
raw_
input
(
'Your email address: '
)
data
[
'email'
]
=
input
(
'Your email address: '
)
code
,
result
=
self
.
post_to_server
(
data
)
print
(
'Server response (%s): %s'
%
(
code
,
result
))
...
...
@@ -262,7 +257,7 @@ Your selection [default 1]: ''', end=' ')
if
type
(
value
)
not
in
(
type
([]),
type
(
()
)):
value
=
[
value
]
for
value
in
value
:
value
=
str
(
value
)
.
encode
(
"utf-8"
)
value
=
str
(
value
)
body
.
write
(
sep_boundary
)
body
.
write
(
'
\
n
Content-Disposition: form-data; name="%s"'
%
key
)
body
.
write
(
"
\
n
\
n
"
)
...
...
@@ -271,7 +266,7 @@ Your selection [default 1]: ''', end=' ')
body
.
write
(
'
\
n
'
)
# write an extra newline (lurve Macs)
body
.
write
(
end_boundary
)
body
.
write
(
"
\
n
"
)
body
=
body
.
getvalue
()
body
=
body
.
getvalue
()
.
encode
(
"utf-8"
)
# build the Request
headers
=
{
...
...
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