Freeciv-3.2: generate_packets Namespace Reference

Freeciv-3.2

Loading...
Searching...
No Matches
Data Structures | Functions | Variables
generate_packets Namespace Reference

## Data Structures

class | ArrayType
class | BasicType
class | BitvectorType
class | BoolType
class | CmParameterType
class | Directions
class | Field
class | FieldFlags
class | FieldType
class | FloatType
class | IntType
class | Location
class | MemoryType
class | NeedSizeType
class | Packet
class | PacketsDefinition
class | RawFieldType
class | ScriptConfig
class | SizedType
class | SizeInfo
class | StringType
class | StructType
class | TypeRegistry
class | Variant
class | WorklistType

## Functions

Path | file_path ("str | Path" s)
| Parsing Command Line Arguments ######################.
bool | files_equal ("str | Path" path_a, "str | Path" path_b)
"typing.Iterator[tuple[T_co, ...]]" | powerset (typing.Iterable[T_co] iterable)
str | prefix (str prefix, str text)
| write_common_header ("str | Path | None" path, PacketsDefinition packets)
| write_common_impl ("str | Path | None" path, PacketsDefinition packets)
| write_server_header ("str | Path | None" path, PacketsDefinition packets)
| write_client_header ("str | Path | None" path, PacketsDefinition packets)
| write_server_impl ("str | Path | None" path, PacketsDefinition packets)
| write_client_impl ("str | Path | None" path, PacketsDefinition packets)
| main ("typing.Sequence[str] | None" raw_args=None)

## Variables

| cache = lru_cache(None)
| T_co = typing.TypeVar("T_co", covariant = True)
| INSERT_PREFIX_PATTERN = re.compile(r"^(?!#|$)", re.MULTILINE)
| FieldTypeConstructor = typing.Callable[[str, str], RawFieldType]
| DEFAULT_REGISTRY = TypeRegistry(BasicType)

## Function Documentation

## ◆ file_path()

Path generate_packets.file_path | ( | "str | Path" | s | ) |

Parsing Command Line Arguments ######################.

    Parse the given path and check basic validity.

Definition at line 42 of file generate_packets.py.

## ◆ files_equal()

bool generate_packets.files_equal | ( | "str | Path" | path_a,
|  | "str | Path" | path_b
| ) |  |

    Return whether the contents of two text files are identical

Definition at line 329 of file generate_packets.py.

## ◆ main()

generate_packets.main | ( | "typing.Sequence[str] | None" | raw_args = `None` | ) |

    Main function. Read the given arguments, or the command line
    arguments if raw_args is not given, and run the packet code generation
    script accordingly.

Definition at line 3607 of file generate_packets.py.

## ◆ powerset()

"typing.Iterator[tuple[T_co, ...]]" generate_packets.powerset | ( | typing.Iterable[T_co] | iterable | ) |

Definition at line 335 of file generate_packets.py.

## ◆ prefix()

str generate_packets.prefix | ( | str | prefix,
|  | str | text
| ) |  |

    Prepend prefix to every line of text, except blank lines and those
    starting with #

Definition at line 344 of file generate_packets.py.

## ◆ write_client_header()

generate_packets.write_client_header | ( | "str | Path | None" | path,
|  | PacketsDefinition | packets
| ) |  |

    Write contents for client/packhand_gen.h to the given path

Definition at line 3474 of file generate_packets.py.

## ◆ write_client_impl()

generate_packets.write_client_impl | ( | "str | Path | None" | path,
|  | PacketsDefinition | packets
| ) |  |

    Write contents for client/packhand_gen.c to the given path

Definition at line 3560 of file generate_packets.py.

## ◆ write_common_header()

generate_packets.write_common_header | ( | "str | Path | None" | path,
|  | PacketsDefinition | packets
| ) |  |

    Write contents for common/packets_gen.h to the given path

Definition at line 3331 of file generate_packets.py.

## ◆ write_common_impl()

generate_packets.write_common_impl | ( | "str | Path | None" | path,
|  | PacketsDefinition | packets
| ) |  |

    Write contents for common/packets_gen.c to the given path

Definition at line 3362 of file generate_packets.py.

## ◆ write_server_header()

generate_packets.write_server_header | ( | "str | Path | None" | path,
|  | PacketsDefinition | packets
| ) |  |

    Write contents for server/hand_gen.h to the given path

Definition at line 3433 of file generate_packets.py.

## ◆ write_server_impl()

generate_packets.write_server_impl | ( | "str | Path | None" | path,
|  | PacketsDefinition | packets
| ) |  |

    Write contents for server/hand_gen.c to the given path

Definition at line 3507 of file generate_packets.py.

## Variable Documentation

## ◆ cache

generate_packets.cache = lru_cache(None)

Definition at line 33 of file generate_packets.py.

## ◆ DEFAULT_REGISTRY

generate_packets.DEFAULT_REGISTRY = TypeRegistry(BasicType)

Definition at line 763 of file generate_packets.py.

## ◆ FieldTypeConstructor

generate_packets.FieldTypeConstructor = typing.Callable[[str, str], RawFieldType]

Definition at line 552 of file generate_packets.py.

## ◆ INSERT_PREFIX_PATTERN

generate_packets.INSERT_PREFIX_PATTERN = re.compile(r"^(?!#|$)", re.MULTILINE)

Definition at line 340 of file generate_packets.py.

## ◆ T_co

generate_packets.T_co = typing.TypeVar("T_co", covariant = True)

Definition at line 37 of file generate_packets.py.