Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
bf97c9d8
Kaydet (Commit)
bf97c9d8
authored
Şub 09, 2001
tarafından
Eric S. Raymond
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
String method conversion.
üst
8d87603e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
SimpleHTTPServer.py
Lib/SimpleHTTPServer.py
+2
-3
ihooks.py
Lib/ihooks.py
+4
-5
No files found.
Lib/SimpleHTTPServer.py
Dosyayı görüntüle @
bf97c9d8
...
@@ -11,7 +11,6 @@ __version__ = "0.6"
...
@@ -11,7 +11,6 @@ __version__ = "0.6"
__all__
=
[
"SimpleHTTPRequestHandler"
]
__all__
=
[
"SimpleHTTPRequestHandler"
]
import
os
import
os
import
string
import
posixpath
import
posixpath
import
BaseHTTPServer
import
BaseHTTPServer
import
urllib
import
urllib
...
@@ -131,7 +130,7 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
...
@@ -131,7 +130,7 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""
"""
path
=
posixpath
.
normpath
(
urllib
.
unquote
(
path
))
path
=
posixpath
.
normpath
(
urllib
.
unquote
(
path
))
words
=
string
.
splitfields
(
path
,
'/'
)
words
=
path
.
splitfields
(
'/'
)
words
=
filter
(
None
,
words
)
words
=
filter
(
None
,
words
)
path
=
os
.
getcwd
()
path
=
os
.
getcwd
()
for
word
in
words
:
for
word
in
words
:
...
@@ -175,7 +174,7 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
...
@@ -175,7 +174,7 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
base
,
ext
=
posixpath
.
splitext
(
path
)
base
,
ext
=
posixpath
.
splitext
(
path
)
if
self
.
extensions_map
.
has_key
(
ext
):
if
self
.
extensions_map
.
has_key
(
ext
):
return
self
.
extensions_map
[
ext
]
return
self
.
extensions_map
[
ext
]
ext
=
string
.
lower
(
ext
)
ext
=
ext
.
lower
(
)
if
self
.
extensions_map
.
has_key
(
ext
):
if
self
.
extensions_map
.
has_key
(
ext
):
return
self
.
extensions_map
[
ext
]
return
self
.
extensions_map
[
ext
]
else
:
else
:
...
...
Lib/ihooks.py
Dosyayı görüntüle @
bf97c9d8
...
@@ -55,7 +55,6 @@ import __builtin__
...
@@ -55,7 +55,6 @@ import __builtin__
import
imp
import
imp
import
os
import
os
import
sys
import
sys
import
string
__all__
=
[
"BasicModuleLoader"
,
"Hooks"
,
"ModuleLoader"
,
"FancyModuleLoader"
,
__all__
=
[
"BasicModuleLoader"
,
"Hooks"
,
"ModuleLoader"
,
"FancyModuleLoader"
,
"BasicModuleImporter"
,
"ModuleImporter"
,
"install"
,
"uninstall"
]
"BasicModuleImporter"
,
"ModuleImporter"
,
"install"
,
"uninstall"
]
...
@@ -412,7 +411,7 @@ class ModuleImporter(BasicModuleImporter):
...
@@ -412,7 +411,7 @@ class ModuleImporter(BasicModuleImporter):
assert
globals
is
parent
.
__dict__
assert
globals
is
parent
.
__dict__
return
parent
return
parent
if
'.'
in
pname
:
if
'.'
in
pname
:
i
=
string
.
rfind
(
pname
,
'.'
)
i
=
pname
.
rfind
(
'.'
)
pname
=
pname
[:
i
]
pname
=
pname
[:
i
]
parent
=
self
.
modules
[
pname
]
parent
=
self
.
modules
[
pname
]
assert
parent
.
__name__
==
pname
assert
parent
.
__name__
==
pname
...
@@ -421,7 +420,7 @@ class ModuleImporter(BasicModuleImporter):
...
@@ -421,7 +420,7 @@ class ModuleImporter(BasicModuleImporter):
def
find_head_package
(
self
,
parent
,
name
):
def
find_head_package
(
self
,
parent
,
name
):
if
'.'
in
name
:
if
'.'
in
name
:
i
=
string
.
find
(
name
,
'.'
)
i
=
name
.
find
(
'.'
)
head
=
name
[:
i
]
head
=
name
[:
i
]
tail
=
name
[
i
+
1
:]
tail
=
name
[
i
+
1
:]
else
:
else
:
...
@@ -443,7 +442,7 @@ class ModuleImporter(BasicModuleImporter):
...
@@ -443,7 +442,7 @@ class ModuleImporter(BasicModuleImporter):
def
load_tail
(
self
,
q
,
tail
):
def
load_tail
(
self
,
q
,
tail
):
m
=
q
m
=
q
while
tail
:
while
tail
:
i
=
string
.
find
(
tail
,
'.'
)
i
=
tail
.
find
(
'.'
)
if
i
<
0
:
i
=
len
(
tail
)
if
i
<
0
:
i
=
len
(
tail
)
head
,
tail
=
tail
[:
i
],
tail
[
i
+
1
:]
head
,
tail
=
tail
[:
i
],
tail
[
i
+
1
:]
mname
=
"
%
s.
%
s"
%
(
m
.
__name__
,
head
)
mname
=
"
%
s.
%
s"
%
(
m
.
__name__
,
head
)
...
@@ -493,7 +492,7 @@ class ModuleImporter(BasicModuleImporter):
...
@@ -493,7 +492,7 @@ class ModuleImporter(BasicModuleImporter):
name
=
module
.
__name__
name
=
module
.
__name__
if
'.'
not
in
name
:
if
'.'
not
in
name
:
return
self
.
import_it
(
name
,
name
,
None
,
force_load
=
1
)
return
self
.
import_it
(
name
,
name
,
None
,
force_load
=
1
)
i
=
string
.
rfind
(
name
,
'.'
)
i
=
name
.
rfind
(
'.'
)
pname
=
name
[:
i
]
pname
=
name
[:
i
]
parent
=
self
.
modules
[
pname
]
parent
=
self
.
modules
[
pname
]
return
self
.
import_it
(
name
[
i
+
1
:],
name
,
parent
,
force_load
=
1
)
return
self
.
import_it
(
name
[
i
+
1
:],
name
,
parent
,
force_load
=
1
)
...
...
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