From 8a3e17dba1e2b48f104466b7a25dff7c48ff8804 Mon Sep 17 00:00:00 2001 From: hantianfeng Date: Fri, 6 Sep 2024 17:44:38 +0800 Subject: [PATCH] Update php libraries --- lib/python/threading.php | 20 ---- lib/python/threading/Barrier.php | 33 +++++++ lib/python/threading/BoundedSemaphore.php | 25 +++++ lib/python/threading/BrokenBarrierError.php | 15 +++ lib/python/threading/Condition.php | 40 ++++++++ lib/python/threading/Event.php | 40 ++++++++ lib/python/threading/ExceptHookArgs.php | 15 +++ lib/python/threading/Semaphore.php | 25 +++++ lib/python/threading/ThreadError.php | 15 +++ lib/python/threading/Timer.php | 64 +++++++++++++ lib/python/threading/WeakSet.php | 100 ++++++++++++++++++++ lib/python/threading/_CRLock.php | 15 +++ lib/python/threading/_DummyThread.php | 59 ++++++++++++ lib/python/threading/_MainThread.php | 59 ++++++++++++ lib/python/threading/_PyRLock.php | 25 +++++ lib/python/threading/_RLock.php | 25 +++++ lib/python/threading/_count.php | 15 +++ lib/python/threading/_deque.php | 15 +++ lib/python/threading/_islice.php | 15 +++ lib/python/threading/local.php | 15 +++ tools/bootstrap.php | 0 tools/gen-all-lib.php | 0 tools/gen-ext-class.php | 0 tools/gen-php-lib.php | 0 tools/gen-py-mod.php | 0 25 files changed, 615 insertions(+), 20 deletions(-) create mode 100644 lib/python/threading/Barrier.php create mode 100644 lib/python/threading/BoundedSemaphore.php create mode 100644 lib/python/threading/BrokenBarrierError.php create mode 100644 lib/python/threading/Condition.php create mode 100644 lib/python/threading/Event.php create mode 100644 lib/python/threading/ExceptHookArgs.php create mode 100644 lib/python/threading/Semaphore.php create mode 100644 lib/python/threading/ThreadError.php create mode 100644 lib/python/threading/Timer.php create mode 100644 lib/python/threading/WeakSet.php create mode 100644 lib/python/threading/_CRLock.php create mode 100644 lib/python/threading/_DummyThread.php create mode 100644 lib/python/threading/_MainThread.php create mode 100644 lib/python/threading/_PyRLock.php create mode 100644 lib/python/threading/_RLock.php create mode 100644 lib/python/threading/_count.php create mode 100644 lib/python/threading/_deque.php create mode 100644 lib/python/threading/_islice.php create mode 100644 lib/python/threading/local.php mode change 100755 => 100644 tools/bootstrap.php mode change 100644 => 100755 tools/gen-all-lib.php mode change 100644 => 100755 tools/gen-ext-class.php mode change 100644 => 100755 tools/gen-php-lib.php mode change 100644 => 100755 tools/gen-py-mod.php diff --git a/lib/python/threading.php b/lib/python/threading.php index e34437d..e7bcbd2 100644 --- a/lib/python/threading.php +++ b/lib/python/threading.php @@ -20,29 +20,10 @@ public static function import() public $_profile_hook = null; public $_trace_hook = null; - public $Barrier = null; - public $BoundedSemaphore = null; - public $BrokenBarrierError = null; - public $Condition = null; - public $Event = null; - public $ExceptHookArgs = null; - public $Semaphore = null; - public $Thread = null; - public $ThreadError = null; - public $Timer = null; - public $WeakSet = null; - public $_CRLock = null; - public $_DummyThread = null; - public $_MainThread = null; - public $_PyRLock = null; - public $_RLock = null; public $_active = null; public $_active_limbo_lock = null; - public $_count = null; public $_counter = null; public $_dangling = null; - public $_deque = null; - public $_islice = null; public $_limbo = null; public $_main_thread = null; public $_os = null; @@ -51,7 +32,6 @@ public static function import() public $_sys = null; public $_threading_atexits = null; public $functools = null; - public $local = null; public function RLock() { diff --git a/lib/python/threading/Barrier.php b/lib/python/threading/Barrier.php new file mode 100644 index 0000000..4937937 --- /dev/null +++ b/lib/python/threading/Barrier.php @@ -0,0 +1,33 @@ +_self = \PyCore::import('threading')->Barrier($parties, $action, $timeout); + } + + public function abort() + { + return $this->_self->abort(); + } + + public function reset() + { + return $this->_self->reset(); + } + + public function wait($timeout = null) + { + return $this->_self->wait($timeout); + } + +} diff --git a/lib/python/threading/BoundedSemaphore.php b/lib/python/threading/BoundedSemaphore.php new file mode 100644 index 0000000..b71fad8 --- /dev/null +++ b/lib/python/threading/BoundedSemaphore.php @@ -0,0 +1,25 @@ +_self = \PyCore::import('threading')->BoundedSemaphore($value); + } + + public function acquire($blocking = true, $timeout = null) + { + return $this->_self->acquire($blocking, $timeout); + } + + public function release($n = 1) + { + return $this->_self->release($n); + } + +} diff --git a/lib/python/threading/BrokenBarrierError.php b/lib/python/threading/BrokenBarrierError.php new file mode 100644 index 0000000..36c9252 --- /dev/null +++ b/lib/python/threading/BrokenBarrierError.php @@ -0,0 +1,15 @@ +_self = \PyCore::import('threading')->BrokenBarrierError(); + } + +} diff --git a/lib/python/threading/Condition.php b/lib/python/threading/Condition.php new file mode 100644 index 0000000..8a9af2a --- /dev/null +++ b/lib/python/threading/Condition.php @@ -0,0 +1,40 @@ +_self = \PyCore::import('threading')->Condition($lock); + } + + public function notify($n = 1) + { + return $this->_self->notify($n); + } + + public function notifyAll() + { + return $this->_self->notifyAll(); + } + + public function notify_all() + { + return $this->_self->notify_all(); + } + + public function wait($timeout = null) + { + return $this->_self->wait($timeout); + } + + public function wait_for($predicate, $timeout = null) + { + return $this->_self->wait_for($predicate, $timeout); + } + +} diff --git a/lib/python/threading/Event.php b/lib/python/threading/Event.php new file mode 100644 index 0000000..6b0c3b8 --- /dev/null +++ b/lib/python/threading/Event.php @@ -0,0 +1,40 @@ +_self = \PyCore::import('threading')->Event(); + } + + public function clear() + { + return $this->_self->clear(); + } + + public function isSet() + { + return $this->_self->isSet(); + } + + public function is_set() + { + return $this->_self->is_set(); + } + + public function set() + { + return $this->_self->set(); + } + + public function wait($timeout = null) + { + return $this->_self->wait($timeout); + } + +} diff --git a/lib/python/threading/ExceptHookArgs.php b/lib/python/threading/ExceptHookArgs.php new file mode 100644 index 0000000..d948d21 --- /dev/null +++ b/lib/python/threading/ExceptHookArgs.php @@ -0,0 +1,15 @@ +_self = \PyCore::import('threading')->ExceptHookArgs(); + } + +} diff --git a/lib/python/threading/Semaphore.php b/lib/python/threading/Semaphore.php new file mode 100644 index 0000000..cbff3ac --- /dev/null +++ b/lib/python/threading/Semaphore.php @@ -0,0 +1,25 @@ +_self = \PyCore::import('threading')->Semaphore($value); + } + + public function acquire($blocking = true, $timeout = null) + { + return $this->_self->acquire($blocking, $timeout); + } + + public function release($n = 1) + { + return $this->_self->release($n); + } + +} diff --git a/lib/python/threading/ThreadError.php b/lib/python/threading/ThreadError.php new file mode 100644 index 0000000..b0b60f0 --- /dev/null +++ b/lib/python/threading/ThreadError.php @@ -0,0 +1,15 @@ +_self = \PyCore::import('threading')->ThreadError(); + } + +} diff --git a/lib/python/threading/Timer.php b/lib/python/threading/Timer.php new file mode 100644 index 0000000..29bc0e3 --- /dev/null +++ b/lib/python/threading/Timer.php @@ -0,0 +1,64 @@ +_self = \PyCore::import('threading')->Timer($interval, $function, $args, $kwargs); + } + + public function cancel() + { + return $this->_self->cancel(); + } + + public function getName() + { + return $this->_self->getName(); + } + + public function isDaemon() + { + return $this->_self->isDaemon(); + } + + public function is_alive() + { + return $this->_self->is_alive(); + } + + public function join($timeout = null) + { + return $this->_self->join($timeout); + } + + public function run() + { + return $this->_self->run(); + } + + public function setDaemon($daemonic) + { + return $this->_self->setDaemon($daemonic); + } + + public function setName($name) + { + return $this->_self->setName($name); + } + + public function start() + { + return $this->_self->start(); + } + +} diff --git a/lib/python/threading/WeakSet.php b/lib/python/threading/WeakSet.php new file mode 100644 index 0000000..8a41f09 --- /dev/null +++ b/lib/python/threading/WeakSet.php @@ -0,0 +1,100 @@ +_self = \PyCore::import('threading')->WeakSet($data); + } + + public function add($item) + { + return $this->_self->add($item); + } + + public function clear() + { + return $this->_self->clear(); + } + + public function copy() + { + return $this->_self->copy(); + } + + public function difference($other) + { + return $this->_self->difference($other); + } + + public function difference_update($other) + { + return $this->_self->difference_update($other); + } + + public function discard($item) + { + return $this->_self->discard($item); + } + + public function intersection($other) + { + return $this->_self->intersection($other); + } + + public function intersection_update($other) + { + return $this->_self->intersection_update($other); + } + + public function isdisjoint($other) + { + return $this->_self->isdisjoint($other); + } + + public function issubset($other) + { + return $this->_self->issubset($other); + } + + public function issuperset($other) + { + return $this->_self->issuperset($other); + } + + public function pop() + { + return $this->_self->pop(); + } + + public function remove($item) + { + return $this->_self->remove($item); + } + + public function symmetric_difference($other) + { + return $this->_self->symmetric_difference($other); + } + + public function symmetric_difference_update($other) + { + return $this->_self->symmetric_difference_update($other); + } + + public function union($other) + { + return $this->_self->union($other); + } + + public function update($other) + { + return $this->_self->update($other); + } + +} diff --git a/lib/python/threading/_CRLock.php b/lib/python/threading/_CRLock.php new file mode 100644 index 0000000..1e811d3 --- /dev/null +++ b/lib/python/threading/_CRLock.php @@ -0,0 +1,15 @@ +_self = \PyCore::import('threading')->_CRLock(); + } + +} diff --git a/lib/python/threading/_DummyThread.php b/lib/python/threading/_DummyThread.php new file mode 100644 index 0000000..d4b9a30 --- /dev/null +++ b/lib/python/threading/_DummyThread.php @@ -0,0 +1,59 @@ +_self = \PyCore::import('threading')->_DummyThread(); + } + + public function getName() + { + return $this->_self->getName(); + } + + public function isDaemon() + { + return $this->_self->isDaemon(); + } + + public function is_alive() + { + return $this->_self->is_alive(); + } + + public function join($timeout = null) + { + return $this->_self->join($timeout); + } + + public function run() + { + return $this->_self->run(); + } + + public function setDaemon($daemonic) + { + return $this->_self->setDaemon($daemonic); + } + + public function setName($name) + { + return $this->_self->setName($name); + } + + public function start() + { + return $this->_self->start(); + } + +} diff --git a/lib/python/threading/_MainThread.php b/lib/python/threading/_MainThread.php new file mode 100644 index 0000000..c54242a --- /dev/null +++ b/lib/python/threading/_MainThread.php @@ -0,0 +1,59 @@ +_self = \PyCore::import('threading')->_MainThread(); + } + + public function getName() + { + return $this->_self->getName(); + } + + public function isDaemon() + { + return $this->_self->isDaemon(); + } + + public function is_alive() + { + return $this->_self->is_alive(); + } + + public function join($timeout = null) + { + return $this->_self->join($timeout); + } + + public function run() + { + return $this->_self->run(); + } + + public function setDaemon($daemonic) + { + return $this->_self->setDaemon($daemonic); + } + + public function setName($name) + { + return $this->_self->setName($name); + } + + public function start() + { + return $this->_self->start(); + } + +} diff --git a/lib/python/threading/_PyRLock.php b/lib/python/threading/_PyRLock.php new file mode 100644 index 0000000..49b47c6 --- /dev/null +++ b/lib/python/threading/_PyRLock.php @@ -0,0 +1,25 @@ +_self = \PyCore::import('threading')->_PyRLock(); + } + + public function acquire($blocking = true, $timeout = -1) + { + return $this->_self->acquire($blocking, $timeout); + } + + public function release() + { + return $this->_self->release(); + } + +} diff --git a/lib/python/threading/_RLock.php b/lib/python/threading/_RLock.php new file mode 100644 index 0000000..785d308 --- /dev/null +++ b/lib/python/threading/_RLock.php @@ -0,0 +1,25 @@ +_self = \PyCore::import('threading')->_RLock(); + } + + public function acquire($blocking = true, $timeout = -1) + { + return $this->_self->acquire($blocking, $timeout); + } + + public function release() + { + return $this->_self->release(); + } + +} diff --git a/lib/python/threading/_count.php b/lib/python/threading/_count.php new file mode 100644 index 0000000..1fb20d7 --- /dev/null +++ b/lib/python/threading/_count.php @@ -0,0 +1,15 @@ +_self = \PyCore::import('threading')->_count(); + } + +} diff --git a/lib/python/threading/_deque.php b/lib/python/threading/_deque.php new file mode 100644 index 0000000..e97e416 --- /dev/null +++ b/lib/python/threading/_deque.php @@ -0,0 +1,15 @@ +_self = \PyCore::import('threading')->_deque(); + } + +} diff --git a/lib/python/threading/_islice.php b/lib/python/threading/_islice.php new file mode 100644 index 0000000..96149b8 --- /dev/null +++ b/lib/python/threading/_islice.php @@ -0,0 +1,15 @@ +_self = \PyCore::import('threading')->_islice(); + } + +} diff --git a/lib/python/threading/local.php b/lib/python/threading/local.php new file mode 100644 index 0000000..3e30aef --- /dev/null +++ b/lib/python/threading/local.php @@ -0,0 +1,15 @@ +_self = \PyCore::import('threading')->local(); + } + +} diff --git a/tools/bootstrap.php b/tools/bootstrap.php old mode 100755 new mode 100644 diff --git a/tools/gen-all-lib.php b/tools/gen-all-lib.php old mode 100644 new mode 100755 diff --git a/tools/gen-ext-class.php b/tools/gen-ext-class.php old mode 100644 new mode 100755 diff --git a/tools/gen-php-lib.php b/tools/gen-php-lib.php old mode 100644 new mode 100755 diff --git a/tools/gen-py-mod.php b/tools/gen-py-mod.php old mode 100644 new mode 100755