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
befa2936
Commit
befa2936
authored
Dec 16, 1991
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attempt at speeding up.
parent
a594fabb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
28 deletions
+32
-28
Lib/irix5/flp.py
Lib/irix5/flp.py
+16
-14
Lib/plat-irix5/flp.py
Lib/plat-irix5/flp.py
+16
-14
No files found.
Lib/irix5/flp.py
View file @
befa2936
...
...
@@ -118,10 +118,10 @@ class _newobj():
# Internal parsing routines.
#
def
_parse_string
(
str
):
return
str
ing
.
strip
(
str
)
return
str
def
_parse_num
(
str
):
return
eval
(
str
ing
.
strip
(
str
)
)
return
eval
(
str
)
def
_parse_numlist
(
str
):
slist
=
string
.
split
(
str
)
...
...
@@ -144,16 +144,18 @@ _parse_func = { \
# This function parses a line, and returns either
# a string or a tuple (name,value)
import
regexp
def
_parse_line
(
line
):
try
:
colonpos
=
string
.
index
(
line
,
':'
)
except
string
.
index_error
:
return
string
.
strip
(
line
)
name
=
line
[:
colonpos
]
name
=
string
.
joinfields
(
string
.
split
(
name
),
''
)
name
=
string
.
lower
(
name
)
a
=
regexp
.
match
(
'^([^:]*): *(.*)'
,
line
)
if
not
a
:
return
line
name
=
line
[:
a
[
1
][
1
]]
if
name
[
0
]
=
'N'
:
name
=
string
.
joinfields
(
string
.
split
(
name
),
''
)
name
=
string
.
lower
(
name
)
name
=
string
.
upper
(
name
[
0
])
+
name
[
1
:]
value
=
line
[
colonpos
+
1
:]
value
=
line
[
a
[
2
][
0
]
:]
try
:
pf
=
_parse_func
[
name
]
except
RuntimeError
:
# BCOMPAT
...
...
@@ -165,12 +167,12 @@ def _parse_line(line):
def
_readline
(
file
):
line
=
file
.
readline
()
if
line
<>
''
:
line
=
line
[:
-
1
]
return
line
if
not
line
:
raise
EOFError
return
line
[:
-
1
]
def
_parse_1_line
(
file
):
line
=
''
line
=
_readline
(
file
)
while
line
=
''
:
line
=
_readline
(
file
)
return
_parse_line
(
line
)
...
...
Lib/plat-irix5/flp.py
View file @
befa2936
...
...
@@ -118,10 +118,10 @@ class _newobj():
# Internal parsing routines.
#
def
_parse_string
(
str
):
return
str
ing
.
strip
(
str
)
return
str
def
_parse_num
(
str
):
return
eval
(
str
ing
.
strip
(
str
)
)
return
eval
(
str
)
def
_parse_numlist
(
str
):
slist
=
string
.
split
(
str
)
...
...
@@ -144,16 +144,18 @@ _parse_func = { \
# This function parses a line, and returns either
# a string or a tuple (name,value)
import
regexp
def
_parse_line
(
line
):
try
:
colonpos
=
string
.
index
(
line
,
':'
)
except
string
.
index_error
:
return
string
.
strip
(
line
)
name
=
line
[:
colonpos
]
name
=
string
.
joinfields
(
string
.
split
(
name
),
''
)
name
=
string
.
lower
(
name
)
a
=
regexp
.
match
(
'^([^:]*): *(.*)'
,
line
)
if
not
a
:
return
line
name
=
line
[:
a
[
1
][
1
]]
if
name
[
0
]
=
'N'
:
name
=
string
.
joinfields
(
string
.
split
(
name
),
''
)
name
=
string
.
lower
(
name
)
name
=
string
.
upper
(
name
[
0
])
+
name
[
1
:]
value
=
line
[
colonpos
+
1
:]
value
=
line
[
a
[
2
][
0
]
:]
try
:
pf
=
_parse_func
[
name
]
except
RuntimeError
:
# BCOMPAT
...
...
@@ -165,12 +167,12 @@ def _parse_line(line):
def
_readline
(
file
):
line
=
file
.
readline
()
if
line
<>
''
:
line
=
line
[:
-
1
]
return
line
if
not
line
:
raise
EOFError
return
line
[:
-
1
]
def
_parse_1_line
(
file
):
line
=
''
line
=
_readline
(
file
)
while
line
=
''
:
line
=
_readline
(
file
)
return
_parse_line
(
line
)
...
...
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