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
bec818a1
Kaydet (Commit)
bec818a1
authored
Nis 26, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
first remote commit test!!!
üst
5f07b847
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
5 deletions
+28
-5
cmptree.py
Demo/pdist/cmptree.py
+27
-4
server.py
Demo/pdist/server.py
+1
-1
No files found.
Demo/pdist/cmptree.py
Dosyayı görüntüle @
bec818a1
...
@@ -35,7 +35,7 @@ d - delete disappearing files, either remote or local
...
@@ -35,7 +35,7 @@ d - delete disappearing files, either remote or local
t2
=
time
.
time
()
t2
=
time
.
time
()
dt
=
t2
-
t1
dt
=
t2
-
t1
mins
,
secs
=
divmod
(
dt
,
60
)
mins
,
secs
=
divmod
(
dt
,
60
)
print
mins
,
"minutes and"
,
secs
,
"seconds"
print
mins
,
"minutes and"
,
round
(
secs
)
,
"seconds"
raw_input
(
"[Return to exit] "
)
raw_input
(
"[Return to exit] "
)
def
ask
(
prompt
,
default
):
def
ask
(
prompt
,
default
):
...
@@ -103,6 +103,18 @@ def compare(local, remote, mode):
...
@@ -103,6 +103,18 @@ def compare(local, remote, mode):
common
.
append
(
name
)
common
.
append
(
name
)
else
:
else
:
print
"Remote subdirectory"
,
repr
(
name
),
"not found locally"
print
"Remote subdirectory"
,
repr
(
name
),
"not found locally"
if
'r'
in
mode
and
'c'
in
mode
:
pr
=
"Create local subdirectory
%
s? [y] "
%
\
repr
(
name
)
if
'y'
in
mode
:
ok
=
'y'
else
:
ok
=
ask
(
pr
,
"y"
)
if
ok
[:
1
]
in
(
'y'
,
'Y'
):
local
.
mkdir
(
name
)
print
"Subdirectory
%
s made"
%
\
repr
(
name
)
common
.
append
(
name
)
lsubdirs
=
local
.
listsubdirs
()
lsubdirs
=
local
.
listsubdirs
()
for
name
in
lsubdirs
:
for
name
in
lsubdirs
:
if
name
not
in
subdirs
:
if
name
not
in
subdirs
:
...
@@ -135,12 +147,23 @@ def sendfile(local, remote, name):
...
@@ -135,12 +147,23 @@ def sendfile(local, remote, name):
t2
=
time
.
time
()
t2
=
time
.
time
()
dt
=
t2
-
t1
dt
=
t2
-
t1
print
len
(
data
),
"bytes in"
,
t2
-
t1
,
"seconds"
,
print
len
(
data
),
"bytes in"
,
round
(
dt
)
,
"seconds"
,
if
dt
:
if
dt
:
print
"i.e."
,
len
(
data
)
/
dt
,
"bytes/sec"
,
print
"i.e."
,
round
(
len
(
data
)
/
dt
)
,
"bytes/sec"
,
print
print
def
recvfile
(
local
,
remote
,
name
):
def
recvfile
(
local
,
remote
,
name
):
ok
=
0
try
:
rv
=
recvfile_real
(
local
,
remote
,
name
)
ok
=
1
return
rv
finally
:
if
not
ok
:
print
"*** recvfile of
%
s failed, deleting"
%
`name`
local
.
delete
(
name
)
def
recvfile_real
(
local
,
remote
,
name
):
try
:
try
:
local
.
create
(
name
)
local
.
create
(
name
)
except
(
IOError
,
os
.
error
),
msg
:
except
(
IOError
,
os
.
error
),
msg
:
...
@@ -172,7 +195,7 @@ def recvfile(local, remote, name):
...
@@ -172,7 +195,7 @@ def recvfile(local, remote, name):
f
.
close
()
f
.
close
()
dt
=
t2
-
t1
dt
=
t2
-
t1
print
size
,
"bytes in"
,
dt
,
"seconds"
,
print
size
,
"bytes in"
,
round
(
dt
)
,
"seconds"
,
if
dt
:
if
dt
:
print
"i.e."
,
int
(
size
/
dt
),
"bytes/sec"
,
print
"i.e."
,
int
(
size
/
dt
),
"bytes/sec"
,
print
print
...
...
Demo/pdist/server.py
Dosyayı görüntüle @
bec818a1
...
@@ -58,7 +58,7 @@ class Server:
...
@@ -58,7 +58,7 @@ class Server:
if
self
.
_verbose
>
1
:
print
"Wait for next request ..."
if
self
.
_verbose
>
1
:
print
"Wait for next request ..."
ok
=
self
.
_dorequest
(
rf
,
wf
)
ok
=
self
.
_dorequest
(
rf
,
wf
)
_valid
=
[
'192.16.201.*'
,
'192.16.197.*'
]
_valid
=
[
'192.16.201.*'
,
'192.16.197.*'
,
'132.151.1.*'
]
def
_verify
(
self
,
conn
,
address
):
def
_verify
(
self
,
conn
,
address
):
host
,
port
=
address
host
,
port
=
address
...
...
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