Skip to content

Commit

Permalink
Update php libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Sep 6, 2024
1 parent befc6da commit 8a3e17d
Show file tree
Hide file tree
Showing 25 changed files with 615 additions and 20 deletions.
20 changes: 0 additions & 20 deletions lib/python/threading.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -51,7 +32,6 @@ public static function import()
public $_sys = null;
public $_threading_atexits = null;
public $functools = null;
public $local = null;

public function RLock()
{
Expand Down
33 changes: 33 additions & 0 deletions lib/python/threading/Barrier.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
namespace python\threading;

/**
* @property $broken
* @property $n_waiting
* @property $parties
*/
class Barrier
{
private $_self;

public function __construct($parties, $action = null, $timeout = null)
{
$this->_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);
}

}
25 changes: 25 additions & 0 deletions lib/python/threading/BoundedSemaphore.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
namespace python\threading;

/**
*/
class BoundedSemaphore
{
private $_self;

public function __construct($value = 1)
{
$this->_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);
}

}
15 changes: 15 additions & 0 deletions lib/python/threading/BrokenBarrierError.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
namespace python\threading;

/**
*/
class BrokenBarrierError
{
private $_self;

public function __construct()
{
$this->_self = \PyCore::import('threading')->BrokenBarrierError();
}

}
40 changes: 40 additions & 0 deletions lib/python/threading/Condition.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
namespace python\threading;

/**
*/
class Condition
{
private $_self;

public function __construct($lock = null)
{
$this->_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);
}

}
40 changes: 40 additions & 0 deletions lib/python/threading/Event.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
namespace python\threading;

/**
*/
class Event
{
private $_self;

public function __construct()
{
$this->_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);
}

}
15 changes: 15 additions & 0 deletions lib/python/threading/ExceptHookArgs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
namespace python\threading;

/**
*/
class ExceptHookArgs
{
private $_self;

public function __construct()
{
$this->_self = \PyCore::import('threading')->ExceptHookArgs();
}

}
25 changes: 25 additions & 0 deletions lib/python/threading/Semaphore.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
namespace python\threading;

/**
*/
class Semaphore
{
private $_self;

public function __construct($value = 1)
{
$this->_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);
}

}
15 changes: 15 additions & 0 deletions lib/python/threading/ThreadError.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
namespace python\threading;

/**
*/
class ThreadError
{
private $_self;

public function __construct()
{
$this->_self = \PyCore::import('threading')->ThreadError();
}

}
64 changes: 64 additions & 0 deletions lib/python/threading/Timer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php
namespace python\threading;

/**
* @property $daemon
* @property $ident
* @property $name
* @property $native_id
*/
class Timer
{
private $_self;

public function __construct($interval, $function, $args = null, $kwargs = null)
{
$this->_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();
}

}
Loading

0 comments on commit 8a3e17d

Please sign in to comment.