Freeciv-3.3
|
Public Member Functions | |
__init__ (self, str name, *"str | None" location=None, int depth=0, "int | None" json_depth=None) | |
"Location" | constant (cls, str location, str name="(unknown)") |
"Location" | replace (self, str new_location) |
"Location" | deeper (self, str new_location, int json_step=1) |
"Location" | sub_full (self, int json_step=1) |
str | index (self) |
"Location" | sub (self) |
str | json_subloc (self) |
str | __matmul__ (self, "str | None" packet) |
str | __str__ (self) |
str | __repr__ (self) |
bool | __eq__ (self, other) |
int | __hash__ (self) |
Data Fields | |
name | |
depth | |
json_depth | |
Static Public Attributes | |
str | name |
int | depth |
int | json_depth |
Protected Attributes | |
_location | |
_INDICES | |
_PACKET | |
Static Protected Attributes | |
str | _PACKET = "#error gen_packet$" |
str | _INDICES = "ijk" |
str | _location |
Roughly represents a location in memory for the generated code; outside of recursive field types like arrays, this will usually just be a field of a packet, but it serves to concisely handle the recursion.
Definition at line 345 of file generate_packets.py.
generate_packets.Location.__init__ | ( | self, | |
str | name, | ||
*"str | None" | location = None , |
||
int | depth = 0 , |
||
"int | None" | json_depth = None |
||
) |
Definition at line 367 of file generate_packets.py.
bool generate_packets.Location.__eq__ | ( | self, | |
other | |||
) |
Definition at line 440 of file generate_packets.py.
int generate_packets.Location.__hash__ | ( | self | ) |
Definition at line 452 of file generate_packets.py.
self @ packet Code fragment of this location in the given packet, or in local variables if packet is None
Definition at line 427 of file generate_packets.py.
str generate_packets.Location.__repr__ | ( | self | ) |
Definition at line 437 of file generate_packets.py.
str generate_packets.Location.__str__ | ( | self | ) |
Definition at line 434 of file generate_packets.py.
Construct a Location not dependent on the packet
Definition at line 376 of file generate_packets.py.
Return the given string as a new Location with the same name as self and incremented depth
Definition at line 391 of file generate_packets.py.
str generate_packets.Location.index | ( | self | ) |
The index name for the current depth
Definition at line 407 of file generate_packets.py.
str generate_packets.Location.json_subloc | ( | self | ) |
The plocation (JSON field address) to the sub-location of this location's corresponding field address
Definition at line 422 of file generate_packets.py.
"Location" generate_packets.Location.replace | ( | self, | |
str | new_location | ||
) |
Return the given string as a new Location with the same metadata as self
Definition at line 381 of file generate_packets.py.
"Location" generate_packets.Location.sub | ( | self | ) |
A location one level deeper with the current index subscript added to the end. `field` ~> `field[i]` ~> `field[i][j]` etc.
Definition at line 414 of file generate_packets.py.
"Location" generate_packets.Location.sub_full | ( | self, | |
int | json_step = 1 |
||
) |
Like self.sub, but with the option to step the JSON nesting depth by a different amount.
Definition at line 401 of file generate_packets.py.
|
staticprotected |
Definition at line 353 of file generate_packets.py.
|
protected |
Definition at line 409 of file generate_packets.py.
|
staticprotected |
Definition at line 357 of file generate_packets.py.
|
protected |
Definition at line 370 of file generate_packets.py.
|
staticprotected |
Definition at line 352 of file generate_packets.py.
|
protected |
Definition at line 432 of file generate_packets.py.
|
static |
Definition at line 360 of file generate_packets.py.
generate_packets.Location.depth |
Definition at line 371 of file generate_packets.py.
|
static |
Definition at line 363 of file generate_packets.py.
generate_packets.Location.json_depth |
Definition at line 372 of file generate_packets.py.
|
static |
Definition at line 355 of file generate_packets.py.
generate_packets.Location.name |
Definition at line 369 of file generate_packets.py.