IOChannel#

class IOChannel(*args, **kwargs)#
Constructors:

IOChannel()
new_file(filename:str, mode:str) -> GLib.IOChannel
unix_new(fd:int) -> GLib.IOChannel

Constructors#

class IOChannel
classmethod new_file(filename: str, mode: str) → IOChannel#
Parameters:
  • filename

  • mode

classmethod unix_new(fd: int) → IOChannel#
Parameters:

fd

Methods#

class IOChannel
add_watch(condition: IOCondition, callback: Callable[..., bool | None], *user_data: Any, priority: int = 0) → int#
Parameters:
  • condition

  • callback

  • user_data

  • priority

close() → None#
classmethod error_from_errno(en: int) → IOChannelError#
Parameters:

en

classmethod error_quark() → int#
flush() → IOStatus#
get_buffer_condition() → IOCondition#
get_buffer_size() → int#
get_buffered() → bool#
get_encoding() → str#
get_flags() → IOFlags#
get_line_term() → tuple[str, int]#
init() → None#
read(max_count: int = -1) → bytes#

Reads data from a IOChannel.

Parameters:

max_count

read_chars(max_count: int = -1) → bytes#

Alias for GLib.IOChannel.read().

Parameters:

max_count

read_line() → tuple[IOStatus, str, int, int]#
read_line_string(buffer: String, terminator_pos: int | None = None) → IOStatus#
Parameters:
  • buffer

  • terminator_pos

read_to_end() → tuple[IOStatus, list[int]]#
read_unichar() → tuple[IOStatus, str]#
readline(size_hint: int = -1) → str#
Parameters:

size_hint

readlines(size_hint: int = -1) → list[str]#
Parameters:

size_hint

seek(offset: int, whence: int = 0) → IOStatus#
Parameters:
  • offset

  • whence

seek_position(offset: int, type: SeekType) → IOStatus#
Parameters:
  • offset

  • type

set_buffer_size(size: int) → None#
Parameters:

size

set_buffered(buffered: bool) → None#
Parameters:

buffered

set_encoding(encoding: str | None = None) → IOStatus#
Parameters:

encoding

set_flags(flags: IOFlags) → IOStatus#
Parameters:

flags

set_line_term(line_term: str | None, length: int) → None#
Parameters:
  • line_term

  • length

shutdown(flush: bool) → IOStatus#
Parameters:

flush

unix_get_fd() → int#
write(buf: str | bytes, buflen: int = -1) → int#
Parameters:
  • buf

  • buflen

write_chars(buf: list[int], count: int) → tuple[IOStatus, int]#
Parameters:
  • buf

  • count

write_unichar(thechar: str) → IOStatus#
Parameters:

thechar

writelines(lines: Iterable[str | bytes]) → None#
Parameters:

lines

Fields#

class IOChannel
buf_size#
close_on_unref#
do_encode#
encoded_read_buf#
encoding#
funcs#
is_readable#
is_seekable#
is_writeable#
line_term#
line_term_len#
partial_write_buf#
read_buf#
read_cd#
ref_count#
reserved1#
reserved2#
use_buffer#
write_buf#
write_cd#