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
c8cf4dfa
Kaydet (Commit)
c8cf4dfa
authored
Kas 22, 2011
tarafından
Giampaolo Rodola'
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
revert cset 6a0da9b65e54 against sched.py committed by accident
üst
9329029e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
8 deletions
+0
-8
sched.py
Lib/sched.py
+0
-8
No files found.
Lib/sched.py
Dosyayı görüntüle @
c8cf4dfa
...
@@ -35,9 +35,6 @@ from collections import namedtuple
...
@@ -35,9 +35,6 @@ from collections import namedtuple
__all__
=
[
"scheduler"
]
__all__
=
[
"scheduler"
]
class
Event
(
namedtuple
(
'Event'
,
'time, priority, action, argument, kwargs'
)):
class
Event
(
namedtuple
(
'Event'
,
'time, priority, action, argument, kwargs'
)):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
Event
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
_scheduled
=
False
def
__eq__
(
s
,
o
):
return
(
s
.
time
,
s
.
priority
)
==
(
o
.
time
,
o
.
priority
)
def
__eq__
(
s
,
o
):
return
(
s
.
time
,
s
.
priority
)
==
(
o
.
time
,
o
.
priority
)
def
__ne__
(
s
,
o
):
return
(
s
.
time
,
s
.
priority
)
!=
(
o
.
time
,
o
.
priority
)
def
__ne__
(
s
,
o
):
return
(
s
.
time
,
s
.
priority
)
!=
(
o
.
time
,
o
.
priority
)
def
__lt__
(
s
,
o
):
return
(
s
.
time
,
s
.
priority
)
<
(
o
.
time
,
o
.
priority
)
def
__lt__
(
s
,
o
):
return
(
s
.
time
,
s
.
priority
)
<
(
o
.
time
,
o
.
priority
)
...
@@ -62,7 +59,6 @@ class scheduler:
...
@@ -62,7 +59,6 @@ class scheduler:
"""
"""
event
=
Event
(
time
,
priority
,
action
,
argument
,
kwargs
)
event
=
Event
(
time
,
priority
,
action
,
argument
,
kwargs
)
event
.
_scheduled
=
True
heapq
.
heappush
(
self
.
_queue
,
event
)
heapq
.
heappush
(
self
.
_queue
,
event
)
return
event
# The ID
return
event
# The ID
...
@@ -85,9 +81,6 @@ class scheduler:
...
@@ -85,9 +81,6 @@ class scheduler:
self
.
_queue
.
remove
(
event
)
self
.
_queue
.
remove
(
event
)
heapq
.
heapify
(
self
.
_queue
)
heapq
.
heapify
(
self
.
_queue
)
def
is_scheduled
(
self
,
event
):
return
event
.
_scheduled
def
empty
(
self
):
def
empty
(
self
):
"""Check whether the queue is empty."""
"""Check whether the queue is empty."""
return
not
self
.
_queue
return
not
self
.
_queue
...
@@ -129,7 +122,6 @@ class scheduler:
...
@@ -129,7 +122,6 @@ class scheduler:
# Verify that the event was not removed or altered
# Verify that the event was not removed or altered
# by another thread after we last looked at q[0].
# by another thread after we last looked at q[0].
if
event
is
checked_event
:
if
event
is
checked_event
:
event
.
_scheduled
=
False
action
(
*
argument
,
**
kwargs
)
action
(
*
argument
,
**
kwargs
)
delayfunc
(
0
)
# Let other threads run
delayfunc
(
0
)
# Let other threads run
else
:
else
:
...
...
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