Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f97b2d7d
Commit
f97b2d7d
authored
Jun 05, 2002
by
Piers Lauder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
open method changed to use arguments and set instance host/port values (instead of __init__)
parent
48165d40
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
Lib/imaplib.py
Lib/imaplib.py
+12
-8
No files found.
Lib/imaplib.py
View file @
f97b2d7d
...
...
@@ -133,8 +133,6 @@ class IMAP4:
mustquote = re.compile(r"[^
\
w!#$%&
'
*+,.:;<=>?^`|~-]")
def __init__(self, host = '', port = IMAP4_PORT):
self.host = host
self.port = port
self.debug = Debug
self.state = '
LOGOUT
'
self.literal = None # A literal argument to a command
...
...
@@ -205,13 +203,16 @@ class IMAP4:
# Overridable methods
def
open
(
self
,
host
,
port
):
"""Setup connection to remote server on "host:port".
def
open
(
self
,
host
=
''
,
port
=
IMAP4_PORT
):
"""Setup connection to remote server on "host:port"
(default: localhost:standard IMAP4 port).
This connection will be used by the routines:
read, readline, send, shutdown.
"""
self
.
host
=
host
self
.
port
=
port
self
.
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
self
.
sock
.
connect
((
self
.
host
,
self
.
port
))
self
.
sock
.
connect
((
host
,
port
))
self
.
file
=
self
.
sock
.
makefile
(
'rb'
)
...
...
@@ -1005,14 +1006,17 @@ class IMAP4_SSL(IMAP4):
IMAP4
.
__init__
(
self
,
host
,
port
)
def
open
(
self
,
host
,
port
):
def
open
(
self
,
host
=
''
,
port
=
IMAP4_SSL_PORT
):
"""Setup connection to remote server on "host:port".
(default: localhost:standard IMAP4 SSL port).
This connection will be used by the routines:
read, readline, send, shutdown.
"""
self
.
host
=
host
self
.
port
=
port
self
.
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
self
.
sock
.
connect
((
self
.
host
,
self
.
port
))
self
.
sslobj
=
socket
.
ssl
(
self
.
sock
,
self
.
keyfile
,
self
.
certfile
)
self
.
sock
.
connect
((
host
,
port
))
self
.
sslobj
=
socket
.
ssl
(
self
.
sock
,
self
.
keyfile
,
self
.
certfile
)
def
read
(
self
,
size
):
...
...
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