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
3e0d3191
Commit
3e0d3191
authored
Jan 25, 1999
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The usual.
parent
dfd8954e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
143 additions
and
4 deletions
+143
-4
Lib/dos-8x3/exceptio.py
Lib/dos-8x3/exceptio.py
+29
-3
Lib/dos-8x3/formatte.py
Lib/dos-8x3/formatte.py
+1
-1
Lib/dos-8x3/telnetli.py
Lib/dos-8x3/telnetli.py
+26
-0
Lib/dos-8x3/test_rfc.py
Lib/dos-8x3/test_rfc.py
+82
-0
Lib/dos-8x3/userlist.py
Lib/dos-8x3/userlist.py
+1
-0
Misc/ACKS
Misc/ACKS
+4
-0
No files found.
Lib/dos-8x3/exceptio.py
View file @
3e0d3191
...
...
@@ -60,6 +60,7 @@ Exception(*)
"""
class
Exception
:
"""Proposed base class for all exceptions."""
def
__init__
(
self
,
*
args
):
self
.
args
=
args
...
...
@@ -75,9 +76,11 @@ class Exception:
return
self
.
args
[
i
]
class
StandardError
(
Exception
):
"""Base class for all standard Python exceptions."""
pass
class
SyntaxError
(
StandardError
):
"""Invalid syntax."""
filename
=
lineno
=
offset
=
text
=
None
msg
=
""
def
__init__
(
self
,
*
args
):
...
...
@@ -94,8 +97,7 @@ class SyntaxError(StandardError):
return
str
(
self
.
msg
)
class
EnvironmentError
(
StandardError
):
"""Base class for exceptions that occur outside the Python system.
Primarily used as a base class for OSError and IOError."""
"""Base class for I/O related errors."""
def
__init__
(
self
,
*
args
):
self
.
args
=
args
self
.
errno
=
None
...
...
@@ -126,70 +128,94 @@ class EnvironmentError(StandardError):
return
StandardError
.
__str__
(
self
)
class
IOError
(
EnvironmentError
):
"""I/O operation failed."""
pass
class
OSError
(
EnvironmentError
):
"""
Used by the posix module
."""
"""
OS system call failed
."""
pass
class
RuntimeError
(
StandardError
):
"""Unspecified run-time error."""
pass
class
NotImplementedError
(
RuntimeError
):
"""Method or function hasn't been implemented yet."""
pass
class
SystemError
(
StandardError
):
"""Internal error in the Python interpreter.
Please report this to the Python maintainer, along with the traceback,
the Python version, and the hardware/OS platform and version."""
pass
class
EOFError
(
StandardError
):
"""Read beyond end of file."""
pass
class
ImportError
(
StandardError
):
"""Import can't find module, or can't find name in module."""
pass
class
TypeError
(
StandardError
):
"""Inappropriate argument type."""
pass
class
ValueError
(
StandardError
):
"""Inappropriate argument value (of correct type)."""
pass
class
KeyboardInterrupt
(
StandardError
):
"""Program interrupted by user."""
pass
class
AssertionError
(
StandardError
):
"""Assertion failed."""
pass
class
ArithmeticError
(
StandardError
):
"""Base class for arithmetic errors."""
pass
class
OverflowError
(
ArithmeticError
):
"""Result too large to be represented."""
pass
class
FloatingPointError
(
ArithmeticError
):
"""Floating point operation failed."""
pass
class
ZeroDivisionError
(
ArithmeticError
):
"""Second argument to a division or modulo operation was zero."""
pass
class
LookupError
(
StandardError
):
"""Base class for lookup errors."""
pass
class
IndexError
(
LookupError
):
"""Sequence index out of range."""
pass
class
KeyError
(
LookupError
):
"""Mapping key not found."""
pass
class
AttributeError
(
StandardError
):
"""Attribute not found."""
pass
class
NameError
(
StandardError
):
"""Name not found locally or globally."""
pass
class
MemoryError
(
StandardError
):
"""Out of memory."""
pass
class
SystemExit
(
Exception
):
"""Request to exit from the interpreter."""
def
__init__
(
self
,
*
args
):
self
.
args
=
args
if
len
(
args
)
==
0
:
...
...
Lib/dos-8x3/formatte.py
View file @
3e0d3191
...
...
@@ -331,7 +331,7 @@ class DumbWriter(NullWriter):
self
.
atbreak
=
0
def
send_paragraph
(
self
,
blankline
):
self
.
file
.
write
(
'
\
n
'
+
'
\
n
'
*
blankline
)
self
.
file
.
write
(
'
\
n
'
*
blankline
)
self
.
col
=
0
self
.
atbreak
=
0
...
...
Lib/dos-8x3/telnetli.py
View file @
3e0d3191
...
...
@@ -376,6 +376,9 @@ class Telnet:
def
interact
(
self
):
"""Interaction function, emulates a very dumb telnet client."""
if
sys
.
platform
==
"win32"
:
self
.
mt_interact
()
return
while
1
:
rfd
,
wfd
,
xfd
=
select
.
select
([
self
,
sys
.
stdin
],
[],
[])
if
self
in
rfd
:
...
...
@@ -393,6 +396,29 @@ class Telnet:
break
self
.
write
(
line
)
def
mt_interact
(
self
):
"""Multithreaded version of interact()."""
import
thread
thread
.
start_new_thread
(
self
.
listener
,
())
while
1
:
line
=
sys
.
stdin
.
readline
()
if
not
line
:
break
self
.
write
(
line
)
def
listener
(
self
):
"""Helper for mt_interact() -- this executes in the other thread."""
while
1
:
try
:
data
=
self
.
read_eager
()
except
EOFError
:
print
'*** Connection closed by remote host ***'
return
if
data
:
sys
.
stdout
.
write
(
data
)
else
:
sys
.
stdout
.
flush
()
def
expect
(
self
,
list
,
timeout
=
None
):
"""Read until one from a list of a regular expressions matches.
...
...
Lib/dos-8x3/test_rfc.py
0 → 100644
View file @
3e0d3191
from
test_support
import
verbose
import
rfc822
,
sys
try
:
from
cStringIO
import
StringIO
except
ImportError
:
from
StringIO
import
StringIO
def
test
(
msg
,
results
):
fp
=
StringIO
()
fp
.
write
(
msg
)
fp
.
seek
(
0
)
m
=
rfc822
.
Message
(
fp
)
i
=
0
for
n
,
a
in
m
.
getaddrlist
(
'to'
)
+
m
.
getaddrlist
(
'cc'
):
if
verbose
:
print
'name:'
,
repr
(
n
),
'addr:'
,
repr
(
a
)
try
:
mn
,
ma
=
results
[
i
][
0
],
results
[
i
][
1
]
except
IndexError
:
print
'extra parsed address:'
,
repr
(
n
),
repr
(
a
)
continue
i
=
i
+
1
if
mn
==
n
and
ma
==
a
:
if
verbose
:
print
' [matched]'
else
:
if
verbose
:
print
' [no match]'
print
'not found:'
,
repr
(
n
),
repr
(
a
)
test
(
'''Date: Wed, 13 Jan 1999 23:57:35 -0500
From: Guido van Rossum <guido@CNRI.Reston.VA.US>
To: "Guido van
: Rossum" <guido@python.org>
Subject: test2
test2
'''
,
[(
'Guido van
\
n
: Rossum'
,
'guido@python.org'
)])
test
(
'''From: Barry <bwarsaw@python.org
To: guido@python.org (Guido: the Barbarian)
Subject: nonsense
test'''
,
[(
'Guido: the Barbarian'
,
'guido@python.org'
),
])
test
(
'''From: Barry <bwarsaw@python.org
To: guido@python.org (Guido: the Barbarian)
Cc: "Guido: the Madman" <guido@python.org>
test'''
,
[(
'Guido: the Barbarian'
,
'guido@python.org'
),
(
'Guido: the Madman'
,
'guido@python.org'
)
])
test
(
'''To: "The monster with
the very long name: Guido" <guido@python.org>
test'''
,
[(
'The monster with
\
n
the very long name: Guido'
,
'guido@python.org'
)])
test
(
'''To: "Amit J. Patel" <amitp@Theory.Stanford.EDU>
CC: Mike Fletcher <mfletch@vrtelecom.com>,
"'string-sig@python.org'" <string-sig@python.org>
Cc: fooz@bat.com, bart@toof.com
Cc: goit@lip.com
test'''
,
[(
'Amit J. Patel'
,
'amitp@Theory.Stanford.EDU'
),
(
'Mike Fletcher'
,
'mfletch@vrtelecom.com'
),
(
"'string-sig@python.org'"
,
'string-sig@python.org'
),
(
''
,
'fooz@bat.com'
),
(
''
,
'bart@toof.com'
),
(
''
,
'goit@lip.com'
),
])
# This one is just twisted. I don't know what the proper result should be,
# but it shouldn't be to infloop, which is what used to happen!
test
(
'''To: <[smtp:dd47@mail.xxx.edu]_at_hmhq@hdq-mdm1-imgout.companay.com>
test'''
,
[(
''
,
''
),
(
''
,
'dd47@mail.xxx.edu'
),
(
''
,
'_at_hmhq@hdq-mdm1-imgout.companay.com'
)
])
Lib/dos-8x3/userlist.py
View file @
3e0d3191
...
...
@@ -49,3 +49,4 @@ class UserList:
def
index
(
self
,
item
):
return
self
.
data
.
index
(
item
)
def
reverse
(
self
):
self
.
data
.
reverse
()
def
sort
(
self
,
*
args
):
apply
(
self
.
data
.
sort
,
args
)
def
extend
(
self
,
list
):
self
.
data
.
extend
(
list
)
Misc/ACKS
View file @
3e0d3191
...
...
@@ -54,6 +54,7 @@ Tom Christiansen
Vadim Chugunov
Steve Clift
Matt Conway
Greg Couch
Steve Cousins
Drew Csillag
Tom Culliton
...
...
@@ -82,6 +83,7 @@ Niels Ferguson
Sebastian Fernandez
Nils Fischbeck
Robin Friedrich
Ivan Frohe
Jim Fulton
Peter Funk
Lele Gaifax
...
...
@@ -224,6 +226,7 @@ Dirk Soede
Per Spilling
Greg Stein
Dan Stromberg
Nathan Sullivan
Neale Pickett
Dan Pierson
RajGopal Srinivasan
...
...
@@ -257,6 +260,7 @@ Gerry Wiener
Sue Williams
Frank Willison
Dik Winter
Blake Winton
Lars Wirzenius
Stefan Witzel
Richard Wolff
...
...
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