This commit is contained in:
Dante
2026-05-21 23:40:20 -07:00
parent 3e2915dff7
commit 877a69d844
5737 changed files with 29796 additions and 1589684 deletions

View File

@ -57,6 +57,12 @@ extern class Os {
static function putenv(name:String, value:String):Void;
/** Removes the value for the environment variable `name`.
When targeting python versions prior to 3.9, this function may not exist on some platforms.
**/
static function unsetenv(name:String):Void;
static function chdir(path:String):Void;
static function unlink(path:String):Void;

View File

@ -30,6 +30,14 @@ extern class StartupInfo {
var wShowWindow:Int;
}
extern class CompletedProcess {
var args:EitherType<String, Array<String>>;
var returncode:Int;
var stdout:Null<EitherType<Bytes,String>>;
var stderr:Null<EitherType<Bytes,String>>;
function check_returncode():Void;
}
@:pythonImport("subprocess")
extern class Subprocess {
static function STARTUPINFO():StartupInfo;
@ -49,4 +57,5 @@ extern class Subprocess {
static var STDOUT:Int;
static function call(args:EitherType<String, Array<String>>, ?kwArgs:python.KwArgs<Dynamic>):Int;
static function run(args:EitherType<String, Array<String>>, ?kwArgs:python.KwArgs<Dynamic>):CompletedProcess;
}

View File

@ -80,6 +80,11 @@ extern class Socket {
**/
function getsockname():python.lib.socket.Address;
/**
Return the timeout for the socket or null if no timeout has been set.
**/
function gettimeout():Null<Float>;
/**
Gives a timeout after which blocking socket operations (such as reading and writing) will abort and throw an exception.
**/
@ -90,14 +95,26 @@ extern class Socket {
**/
function waitForRead():Void;
/**
Return the current blocking mode of the socket.
**/
@:require(python_version >= 3.7)
function getblocking():Bool;
/**
Change the blocking mode of the socket. A blocking socket is the default behavior. A non-blocking socket will abort blocking operations immediately by throwing a haxe.io.Error.Blocked value.
**/
function setblocking(b:Bool):Void;
/**
Return the current value of the sockopt as an Int or a Bytes buffer (if buflen is specified).
**/
function getsockopt(family:Int, option:Int):Int;
/**
Change the value of the given socket option.
**/
@:overload(function(family:Int, option:Int, value:Int):Void {})
function setsockopt(family:Int, option:Int, value:Bool):Void;
function fileno():Int;

View File

@ -0,0 +1,12 @@
package python.lib.threading;
@:pythonImport("threading", "Condition")
extern class Condition {
function new(?lock:haxe.extern.EitherType<Lock, RLock>):Void;
function acquire(?blocking:Bool, ?timeout:Float):Bool;
function release():Void;
function wait(?timeout:Float):Bool;
function wait_for(predicate:()->Bool, ?timeout:Float):Bool;
function notify(n:Int = 1):Void;
function notify_all():Void;
}

View File

@ -0,0 +1,9 @@
package python.lib.threading;
@:noDoc
@:pythonImport("threading", "Semaphore")
extern class Semaphore {
function new(value:Int);
function acquire(blocking:Bool = true, ?timeout:Float):Bool;
function release(n:Int = 1):Void;
}