repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
clalancette/pycdlib | pycdlib/headervd.py | PrimaryOrSupplementaryVD.copy_sizes | def copy_sizes(self, othervd):
# type: (PrimaryOrSupplementaryVD) -> None
'''
Copy the path_tbl_size, path_table_num_extents, and space_size from
another volume descriptor.
Parameters:
othervd - The other volume descriptor to copy from.
Returns:
Nothing... | python | def copy_sizes(self, othervd):
# type: (PrimaryOrSupplementaryVD) -> None
'''
Copy the path_tbl_size, path_table_num_extents, and space_size from
another volume descriptor.
Parameters:
othervd - The other volume descriptor to copy from.
Returns:
Nothing... | [
"def",
"copy_sizes",
"(",
"self",
",",
"othervd",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'This Volume Descriptor is not yet initialized'",
")",
"self",
".",
"space_size",
"=",
"othervd... | Copy the path_tbl_size, path_table_num_extents, and space_size from
another volume descriptor.
Parameters:
othervd - The other volume descriptor to copy from.
Returns:
Nothing. | [
"Copy",
"the",
"path_tbl_size",
"path_table_num_extents",
"and",
"space_size",
"from",
"another",
"volume",
"descriptor",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/headervd.py#L679-L695 | train |
clalancette/pycdlib | pycdlib/headervd.py | FileOrTextIdentifier.parse | def parse(self, ident_str):
# type: (bytes) -> None
'''
Parse a file or text identifier out of a string.
Parameters:
ident_str - The string to parse the file or text identifier from.
Returns:
Nothing.
'''
if self._initialized:
rai... | python | def parse(self, ident_str):
# type: (bytes) -> None
'''
Parse a file or text identifier out of a string.
Parameters:
ident_str - The string to parse the file or text identifier from.
Returns:
Nothing.
'''
if self._initialized:
rai... | [
"def",
"parse",
"(",
"self",
",",
"ident_str",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'This File or Text identifier is already initialized'",
")",
"self",
".",
"text",
"=",
"ident_str",
"self... | Parse a file or text identifier out of a string.
Parameters:
ident_str - The string to parse the file or text identifier from.
Returns:
Nothing. | [
"Parse",
"a",
"file",
"or",
"text",
"identifier",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/headervd.py#L904-L921 | train |
clalancette/pycdlib | pycdlib/headervd.py | FileOrTextIdentifier.new | def new(self, text):
# type: (bytes) -> None
'''
Create a new file or text identifier.
Parameters:
text - The text to store into the identifier.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalEr... | python | def new(self, text):
# type: (bytes) -> None
'''
Create a new file or text identifier.
Parameters:
text - The text to store into the identifier.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalEr... | [
"def",
"new",
"(",
"self",
",",
"text",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'This File or Text identifier is already initialized'",
")",
"if",
"len",
"(",
"text",
")",
"!=",
"128",
":"... | Create a new file or text identifier.
Parameters:
text - The text to store into the identifier.
Returns:
Nothing. | [
"Create",
"a",
"new",
"file",
"or",
"text",
"identifier",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/headervd.py#L923-L941 | train |
clalancette/pycdlib | pycdlib/headervd.py | VolumeDescriptorSetTerminator.parse | def parse(self, vd, extent_loc):
# type: (bytes, int) -> None
'''
A method to parse a Volume Descriptor Set Terminator out of a string.
Parameters:
vd - The string to parse.
extent_loc - The extent this VDST is currently located at.
Returns:
Nothing.
... | python | def parse(self, vd, extent_loc):
# type: (bytes, int) -> None
'''
A method to parse a Volume Descriptor Set Terminator out of a string.
Parameters:
vd - The string to parse.
extent_loc - The extent this VDST is currently located at.
Returns:
Nothing.
... | [
"def",
"parse",
"(",
"self",
",",
"vd",
",",
"extent_loc",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Volume Descriptor Set Terminator already initialized'",
")",
"(",
"descriptor_type",
",",
"i... | A method to parse a Volume Descriptor Set Terminator out of a string.
Parameters:
vd - The string to parse.
extent_loc - The extent this VDST is currently located at.
Returns:
Nothing. | [
"A",
"method",
"to",
"parse",
"a",
"Volume",
"Descriptor",
"Set",
"Terminator",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/headervd.py#L978-L1011 | train |
clalancette/pycdlib | pycdlib/headervd.py | BootRecord.parse | def parse(self, vd, extent_loc):
# type: (bytes, int) -> None
'''
A method to parse a Boot Record out of a string.
Parameters:
vd - The string to parse the Boot Record out of.
extent_loc - The extent location this Boot Record is current at.
Returns:
No... | python | def parse(self, vd, extent_loc):
# type: (bytes, int) -> None
'''
A method to parse a Boot Record out of a string.
Parameters:
vd - The string to parse the Boot Record out of.
extent_loc - The extent location this Boot Record is current at.
Returns:
No... | [
"def",
"parse",
"(",
"self",
",",
"vd",
",",
"extent_loc",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Boot Record already initialized'",
")",
"(",
"descriptor_type",
",",
"identifier",
",",
... | A method to parse a Boot Record out of a string.
Parameters:
vd - The string to parse the Boot Record out of.
extent_loc - The extent location this Boot Record is current at.
Returns:
Nothing. | [
"A",
"method",
"to",
"parse",
"a",
"Boot",
"Record",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/headervd.py#L1105-L1135 | train |
clalancette/pycdlib | pycdlib/headervd.py | BootRecord.new | def new(self, boot_system_id):
# type: (bytes) -> None
'''
A method to create a new Boot Record.
Parameters:
boot_system_id - The system identifier to associate with this Boot
Record.
Returns:
Nothing.
'''
if self._init... | python | def new(self, boot_system_id):
# type: (bytes) -> None
'''
A method to create a new Boot Record.
Parameters:
boot_system_id - The system identifier to associate with this Boot
Record.
Returns:
Nothing.
'''
if self._init... | [
"def",
"new",
"(",
"self",
",",
"boot_system_id",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"Exception",
"(",
"'Boot Record already initialized'",
")",
"self",
".",
"boot_system_identifier",
"=",
"boot_system_id",
".",
"ljust",
"(",
"32",
",",
... | A method to create a new Boot Record.
Parameters:
boot_system_id - The system identifier to associate with this Boot
Record.
Returns:
Nothing. | [
"A",
"method",
"to",
"create",
"a",
"new",
"Boot",
"Record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/headervd.py#L1137-L1155 | train |
clalancette/pycdlib | pycdlib/headervd.py | BootRecord.record | def record(self):
# type: () -> bytes
'''
A method to generate a string representing this Boot Record.
Parameters:
None.
Returns:
A string representing this Boot Record.
'''
if not self._initialized:
raise pycdlibexception.PyCdlibInt... | python | def record(self):
# type: () -> bytes
'''
A method to generate a string representing this Boot Record.
Parameters:
None.
Returns:
A string representing this Boot Record.
'''
if not self._initialized:
raise pycdlibexception.PyCdlibInt... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Boot Record not yet initialized'",
")",
"return",
"struct",
".",
"pack",
"(",
"self",
".",
"FMT",
",",
"VOLU... | A method to generate a string representing this Boot Record.
Parameters:
None.
Returns:
A string representing this Boot Record. | [
"A",
"method",
"to",
"generate",
"a",
"string",
"representing",
"this",
"Boot",
"Record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/headervd.py#L1157-L1172 | train |
clalancette/pycdlib | pycdlib/headervd.py | BootRecord.update_boot_system_use | def update_boot_system_use(self, boot_sys_use):
# type: (bytes) -> None
'''
A method to update the boot system use field of this Boot Record.
Parameters:
boot_sys_use - The new boot system use field for this Boot Record.
Returns:
Nothing.
'''
if... | python | def update_boot_system_use(self, boot_sys_use):
# type: (bytes) -> None
'''
A method to update the boot system use field of this Boot Record.
Parameters:
boot_sys_use - The new boot system use field for this Boot Record.
Returns:
Nothing.
'''
if... | [
"def",
"update_boot_system_use",
"(",
"self",
",",
"boot_sys_use",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Boot Record not yet initialized'",
")",
"self",
".",
"boot_system_use",
"=",
... | A method to update the boot system use field of this Boot Record.
Parameters:
boot_sys_use - The new boot system use field for this Boot Record.
Returns:
Nothing. | [
"A",
"method",
"to",
"update",
"the",
"boot",
"system",
"use",
"field",
"of",
"this",
"Boot",
"Record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/headervd.py#L1174-L1187 | train |
clalancette/pycdlib | pycdlib/headervd.py | VersionVolumeDescriptor.parse | def parse(self, data, extent):
# type: (bytes, int) -> bool
'''
Do a parse of a Version Volume Descriptor. This consists of seeing
whether the data is either all zero or starts with 'MKI', and if so,
setting the extent location of the Version Volume Descriptor properly.
... | python | def parse(self, data, extent):
# type: (bytes, int) -> bool
'''
Do a parse of a Version Volume Descriptor. This consists of seeing
whether the data is either all zero or starts with 'MKI', and if so,
setting the extent location of the Version Volume Descriptor properly.
... | [
"def",
"parse",
"(",
"self",
",",
"data",
",",
"extent",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'This Version Volume Descriptor is already initialized'",
")",
"if",
"data",
"[",
":",
"3",
... | Do a parse of a Version Volume Descriptor. This consists of seeing
whether the data is either all zero or starts with 'MKI', and if so,
setting the extent location of the Version Volume Descriptor properly.
Parameters:
data - The potential version data.
extent - The location ... | [
"Do",
"a",
"parse",
"of",
"a",
"Version",
"Volume",
"Descriptor",
".",
"This",
"consists",
"of",
"seeing",
"whether",
"the",
"data",
"is",
"either",
"all",
"zero",
"or",
"starts",
"with",
"MKI",
"and",
"if",
"so",
"setting",
"the",
"extent",
"location",
... | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/headervd.py#L1234-L1258 | train |
clalancette/pycdlib | pycdlib/headervd.py | VersionVolumeDescriptor.new | def new(self, log_block_size):
# type: (int) -> None
'''
Create a new Version Volume Descriptor.
Parameters:
log_block_size - The size of one extent.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalE... | python | def new(self, log_block_size):
# type: (int) -> None
'''
Create a new Version Volume Descriptor.
Parameters:
log_block_size - The size of one extent.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalE... | [
"def",
"new",
"(",
"self",
",",
"log_block_size",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'This Version Volume Descriptor is already initialized'",
")",
"self",
".",
"_data",
"=",
"b'\\x00'",
... | Create a new Version Volume Descriptor.
Parameters:
log_block_size - The size of one extent.
Returns:
Nothing. | [
"Create",
"a",
"new",
"Version",
"Volume",
"Descriptor",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/headervd.py#L1260-L1274 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoBootInfoTable.parse | def parse(self, vd, datastr, ino):
# type: (headervd.PrimaryOrSupplementaryVD, bytes, inode.Inode) -> bool
'''
A method to parse a boot info table out of a string.
Parameters:
vd - The Volume Descriptor associated with this Boot Info Table.
datastr - The string to pars... | python | def parse(self, vd, datastr, ino):
# type: (headervd.PrimaryOrSupplementaryVD, bytes, inode.Inode) -> bool
'''
A method to parse a boot info table out of a string.
Parameters:
vd - The Volume Descriptor associated with this Boot Info Table.
datastr - The string to pars... | [
"def",
"parse",
"(",
"self",
",",
"vd",
",",
"datastr",
",",
"ino",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'This Eltorito Boot Info Table is already initialized'",
")",
"(",
"pvd_extent",
"... | A method to parse a boot info table out of a string.
Parameters:
vd - The Volume Descriptor associated with this Boot Info Table.
datastr - The string to parse the boot info table out of.
ino - The Inode associated with the boot file.
Returns:
True if this is a valid... | [
"A",
"method",
"to",
"parse",
"a",
"boot",
"info",
"table",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L52-L76 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoBootInfoTable.new | def new(self, vd, ino, orig_len, csum):
# type: (headervd.PrimaryOrSupplementaryVD, inode.Inode, int, int) -> None
'''
A method to create a new boot info table.
Parameters:
vd - The volume descriptor to associate with this boot info table.
ino - The Inode associated wi... | python | def new(self, vd, ino, orig_len, csum):
# type: (headervd.PrimaryOrSupplementaryVD, inode.Inode, int, int) -> None
'''
A method to create a new boot info table.
Parameters:
vd - The volume descriptor to associate with this boot info table.
ino - The Inode associated wi... | [
"def",
"new",
"(",
"self",
",",
"vd",
",",
"ino",
",",
"orig_len",
",",
"csum",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'This Eltorito Boot Info Table is already initialized'",
")",
"self",
... | A method to create a new boot info table.
Parameters:
vd - The volume descriptor to associate with this boot info table.
ino - The Inode associated with this Boot Info Table.
orig_len - The original length of the file before the boot info table was patched into it.
csum - Th... | [
"A",
"method",
"to",
"create",
"a",
"new",
"boot",
"info",
"table",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L78-L97 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoBootInfoTable.record | def record(self):
# type: () -> bytes
'''
A method to generate a string representing this boot info table.
Parameters:
None.
Returns:
A string representing this boot info table.
'''
if not self._initialized:
raise pycdlibexception.Py... | python | def record(self):
# type: () -> bytes
'''
A method to generate a string representing this boot info table.
Parameters:
None.
Returns:
A string representing this boot info table.
'''
if not self._initialized:
raise pycdlibexception.Py... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'This Eltorito Boot Info Table not yet initialized'",
")",
"return",
"struct",
".",
"pack",
"(",
"'=LLLL'",
",",
... | A method to generate a string representing this boot info table.
Parameters:
None.
Returns:
A string representing this boot info table. | [
"A",
"method",
"to",
"generate",
"a",
"string",
"representing",
"this",
"boot",
"info",
"table",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L99-L114 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoValidationEntry.parse | def parse(self, valstr):
# type: (bytes) -> None
'''
A method to parse an El Torito Validation Entry out of a string.
Parameters:
valstr - The string to parse the El Torito Validation Entry out of.
Returns:
Nothing.
'''
if self._initialized:
... | python | def parse(self, valstr):
# type: (bytes) -> None
'''
A method to parse an El Torito Validation Entry out of a string.
Parameters:
valstr - The string to parse the El Torito Validation Entry out of.
Returns:
Nothing.
'''
if self._initialized:
... | [
"def",
"parse",
"(",
"self",
",",
"valstr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'El Torito Validation Entry already initialized'",
")",
"(",
"header_id",
",",
"self",
".",
"platform_id",
... | A method to parse an El Torito Validation Entry out of a string.
Parameters:
valstr - The string to parse the El Torito Validation Entry out of.
Returns:
Nothing. | [
"A",
"method",
"to",
"parse",
"an",
"El",
"Torito",
"Validation",
"Entry",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L183-L216 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoValidationEntry.new | def new(self, platform_id):
# type: (int) -> None
'''
A method to create a new El Torito Validation Entry.
Parameters:
platform_id - The platform ID to set for this validation entry.
Returns:
Nothing.
'''
if self._initialized:
raise ... | python | def new(self, platform_id):
# type: (int) -> None
'''
A method to create a new El Torito Validation Entry.
Parameters:
platform_id - The platform ID to set for this validation entry.
Returns:
Nothing.
'''
if self._initialized:
raise ... | [
"def",
"new",
"(",
"self",
",",
"platform_id",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'El Torito Validation Entry already initialized'",
")",
"self",
".",
"platform_id",
"=",
"platform_id",
"... | A method to create a new El Torito Validation Entry.
Parameters:
platform_id - The platform ID to set for this validation entry.
Returns:
Nothing. | [
"A",
"method",
"to",
"create",
"a",
"new",
"El",
"Torito",
"Validation",
"Entry",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L218-L235 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoValidationEntry._record | def _record(self):
# type: () -> bytes
'''
An internal method to generate a string representing this El Torito
Validation Entry.
Parameters:
None.
Returns:
String representing this El Torito Validation Entry.
'''
return struct.pack(self.... | python | def _record(self):
# type: () -> bytes
'''
An internal method to generate a string representing this El Torito
Validation Entry.
Parameters:
None.
Returns:
String representing this El Torito Validation Entry.
'''
return struct.pack(self.... | [
"def",
"_record",
"(",
"self",
")",
":",
"return",
"struct",
".",
"pack",
"(",
"self",
".",
"FMT",
",",
"1",
",",
"self",
".",
"platform_id",
",",
"0",
",",
"self",
".",
"id_string",
",",
"self",
".",
"checksum",
",",
"0x55",
",",
"0xaa",
")"
] | An internal method to generate a string representing this El Torito
Validation Entry.
Parameters:
None.
Returns:
String representing this El Torito Validation Entry. | [
"An",
"internal",
"method",
"to",
"generate",
"a",
"string",
"representing",
"this",
"El",
"Torito",
"Validation",
"Entry",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L237-L249 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoEntry.parse | def parse(self, valstr):
# type: (bytes) -> None
'''
A method to parse an El Torito Entry out of a string.
Parameters:
valstr - The string to parse the El Torito Entry out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlib... | python | def parse(self, valstr):
# type: (bytes) -> None
'''
A method to parse an El Torito Entry out of a string.
Parameters:
valstr - The string to parse the El Torito Entry out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlib... | [
"def",
"parse",
"(",
"self",
",",
"valstr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'El Torito Entry already initialized'",
")",
"(",
"self",
".",
"boot_indicator",
",",
"self",
".",
"boot... | A method to parse an El Torito Entry out of a string.
Parameters:
valstr - The string to parse the El Torito Entry out of.
Returns:
Nothing. | [
"A",
"method",
"to",
"parse",
"an",
"El",
"Torito",
"Entry",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L306-L339 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoEntry.new | def new(self, sector_count, load_seg, media_name, system_type, bootable):
# type: (int, int, str, int, bool) -> None
'''
A method to create a new El Torito Entry.
Parameters:
sector_count - The number of sectors to assign to this El Torito Entry.
load_seg - The load se... | python | def new(self, sector_count, load_seg, media_name, system_type, bootable):
# type: (int, int, str, int, bool) -> None
'''
A method to create a new El Torito Entry.
Parameters:
sector_count - The number of sectors to assign to this El Torito Entry.
load_seg - The load se... | [
"def",
"new",
"(",
"self",
",",
"sector_count",
",",
"load_seg",
",",
"media_name",
",",
"system_type",
",",
"bootable",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'El Torito Entry already init... | A method to create a new El Torito Entry.
Parameters:
sector_count - The number of sectors to assign to this El Torito Entry.
load_seg - The load segment address of the boot image.
media_name - The name of the media type, one of 'noemul', 'floppy', or 'hdemul'.
system_type -... | [
"A",
"method",
"to",
"create",
"a",
"new",
"El",
"Torito",
"Entry",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L341-L390 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoEntry.set_inode | def set_inode(self, ino):
# type: (inode.Inode) -> None
'''
A method to set the Inode associated with this El Torito Entry.
Parameters:
ino - The Inode object corresponding to this entry.
Returns:
Nothing.
'''
if not self._initialized:
... | python | def set_inode(self, ino):
# type: (inode.Inode) -> None
'''
A method to set the Inode associated with this El Torito Entry.
Parameters:
ino - The Inode object corresponding to this entry.
Returns:
Nothing.
'''
if not self._initialized:
... | [
"def",
"set_inode",
"(",
"self",
",",
"ino",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'El Torito Entry not yet initialized'",
")",
"self",
".",
"inode",
"=",
"ino"
] | A method to set the Inode associated with this El Torito Entry.
Parameters:
ino - The Inode object corresponding to this entry.
Returns:
Nothing. | [
"A",
"method",
"to",
"set",
"the",
"Inode",
"associated",
"with",
"this",
"El",
"Torito",
"Entry",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L422-L434 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoEntry.record | def record(self):
# type: () -> bytes
'''
A method to generate a string representing this El Torito Entry.
Parameters:
None.
Returns:
String representing this El Torito Entry.
'''
if not self._initialized:
raise pycdlibexception.PyCd... | python | def record(self):
# type: () -> bytes
'''
A method to generate a string representing this El Torito Entry.
Parameters:
None.
Returns:
String representing this El Torito Entry.
'''
if not self._initialized:
raise pycdlibexception.PyCd... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'El Torito Entry not yet initialized'",
")",
"return",
"struct",
".",
"pack",
"(",
"self",
".",
"FMT",
",",
"... | A method to generate a string representing this El Torito Entry.
Parameters:
None.
Returns:
String representing this El Torito Entry. | [
"A",
"method",
"to",
"generate",
"a",
"string",
"representing",
"this",
"El",
"Torito",
"Entry",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L436-L453 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoEntry.set_data_length | def set_data_length(self, length):
# type: (int) -> None
'''
A method to set the length of data for this El Torito Entry.
Parameters:
length - The new length for the El Torito Entry.
Returns:
Nothing.
'''
if not self._initialized:
ra... | python | def set_data_length(self, length):
# type: (int) -> None
'''
A method to set the length of data for this El Torito Entry.
Parameters:
length - The new length for the El Torito Entry.
Returns:
Nothing.
'''
if not self._initialized:
ra... | [
"def",
"set_data_length",
"(",
"self",
",",
"length",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'El Torito Entry not initialized'",
")",
"self",
".",
"sector_count",
"=",
"utils",
".",
... | A method to set the length of data for this El Torito Entry.
Parameters:
length - The new length for the El Torito Entry.
Returns:
Nothing. | [
"A",
"method",
"to",
"set",
"the",
"length",
"of",
"data",
"for",
"this",
"El",
"Torito",
"Entry",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L471-L483 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoSectionHeader.parse | def parse(self, valstr):
# type: (bytes) -> None
'''
Parse an El Torito section header from a string.
Parameters:
valstr - The string to parse.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('... | python | def parse(self, valstr):
# type: (bytes) -> None
'''
Parse an El Torito section header from a string.
Parameters:
valstr - The string to parse.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('... | [
"def",
"parse",
"(",
"self",
",",
"valstr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'El Torito Section Header already initialized'",
")",
"(",
"self",
".",
"header_indicator",
",",
"self",
"... | Parse an El Torito section header from a string.
Parameters:
valstr - The string to parse.
Returns:
Nothing. | [
"Parse",
"an",
"El",
"Torito",
"section",
"header",
"from",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L500-L516 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoSectionHeader.new | def new(self, id_string, platform_id):
# type: (bytes, int) -> None
'''
Create a new El Torito section header.
Parameters:
id_string - The ID to use for this section header.
platform_id - The platform ID for this section header.
Returns:
Nothing.
... | python | def new(self, id_string, platform_id):
# type: (bytes, int) -> None
'''
Create a new El Torito section header.
Parameters:
id_string - The ID to use for this section header.
platform_id - The platform ID for this section header.
Returns:
Nothing.
... | [
"def",
"new",
"(",
"self",
",",
"id_string",
",",
"platform_id",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'El Torito Section Header already initialized'",
")",
"self",
".",
"header_indicator",
... | Create a new El Torito section header.
Parameters:
id_string - The ID to use for this section header.
platform_id - The platform ID for this section header.
Returns:
Nothing. | [
"Create",
"a",
"new",
"El",
"Torito",
"section",
"header",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L518-L538 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoSectionHeader.add_parsed_entry | def add_parsed_entry(self, entry):
# type: (EltoritoEntry) -> None
'''
A method to add a parsed entry to the list of entries of this header.
If the number of parsed entries exceeds what was expected from the
initial parsing of the header, this method will throw an Exception.
... | python | def add_parsed_entry(self, entry):
# type: (EltoritoEntry) -> None
'''
A method to add a parsed entry to the list of entries of this header.
If the number of parsed entries exceeds what was expected from the
initial parsing of the header, this method will throw an Exception.
... | [
"def",
"add_parsed_entry",
"(",
"self",
",",
"entry",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'El Torito Section Header not yet initialized'",
")",
"if",
"len",
"(",
"self",
".",
"sec... | A method to add a parsed entry to the list of entries of this header.
If the number of parsed entries exceeds what was expected from the
initial parsing of the header, this method will throw an Exception.
Parameters:
entry - The EltoritoEntry object to add to the list of entries.
... | [
"A",
"method",
"to",
"add",
"a",
"parsed",
"entry",
"to",
"the",
"list",
"of",
"entries",
"of",
"this",
"header",
".",
"If",
"the",
"number",
"of",
"parsed",
"entries",
"exceeds",
"what",
"was",
"expected",
"from",
"the",
"initial",
"parsing",
"of",
"the... | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L540-L558 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoSectionHeader.add_new_entry | def add_new_entry(self, entry):
# type: (EltoritoEntry) -> None
'''
A method to add a completely new entry to the list of entries of this
header.
Parameters:
entry - The new EltoritoEntry object to add to the list of entries.
Returns:
Nothing.
'... | python | def add_new_entry(self, entry):
# type: (EltoritoEntry) -> None
'''
A method to add a completely new entry to the list of entries of this
header.
Parameters:
entry - The new EltoritoEntry object to add to the list of entries.
Returns:
Nothing.
'... | [
"def",
"add_new_entry",
"(",
"self",
",",
"entry",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'El Torito Section Header not yet initialized'",
")",
"self",
".",
"num_section_entries",
"+=",
... | A method to add a completely new entry to the list of entries of this
header.
Parameters:
entry - The new EltoritoEntry object to add to the list of entries.
Returns:
Nothing. | [
"A",
"method",
"to",
"add",
"a",
"completely",
"new",
"entry",
"to",
"the",
"list",
"of",
"entries",
"of",
"this",
"header",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L560-L576 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoSectionHeader.record | def record(self):
# type: () -> bytes
'''
Get a string representing this El Torito section header.
Parameters:
None.
Returns:
A string representing this El Torito section header.
'''
if not self._initialized:
raise pycdlibexception.P... | python | def record(self):
# type: () -> bytes
'''
Get a string representing this El Torito section header.
Parameters:
None.
Returns:
A string representing this El Torito section header.
'''
if not self._initialized:
raise pycdlibexception.P... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'El Torito Section Header not yet initialized'",
")",
"outlist",
"=",
"[",
"struct",
".",
"pack",
"(",
"self",
... | Get a string representing this El Torito section header.
Parameters:
None.
Returns:
A string representing this El Torito section header. | [
"Get",
"a",
"string",
"representing",
"this",
"El",
"Torito",
"section",
"header",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L594-L614 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoBootCatalog.parse | def parse(self, valstr):
# type: (bytes) -> bool
'''
A method to parse an El Torito Boot Catalog out of a string.
Parameters:
valstr - The string to parse the El Torito Boot Catalog out of.
Returns:
Nothing.
'''
if self._initialized:
... | python | def parse(self, valstr):
# type: (bytes) -> bool
'''
A method to parse an El Torito Boot Catalog out of a string.
Parameters:
valstr - The string to parse the El Torito Boot Catalog out of.
Returns:
Nothing.
'''
if self._initialized:
... | [
"def",
"parse",
"(",
"self",
",",
"valstr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'El Torito Boot Catalog already initialized'",
")",
"if",
"self",
".",
"state",
"==",
"self",
".",
"EXPE... | A method to parse an El Torito Boot Catalog out of a string.
Parameters:
valstr - The string to parse the El Torito Boot Catalog out of.
Returns:
Nothing. | [
"A",
"method",
"to",
"parse",
"an",
"El",
"Torito",
"Boot",
"Catalog",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L641-L710 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoBootCatalog.new | def new(self, br, ino, sector_count, load_seg, media_name, system_type,
platform_id, bootable):
# type: (headervd.BootRecord, inode.Inode, int, int, str, int, int, bool) -> None
'''
A method to create a new El Torito Boot Catalog.
Parameters:
br - The boot record th... | python | def new(self, br, ino, sector_count, load_seg, media_name, system_type,
platform_id, bootable):
# type: (headervd.BootRecord, inode.Inode, int, int, str, int, int, bool) -> None
'''
A method to create a new El Torito Boot Catalog.
Parameters:
br - The boot record th... | [
"def",
"new",
"(",
"self",
",",
"br",
",",
"ino",
",",
"sector_count",
",",
"load_seg",
",",
"media_name",
",",
"system_type",
",",
"platform_id",
",",
"bootable",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlib... | A method to create a new El Torito Boot Catalog.
Parameters:
br - The boot record that this El Torito Boot Catalog is associated with.
ino - The Inode to associate with the initial entry.
sector_count - The number of sectors for the initial entry.
load_seg - The load segment... | [
"A",
"method",
"to",
"create",
"a",
"new",
"El",
"Torito",
"Boot",
"Catalog",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L712-L743 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoBootCatalog.add_section | def add_section(self, ino, sector_count, load_seg, media_name, system_type,
efi, bootable):
# type: (inode.Inode, int, int, str, int, bool, bool) -> None
'''
A method to add an section header and entry to this Boot Catalog.
Parameters:
ino - The Inode object... | python | def add_section(self, ino, sector_count, load_seg, media_name, system_type,
efi, bootable):
# type: (inode.Inode, int, int, str, int, bool, bool) -> None
'''
A method to add an section header and entry to this Boot Catalog.
Parameters:
ino - The Inode object... | [
"def",
"add_section",
"(",
"self",
",",
"ino",
",",
"sector_count",
",",
"load_seg",
",",
"media_name",
",",
"system_type",
",",
"efi",
",",
"bootable",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibIntern... | A method to add an section header and entry to this Boot Catalog.
Parameters:
ino - The Inode object to associate with the new Entry.
sector_count - The number of sectors to assign to the new Entry.
load_seg - The load segment address of the boot image.
media_name - The name... | [
"A",
"method",
"to",
"add",
"an",
"section",
"header",
"and",
"entry",
"to",
"this",
"Boot",
"Catalog",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L745-L790 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoBootCatalog.record | def record(self):
# type: () -> bytes
'''
A method to generate a string representing this El Torito Boot Catalog.
Parameters:
None.
Returns:
A string representing this El Torito Boot Catalog.
'''
if not self._initialized:
raise pycdl... | python | def record(self):
# type: () -> bytes
'''
A method to generate a string representing this El Torito Boot Catalog.
Parameters:
None.
Returns:
A string representing this El Torito Boot Catalog.
'''
if not self._initialized:
raise pycdl... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'El Torito Boot Catalog not yet initialized'",
")",
"outlist",
"=",
"[",
"self",
".",
"validation_entry",
".",
"r... | A method to generate a string representing this El Torito Boot Catalog.
Parameters:
None.
Returns:
A string representing this El Torito Boot Catalog. | [
"A",
"method",
"to",
"generate",
"a",
"string",
"representing",
"this",
"El",
"Torito",
"Boot",
"Catalog",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L792-L813 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoBootCatalog.add_dirrecord | def add_dirrecord(self, rec):
# type: (Union[dr.DirectoryRecord, udfmod.UDFFileEntry]) -> None
'''
A method to set the Directory Record associated with this Boot Catalog.
Parameters:
rec - The DirectoryRecord object to associate with this Boot Catalog.
Returns:
... | python | def add_dirrecord(self, rec):
# type: (Union[dr.DirectoryRecord, udfmod.UDFFileEntry]) -> None
'''
A method to set the Directory Record associated with this Boot Catalog.
Parameters:
rec - The DirectoryRecord object to associate with this Boot Catalog.
Returns:
... | [
"def",
"add_dirrecord",
"(",
"self",
",",
"rec",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'El Torito Boot Catalog not yet initialized'",
")",
"self",
".",
"dirrecords",
".",
"append",
... | A method to set the Directory Record associated with this Boot Catalog.
Parameters:
rec - The DirectoryRecord object to associate with this Boot Catalog.
Returns:
Nothing. | [
"A",
"method",
"to",
"set",
"the",
"Directory",
"Record",
"associated",
"with",
"this",
"Boot",
"Catalog",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L815-L828 | train |
clalancette/pycdlib | pycdlib/eltorito.py | EltoritoBootCatalog.update_catalog_extent | def update_catalog_extent(self, current_extent):
# type: (int) -> None
'''
A method to update the extent associated with this Boot Catalog.
Parameters:
current_extent - New extent to associate with this Boot Catalog
Returns:
Nothing.
'''
if not ... | python | def update_catalog_extent(self, current_extent):
# type: (int) -> None
'''
A method to update the extent associated with this Boot Catalog.
Parameters:
current_extent - New extent to associate with this Boot Catalog
Returns:
Nothing.
'''
if not ... | [
"def",
"update_catalog_extent",
"(",
"self",
",",
"current_extent",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'El Torito Boot Catalog not yet initialized'",
")",
"self",
".",
"br",
".",
"... | A method to update the extent associated with this Boot Catalog.
Parameters:
current_extent - New extent to associate with this Boot Catalog
Returns:
Nothing. | [
"A",
"method",
"to",
"update",
"the",
"extent",
"associated",
"with",
"this",
"Boot",
"Catalog",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/eltorito.py#L857-L870 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | _check_d1_characters | def _check_d1_characters(name):
# type: (bytes) -> None
'''
A function to check that a name only uses d1 characters as defined by ISO9660.
Parameters:
name - The name to check.
Returns:
Nothing.
'''
bytename = bytearray(name)
for char in bytename:
if char not in _allow... | python | def _check_d1_characters(name):
# type: (bytes) -> None
'''
A function to check that a name only uses d1 characters as defined by ISO9660.
Parameters:
name - The name to check.
Returns:
Nothing.
'''
bytename = bytearray(name)
for char in bytename:
if char not in _allow... | [
"def",
"_check_d1_characters",
"(",
"name",
")",
":",
"bytename",
"=",
"bytearray",
"(",
"name",
")",
"for",
"char",
"in",
"bytename",
":",
"if",
"char",
"not",
"in",
"_allowed_d1_characters",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
... | A function to check that a name only uses d1 characters as defined by ISO9660.
Parameters:
name - The name to check.
Returns:
Nothing. | [
"A",
"function",
"to",
"check",
"that",
"a",
"name",
"only",
"uses",
"d1",
"characters",
"as",
"defined",
"by",
"ISO9660",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L68-L81 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | _split_iso9660_filename | def _split_iso9660_filename(fullname):
# type: (bytes) -> Tuple[bytes, bytes, bytes]
'''
A function to split an ISO 9660 filename into its constituent parts. This
is the name, the extension, and the version number.
Parameters:
fullname - The name to split.
Returns:
A tuple containing... | python | def _split_iso9660_filename(fullname):
# type: (bytes) -> Tuple[bytes, bytes, bytes]
'''
A function to split an ISO 9660 filename into its constituent parts. This
is the name, the extension, and the version number.
Parameters:
fullname - The name to split.
Returns:
A tuple containing... | [
"def",
"_split_iso9660_filename",
"(",
"fullname",
")",
":",
"namesplit",
"=",
"fullname",
".",
"split",
"(",
"b';'",
")",
"version",
"=",
"b''",
"if",
"len",
"(",
"namesplit",
")",
">",
"1",
":",
"version",
"=",
"namesplit",
".",
"pop",
"(",
")",
"res... | A function to split an ISO 9660 filename into its constituent parts. This
is the name, the extension, and the version number.
Parameters:
fullname - The name to split.
Returns:
A tuple containing the name, extension, and version. | [
"A",
"function",
"to",
"split",
"an",
"ISO",
"9660",
"filename",
"into",
"its",
"constituent",
"parts",
".",
"This",
"is",
"the",
"name",
"the",
"extension",
"and",
"the",
"version",
"number",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L84-L110 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | _check_iso9660_filename | def _check_iso9660_filename(fullname, interchange_level):
# type: (bytes, int) -> None
'''
A function to check that a file identifier conforms to the ISO9660 rules
for a particular interchange level.
Parameters:
fullname - The name to check.
interchange_level - The interchange level to ch... | python | def _check_iso9660_filename(fullname, interchange_level):
# type: (bytes, int) -> None
'''
A function to check that a file identifier conforms to the ISO9660 rules
for a particular interchange level.
Parameters:
fullname - The name to check.
interchange_level - The interchange level to ch... | [
"def",
"_check_iso9660_filename",
"(",
"fullname",
",",
"interchange_level",
")",
":",
"(",
"name",
",",
"extension",
",",
"version",
")",
"=",
"_split_iso9660_filename",
"(",
"fullname",
")",
"if",
"version",
"!=",
"b''",
"and",
"(",
"int",
"(",
"version",
... | A function to check that a file identifier conforms to the ISO9660 rules
for a particular interchange level.
Parameters:
fullname - The name to check.
interchange_level - The interchange level to check against.
Returns:
Nothing. | [
"A",
"function",
"to",
"check",
"that",
"a",
"file",
"identifier",
"conforms",
"to",
"the",
"ISO9660",
"rules",
"for",
"a",
"particular",
"interchange",
"level",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L113-L171 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | _check_iso9660_directory | def _check_iso9660_directory(fullname, interchange_level):
# type: (bytes, int) -> None
'''
A function to check that an directory identifier conforms to the ISO9660 rules
for a particular interchange level.
Parameters:
fullname - The name to check.
interchange_level - The interchange leve... | python | def _check_iso9660_directory(fullname, interchange_level):
# type: (bytes, int) -> None
'''
A function to check that an directory identifier conforms to the ISO9660 rules
for a particular interchange level.
Parameters:
fullname - The name to check.
interchange_level - The interchange leve... | [
"def",
"_check_iso9660_directory",
"(",
"fullname",
",",
"interchange_level",
")",
":",
"if",
"not",
"fullname",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'ISO9660 directory names must be at least 1 character long'",
")",
"maxlen",
"=",
"float",
... | A function to check that an directory identifier conforms to the ISO9660 rules
for a particular interchange level.
Parameters:
fullname - The name to check.
interchange_level - The interchange level to check against.
Returns:
Nothing. | [
"A",
"function",
"to",
"check",
"that",
"an",
"directory",
"identifier",
"conforms",
"to",
"the",
"ISO9660",
"rules",
"for",
"a",
"particular",
"interchange",
"level",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L174-L215 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | _interchange_level_from_filename | def _interchange_level_from_filename(fullname):
# type: (bytes) -> int
'''
A function to determine the ISO interchange level from the filename.
In theory, there are 3 levels, but in practice we only deal with level 1
and level 3.
Parameters:
name - The name to use to determine the intercha... | python | def _interchange_level_from_filename(fullname):
# type: (bytes) -> int
'''
A function to determine the ISO interchange level from the filename.
In theory, there are 3 levels, but in practice we only deal with level 1
and level 3.
Parameters:
name - The name to use to determine the intercha... | [
"def",
"_interchange_level_from_filename",
"(",
"fullname",
")",
":",
"(",
"name",
",",
"extension",
",",
"version",
")",
"=",
"_split_iso9660_filename",
"(",
"fullname",
")",
"interchange_level",
"=",
"1",
"if",
"version",
"!=",
"b''",
"and",
"(",
"int",
"(",... | A function to determine the ISO interchange level from the filename.
In theory, there are 3 levels, but in practice we only deal with level 1
and level 3.
Parameters:
name - The name to use to determine the interchange level.
Returns:
The interchange level determined from this filename. | [
"A",
"function",
"to",
"determine",
"the",
"ISO",
"interchange",
"level",
"from",
"the",
"filename",
".",
"In",
"theory",
"there",
"are",
"3",
"levels",
"but",
"in",
"practice",
"we",
"only",
"deal",
"with",
"level",
"1",
"and",
"level",
"3",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L218-L249 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | _interchange_level_from_directory | def _interchange_level_from_directory(name):
# type: (bytes) -> int
'''
A function to determine the ISO interchange level from the directory name.
In theory, there are 3 levels, but in practice we only deal with level 1
and level 3.
Parameters:
name - The name to use to determine the inter... | python | def _interchange_level_from_directory(name):
# type: (bytes) -> int
'''
A function to determine the ISO interchange level from the directory name.
In theory, there are 3 levels, but in practice we only deal with level 1
and level 3.
Parameters:
name - The name to use to determine the inter... | [
"def",
"_interchange_level_from_directory",
"(",
"name",
")",
":",
"interchange_level",
"=",
"1",
"if",
"len",
"(",
"name",
")",
">",
"8",
":",
"interchange_level",
"=",
"3",
"try",
":",
"_check_d1_characters",
"(",
"name",
")",
"except",
"pycdlibexception",
"... | A function to determine the ISO interchange level from the directory name.
In theory, there are 3 levels, but in practice we only deal with level 1
and level 3.
Parameters:
name - The name to use to determine the interchange level.
Returns:
The interchange level determined from this filename. | [
"A",
"function",
"to",
"determine",
"the",
"ISO",
"interchange",
"level",
"from",
"the",
"directory",
"name",
".",
"In",
"theory",
"there",
"are",
"3",
"levels",
"but",
"in",
"practice",
"we",
"only",
"deal",
"with",
"level",
"1",
"and",
"level",
"3",
".... | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L252-L273 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | _yield_children | def _yield_children(rec):
# type: (dr.DirectoryRecord) -> Generator
'''
An internal function to gather and yield all of the children of a Directory
Record.
Parameters:
rec - The Directory Record to get all of the children from (must be a
directory)
Yields:
Children of this ... | python | def _yield_children(rec):
# type: (dr.DirectoryRecord) -> Generator
'''
An internal function to gather and yield all of the children of a Directory
Record.
Parameters:
rec - The Directory Record to get all of the children from (must be a
directory)
Yields:
Children of this ... | [
"def",
"_yield_children",
"(",
"rec",
")",
":",
"if",
"not",
"rec",
".",
"is_dir",
"(",
")",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'Record is not a directory!'",
")",
"last",
"=",
"b''",
"for",
"child",
"in",
"rec",
".",
"childr... | An internal function to gather and yield all of the children of a Directory
Record.
Parameters:
rec - The Directory Record to get all of the children from (must be a
directory)
Yields:
Children of this Directory Record.
Returns:
Nothing. | [
"An",
"internal",
"function",
"to",
"gather",
"and",
"yield",
"all",
"of",
"the",
"children",
"of",
"a",
"Directory",
"Record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L417-L458 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | _assign_udf_desc_extents | def _assign_udf_desc_extents(descs, start_extent):
# type: (PyCdlib._UDFDescriptors, int) -> None
'''
An internal function to assign a consecutive sequence of extents for the
given set of UDF Descriptors, starting at the given extent.
Parameters:
descs - The PyCdlib._UDFDescriptors object to a... | python | def _assign_udf_desc_extents(descs, start_extent):
# type: (PyCdlib._UDFDescriptors, int) -> None
'''
An internal function to assign a consecutive sequence of extents for the
given set of UDF Descriptors, starting at the given extent.
Parameters:
descs - The PyCdlib._UDFDescriptors object to a... | [
"def",
"_assign_udf_desc_extents",
"(",
"descs",
",",
"start_extent",
")",
":",
"current_extent",
"=",
"start_extent",
"descs",
".",
"pvd",
".",
"set_extent_location",
"(",
"current_extent",
")",
"current_extent",
"+=",
"1",
"descs",
".",
"impl_use",
".",
"set_ext... | An internal function to assign a consecutive sequence of extents for the
given set of UDF Descriptors, starting at the given extent.
Parameters:
descs - The PyCdlib._UDFDescriptors object to assign extents for.
start_extent - The starting extent to assign from.
Returns:
Nothing. | [
"An",
"internal",
"function",
"to",
"assign",
"a",
"consecutive",
"sequence",
"of",
"extents",
"for",
"the",
"given",
"set",
"of",
"UDF",
"Descriptors",
"starting",
"at",
"the",
"given",
"extent",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L461-L491 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | _find_dr_record_by_name | def _find_dr_record_by_name(vd, path, encoding):
# type: (headervd.PrimaryOrSupplementaryVD, bytes, str) -> dr.DirectoryRecord
'''
An internal function to find an directory record on the ISO given an ISO
or Joliet path. If the entry is found, it returns the directory record
object corresponding to ... | python | def _find_dr_record_by_name(vd, path, encoding):
# type: (headervd.PrimaryOrSupplementaryVD, bytes, str) -> dr.DirectoryRecord
'''
An internal function to find an directory record on the ISO given an ISO
or Joliet path. If the entry is found, it returns the directory record
object corresponding to ... | [
"def",
"_find_dr_record_by_name",
"(",
"vd",
",",
"path",
",",
"encoding",
")",
":",
"if",
"not",
"utils",
".",
"starts_with_slash",
"(",
"path",
")",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'Must be a path starting with /'",
")",
"root... | An internal function to find an directory record on the ISO given an ISO
or Joliet path. If the entry is found, it returns the directory record
object corresponding to that entry. If the entry could not be found,
a pycdlibexception.PyCdlibInvalidInput exception is raised.
Parameters:
vd - The Vo... | [
"An",
"internal",
"function",
"to",
"find",
"an",
"directory",
"record",
"on",
"the",
"ISO",
"given",
"an",
"ISO",
"or",
"Joliet",
"path",
".",
"If",
"the",
"entry",
"is",
"found",
"it",
"returns",
"the",
"directory",
"record",
"object",
"corresponding",
"... | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L494-L567 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlibIO.read | def read(self, size=None):
# type: (Optional[int]) -> bytes
'''
A method to read and return up to size bytes.
Parameters:
size - Optional parameter to read size number of bytes; if None or
negative, all remaining bytes in the file will be read
Returns:
... | python | def read(self, size=None):
# type: (Optional[int]) -> bytes
'''
A method to read and return up to size bytes.
Parameters:
size - Optional parameter to read size number of bytes; if None or
negative, all remaining bytes in the file will be read
Returns:
... | [
"def",
"read",
"(",
"self",
",",
"size",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"_open",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'I/O operation on closed file.'",
")",
"if",
"self",
".",
"_offset",
">=",
"self",
".",
"... | A method to read and return up to size bytes.
Parameters:
size - Optional parameter to read size number of bytes; if None or
negative, all remaining bytes in the file will be read
Returns:
The number of bytes requested or the rest of the data left in the file,
... | [
"A",
"method",
"to",
"read",
"and",
"return",
"up",
"to",
"size",
"bytes",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L594-L620 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlibIO.readall | def readall(self):
# type: () -> bytes
'''
A method to read and return the remaining bytes in the file.
Parameters:
None.
Returns:
The rest of the data left in the file. If the file is at or past EOF,
returns an empty bytestring.
'''
i... | python | def readall(self):
# type: () -> bytes
'''
A method to read and return the remaining bytes in the file.
Parameters:
None.
Returns:
The rest of the data left in the file. If the file is at or past EOF,
returns an empty bytestring.
'''
i... | [
"def",
"readall",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_open",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'I/O operation on closed file.'",
")",
"readsize",
"=",
"self",
".",
"_length",
"-",
"self",
".",
"_offset",
"if",
... | A method to read and return the remaining bytes in the file.
Parameters:
None.
Returns:
The rest of the data left in the file. If the file is at or past EOF,
returns an empty bytestring. | [
"A",
"method",
"to",
"read",
"and",
"return",
"the",
"remaining",
"bytes",
"in",
"the",
"file",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L622-L643 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._parse_volume_descriptors | def _parse_volume_descriptors(self):
# type: () -> None
'''
An internal method to parse the volume descriptors on an ISO.
Parameters:
None.
Returns:
Nothing.
'''
# Ecma-119 says that the Volume Descriptor set is a sequence of volume
# de... | python | def _parse_volume_descriptors(self):
# type: () -> None
'''
An internal method to parse the volume descriptors on an ISO.
Parameters:
None.
Returns:
Nothing.
'''
# Ecma-119 says that the Volume Descriptor set is a sequence of volume
# de... | [
"def",
"_parse_volume_descriptors",
"(",
"self",
")",
":",
"self",
".",
"_cdfp",
".",
"seek",
"(",
"16",
"*",
"2048",
")",
"while",
"True",
":",
"curr_extent",
"=",
"self",
".",
"_cdfp",
".",
"tell",
"(",
")",
"//",
"2048",
"vd",
"=",
"self",
".",
... | An internal method to parse the volume descriptors on an ISO.
Parameters:
None.
Returns:
Nothing. | [
"An",
"internal",
"method",
"to",
"parse",
"the",
"volume",
"descriptors",
"on",
"an",
"ISO",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L838-L926 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._seek_to_extent | def _seek_to_extent(self, extent):
# type: (int) -> None
'''
An internal method to seek to a particular extent on the input ISO.
Parameters:
extent - The extent to seek to.
Returns:
Nothing.
'''
self._cdfp.seek(extent * self.pvd.logical_block_si... | python | def _seek_to_extent(self, extent):
# type: (int) -> None
'''
An internal method to seek to a particular extent on the input ISO.
Parameters:
extent - The extent to seek to.
Returns:
Nothing.
'''
self._cdfp.seek(extent * self.pvd.logical_block_si... | [
"def",
"_seek_to_extent",
"(",
"self",
",",
"extent",
")",
":",
"self",
".",
"_cdfp",
".",
"seek",
"(",
"extent",
"*",
"self",
".",
"pvd",
".",
"logical_block_size",
"(",
")",
")"
] | An internal method to seek to a particular extent on the input ISO.
Parameters:
extent - The extent to seek to.
Returns:
Nothing. | [
"An",
"internal",
"method",
"to",
"seek",
"to",
"a",
"particular",
"extent",
"on",
"the",
"input",
"ISO",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L928-L938 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._find_rr_record | def _find_rr_record(self, rr_path):
# type: (bytes) -> dr.DirectoryRecord
'''
An internal method to find an directory record on the ISO given a Rock
Ridge path. If the entry is found, it returns the directory record
object corresponding to that entry. If the entry could not be ... | python | def _find_rr_record(self, rr_path):
# type: (bytes) -> dr.DirectoryRecord
'''
An internal method to find an directory record on the ISO given a Rock
Ridge path. If the entry is found, it returns the directory record
object corresponding to that entry. If the entry could not be ... | [
"def",
"_find_rr_record",
"(",
"self",
",",
"rr_path",
")",
":",
"if",
"not",
"utils",
".",
"starts_with_slash",
"(",
"rr_path",
")",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'Must be a path starting with /'",
")",
"root_dir_record",
"=",
... | An internal method to find an directory record on the ISO given a Rock
Ridge path. If the entry is found, it returns the directory record
object corresponding to that entry. If the entry could not be found, a
pycdlibexception.PyCdlibInvalidInput is raised.
Parameters:
rr_path... | [
"An",
"internal",
"method",
"to",
"find",
"an",
"directory",
"record",
"on",
"the",
"ISO",
"given",
"a",
"Rock",
"Ridge",
"path",
".",
"If",
"the",
"entry",
"is",
"found",
"it",
"returns",
"the",
"directory",
"record",
"object",
"corresponding",
"to",
"tha... | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L957-L1032 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._find_joliet_record | def _find_joliet_record(self, joliet_path):
# type: (bytes) -> dr.DirectoryRecord
'''
An internal method to find an directory record on the ISO given a Joliet
path. If the entry is found, it returns the directory record object
corresponding to that entry. If the entry could not... | python | def _find_joliet_record(self, joliet_path):
# type: (bytes) -> dr.DirectoryRecord
'''
An internal method to find an directory record on the ISO given a Joliet
path. If the entry is found, it returns the directory record object
corresponding to that entry. If the entry could not... | [
"def",
"_find_joliet_record",
"(",
"self",
",",
"joliet_path",
")",
":",
"if",
"self",
".",
"joliet_vd",
"is",
"None",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Joliet path requested on non-Joliet ISO'",
")",
"return",
"_find_dr_record_by_nam... | An internal method to find an directory record on the ISO given a Joliet
path. If the entry is found, it returns the directory record object
corresponding to that entry. If the entry could not be found, a
pycdlibexception.PyCdlibInvalidInput is raised.
Parameters:
joliet_path... | [
"An",
"internal",
"method",
"to",
"find",
"an",
"directory",
"record",
"on",
"the",
"ISO",
"given",
"a",
"Joliet",
"path",
".",
"If",
"the",
"entry",
"is",
"found",
"it",
"returns",
"the",
"directory",
"record",
"object",
"corresponding",
"to",
"that",
"en... | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L1035-L1050 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._find_udf_record | def _find_udf_record(self, udf_path):
# type: (bytes) -> Tuple[Optional[udfmod.UDFFileIdentifierDescriptor], udfmod.UDFFileEntry]
'''
An internal method to find an directory record on the ISO given a UDF
path. If the entry is found, it returns the directory record object
corresp... | python | def _find_udf_record(self, udf_path):
# type: (bytes) -> Tuple[Optional[udfmod.UDFFileIdentifierDescriptor], udfmod.UDFFileEntry]
'''
An internal method to find an directory record on the ISO given a UDF
path. If the entry is found, it returns the directory record object
corresp... | [
"def",
"_find_udf_record",
"(",
"self",
",",
"udf_path",
")",
":",
"if",
"udf_path",
"==",
"b'/'",
":",
"return",
"None",
",",
"self",
".",
"udf_root",
"splitpath",
"=",
"utils",
".",
"split_path",
"(",
"udf_path",
")",
"currpath",
"=",
"splitpath",
".",
... | An internal method to find an directory record on the ISO given a UDF
path. If the entry is found, it returns the directory record object
corresponding to that entry. If the entry could not be found, a
pycdlibexception.PyCdlibInvalidInput is raised.
Parameters:
udf_path - The... | [
"An",
"internal",
"method",
"to",
"find",
"an",
"directory",
"record",
"on",
"the",
"ISO",
"given",
"a",
"UDF",
"path",
".",
"If",
"the",
"entry",
"is",
"found",
"it",
"returns",
"the",
"directory",
"record",
"object",
"corresponding",
"to",
"that",
"entry... | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L1053-L1091 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._iso_name_and_parent_from_path | def _iso_name_and_parent_from_path(self, iso_path):
# type: (bytes) -> Tuple[bytes, dr.DirectoryRecord]
'''
An internal method to find the parent directory record and name given an
ISO path. If the parent is found, return a tuple containing the
basename of the path and the paren... | python | def _iso_name_and_parent_from_path(self, iso_path):
# type: (bytes) -> Tuple[bytes, dr.DirectoryRecord]
'''
An internal method to find the parent directory record and name given an
ISO path. If the parent is found, return a tuple containing the
basename of the path and the paren... | [
"def",
"_iso_name_and_parent_from_path",
"(",
"self",
",",
"iso_path",
")",
":",
"splitpath",
"=",
"utils",
".",
"split_path",
"(",
"iso_path",
")",
"name",
"=",
"splitpath",
".",
"pop",
"(",
")",
"parent",
"=",
"self",
".",
"_find_iso_record",
"(",
"b'/'",
... | An internal method to find the parent directory record and name given an
ISO path. If the parent is found, return a tuple containing the
basename of the path and the parent directory record object.
Parameters:
iso_path - The absolute ISO path to the entry on the ISO.
Returns:
... | [
"An",
"internal",
"method",
"to",
"find",
"the",
"parent",
"directory",
"record",
"and",
"name",
"given",
"an",
"ISO",
"path",
".",
"If",
"the",
"parent",
"is",
"found",
"return",
"a",
"tuple",
"containing",
"the",
"basename",
"of",
"the",
"path",
"and",
... | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L1093-L1112 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._joliet_name_and_parent_from_path | def _joliet_name_and_parent_from_path(self, joliet_path):
# type: (bytes) -> Tuple[bytes, dr.DirectoryRecord]
'''
An internal method to find the parent directory record and name given a
Joliet path. If the parent is found, return a tuple containing the
basename of the path and t... | python | def _joliet_name_and_parent_from_path(self, joliet_path):
# type: (bytes) -> Tuple[bytes, dr.DirectoryRecord]
'''
An internal method to find the parent directory record and name given a
Joliet path. If the parent is found, return a tuple containing the
basename of the path and t... | [
"def",
"_joliet_name_and_parent_from_path",
"(",
"self",
",",
"joliet_path",
")",
":",
"splitpath",
"=",
"utils",
".",
"split_path",
"(",
"joliet_path",
")",
"name",
"=",
"splitpath",
".",
"pop",
"(",
")",
"if",
"len",
"(",
"name",
")",
">",
"64",
":",
"... | An internal method to find the parent directory record and name given a
Joliet path. If the parent is found, return a tuple containing the
basename of the path and the parent directory record object.
Parameters:
joliet_path - The absolute Joliet path to the entry on the ISO.
R... | [
"An",
"internal",
"method",
"to",
"find",
"the",
"parent",
"directory",
"record",
"and",
"name",
"given",
"a",
"Joliet",
"path",
".",
"If",
"the",
"parent",
"is",
"found",
"return",
"a",
"tuple",
"containing",
"the",
"basename",
"of",
"the",
"path",
"and",... | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L1114-L1135 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._udf_name_and_parent_from_path | def _udf_name_and_parent_from_path(self, udf_path):
# type: (bytes) -> Tuple[bytes, udfmod.UDFFileEntry]
'''
An internal method to find the parent directory record and name given a
UDF path. If the parent is found, return a tuple containing the basename
of the path and the paren... | python | def _udf_name_and_parent_from_path(self, udf_path):
# type: (bytes) -> Tuple[bytes, udfmod.UDFFileEntry]
'''
An internal method to find the parent directory record and name given a
UDF path. If the parent is found, return a tuple containing the basename
of the path and the paren... | [
"def",
"_udf_name_and_parent_from_path",
"(",
"self",
",",
"udf_path",
")",
":",
"splitpath",
"=",
"utils",
".",
"split_path",
"(",
"udf_path",
")",
"name",
"=",
"splitpath",
".",
"pop",
"(",
")",
"(",
"parent_ident_unused",
",",
"parent",
")",
"=",
"self",
... | An internal method to find the parent directory record and name given a
UDF path. If the parent is found, return a tuple containing the basename
of the path and the parent UDF File Entry object.
Parameters:
udf_path - The absolute UDF path to the entry on the ISO.
Returns:
... | [
"An",
"internal",
"method",
"to",
"find",
"the",
"parent",
"directory",
"record",
"and",
"name",
"given",
"a",
"UDF",
"path",
".",
"If",
"the",
"parent",
"is",
"found",
"return",
"a",
"tuple",
"containing",
"the",
"basename",
"of",
"the",
"path",
"and",
... | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L1137-L1154 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._set_rock_ridge | def _set_rock_ridge(self, rr):
# type: (str) -> None
'''
An internal method to set the Rock Ridge version of the ISO given the
Rock Ridge version of the previous entry.
Parameters:
rr - The version of rr from the last directory record.
Returns:
Nothing.... | python | def _set_rock_ridge(self, rr):
# type: (str) -> None
'''
An internal method to set the Rock Ridge version of the ISO given the
Rock Ridge version of the previous entry.
Parameters:
rr - The version of rr from the last directory record.
Returns:
Nothing.... | [
"def",
"_set_rock_ridge",
"(",
"self",
",",
"rr",
")",
":",
"if",
"not",
"self",
".",
"rock_ridge",
":",
"self",
".",
"rock_ridge",
"=",
"rr",
"else",
":",
"for",
"ver",
"in",
"[",
"'1.09'",
",",
"'1.10'",
",",
"'1.12'",
"]",
":",
"if",
"self",
"."... | An internal method to set the Rock Ridge version of the ISO given the
Rock Ridge version of the previous entry.
Parameters:
rr - The version of rr from the last directory record.
Returns:
Nothing. | [
"An",
"internal",
"method",
"to",
"set",
"the",
"Rock",
"Ridge",
"version",
"of",
"the",
"ISO",
"given",
"the",
"Rock",
"Ridge",
"version",
"of",
"the",
"previous",
"entry",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L1156-L1178 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._parse_path_table | def _parse_path_table(self, ptr_size, extent):
# type: (int, int) -> Tuple[List[path_table_record.PathTableRecord], Dict[int, path_table_record.PathTableRecord]]
'''
An internal method to parse a path table on an ISO. For each path
table entry found, a Path Table Record object is create... | python | def _parse_path_table(self, ptr_size, extent):
# type: (int, int) -> Tuple[List[path_table_record.PathTableRecord], Dict[int, path_table_record.PathTableRecord]]
'''
An internal method to parse a path table on an ISO. For each path
table entry found, a Path Table Record object is create... | [
"def",
"_parse_path_table",
"(",
"self",
",",
"ptr_size",
",",
"extent",
")",
":",
"self",
".",
"_seek_to_extent",
"(",
"extent",
")",
"data",
"=",
"self",
".",
"_cdfp",
".",
"read",
"(",
"ptr_size",
")",
"offset",
"=",
"0",
"out",
"=",
"[",
"]",
"ex... | An internal method to parse a path table on an ISO. For each path
table entry found, a Path Table Record object is created, and the
callback is called.
Parameters:
vd - The volume descriptor that these path table records correspond to.
extent - The extent at which this path t... | [
"An",
"internal",
"method",
"to",
"parse",
"a",
"path",
"table",
"on",
"an",
"ISO",
".",
"For",
"each",
"path",
"table",
"entry",
"found",
"a",
"Path",
"Table",
"Record",
"object",
"is",
"created",
"and",
"the",
"callback",
"is",
"called",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L1434-L1464 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._check_and_parse_eltorito | def _check_and_parse_eltorito(self, br):
# type: (headervd.BootRecord) -> None
'''
An internal method to examine a Boot Record and see if it is an
El Torito Boot Record. If it is, parse the El Torito Boot Catalog,
verification entry, initial entry, and any additional section ent... | python | def _check_and_parse_eltorito(self, br):
# type: (headervd.BootRecord) -> None
'''
An internal method to examine a Boot Record and see if it is an
El Torito Boot Record. If it is, parse the El Torito Boot Catalog,
verification entry, initial entry, and any additional section ent... | [
"def",
"_check_and_parse_eltorito",
"(",
"self",
",",
"br",
")",
":",
"if",
"br",
".",
"boot_system_identifier",
"!=",
"b'EL TORITO SPECIFICATION'",
".",
"ljust",
"(",
"32",
",",
"b'\\x00'",
")",
":",
"return",
"if",
"self",
".",
"eltorito_boot_catalog",
"is",
... | An internal method to examine a Boot Record and see if it is an
El Torito Boot Record. If it is, parse the El Torito Boot Catalog,
verification entry, initial entry, and any additional section entries.
Parameters:
br - The boot record to examine for an El Torito signature.
Ret... | [
"An",
"internal",
"method",
"to",
"examine",
"a",
"Boot",
"Record",
"and",
"see",
"if",
"it",
"is",
"an",
"El",
"Torito",
"Boot",
"Record",
".",
"If",
"it",
"is",
"parse",
"the",
"El",
"Torito",
"Boot",
"Catalog",
"verification",
"entry",
"initial",
"ent... | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L1466-L1502 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._remove_child_from_dr | def _remove_child_from_dr(self, child, index, logical_block_size):
# type: (dr.DirectoryRecord, int, int) -> int
'''
An internal method to remove a child from a directory record, shrinking
the space in the Volume Descriptor if necessary.
Parameters:
child - The child to... | python | def _remove_child_from_dr(self, child, index, logical_block_size):
# type: (dr.DirectoryRecord, int, int) -> int
'''
An internal method to remove a child from a directory record, shrinking
the space in the Volume Descriptor if necessary.
Parameters:
child - The child to... | [
"def",
"_remove_child_from_dr",
"(",
"self",
",",
"child",
",",
"index",
",",
"logical_block_size",
")",
":",
"if",
"child",
".",
"parent",
"is",
"None",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Trying to remove child from non-existent par... | An internal method to remove a child from a directory record, shrinking
the space in the Volume Descriptor if necessary.
Parameters:
child - The child to remove.
index - The index of the child into the parent's child array.
logical_block_size - The size of one logical block.
... | [
"An",
"internal",
"method",
"to",
"remove",
"a",
"child",
"from",
"a",
"directory",
"record",
"shrinking",
"the",
"space",
"in",
"the",
"Volume",
"Descriptor",
"if",
"necessary",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L1858-L1885 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._add_to_ptr_size | def _add_to_ptr_size(self, ptr):
# type: (path_table_record.PathTableRecord) -> int
'''
An internal method to add a PTR to a VD, adding space to the VD if
necessary.
Parameters:
ptr - The PTR to add to the vd.
Returns:
The number of additional bytes tha... | python | def _add_to_ptr_size(self, ptr):
# type: (path_table_record.PathTableRecord) -> int
'''
An internal method to add a PTR to a VD, adding space to the VD if
necessary.
Parameters:
ptr - The PTR to add to the vd.
Returns:
The number of additional bytes tha... | [
"def",
"_add_to_ptr_size",
"(",
"self",
",",
"ptr",
")",
":",
"num_bytes_to_add",
"=",
"0",
"for",
"pvd",
"in",
"self",
".",
"pvds",
":",
"if",
"pvd",
".",
"add_to_ptr_size",
"(",
"path_table_record",
".",
"PathTableRecord",
".",
"record_length",
"(",
"ptr",... | An internal method to add a PTR to a VD, adding space to the VD if
necessary.
Parameters:
ptr - The PTR to add to the vd.
Returns:
The number of additional bytes that are needed to fit the new PTR
(this may be zero). | [
"An",
"internal",
"method",
"to",
"add",
"a",
"PTR",
"to",
"a",
"VD",
"adding",
"space",
"to",
"the",
"VD",
"if",
"necessary",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L1887-L1907 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._remove_from_ptr_size | def _remove_from_ptr_size(self, ptr):
# type: (path_table_record.PathTableRecord) -> int
'''
An internal method to remove a PTR from a VD, removing space from the VD if
necessary.
Parameters:
ptr - The PTR to remove from the VD.
Returns:
The number of b... | python | def _remove_from_ptr_size(self, ptr):
# type: (path_table_record.PathTableRecord) -> int
'''
An internal method to remove a PTR from a VD, removing space from the VD if
necessary.
Parameters:
ptr - The PTR to remove from the VD.
Returns:
The number of b... | [
"def",
"_remove_from_ptr_size",
"(",
"self",
",",
"ptr",
")",
":",
"num_bytes_to_remove",
"=",
"0",
"for",
"pvd",
"in",
"self",
".",
"pvds",
":",
"if",
"pvd",
".",
"remove_from_ptr_size",
"(",
"path_table_record",
".",
"PathTableRecord",
".",
"record_length",
... | An internal method to remove a PTR from a VD, removing space from the VD if
necessary.
Parameters:
ptr - The PTR to remove from the VD.
Returns:
The number of bytes to remove from the VDs (this may be zero). | [
"An",
"internal",
"method",
"to",
"remove",
"a",
"PTR",
"from",
"a",
"VD",
"removing",
"space",
"from",
"the",
"VD",
"if",
"necessary",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L1909-L1928 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._calculate_eltorito_boot_info_table_csum | def _calculate_eltorito_boot_info_table_csum(self, data_fp, data_len):
# type: (BinaryIO, int) -> int
'''
An internal method to calculate the checksum for an El Torito Boot Info
Table. This checksum is a simple 32-bit checksum over all of the data
in the boot file, starting righ... | python | def _calculate_eltorito_boot_info_table_csum(self, data_fp, data_len):
# type: (BinaryIO, int) -> int
'''
An internal method to calculate the checksum for an El Torito Boot Info
Table. This checksum is a simple 32-bit checksum over all of the data
in the boot file, starting righ... | [
"def",
"_calculate_eltorito_boot_info_table_csum",
"(",
"self",
",",
"data_fp",
",",
"data_len",
")",
":",
"num_sectors",
"=",
"utils",
".",
"ceiling_div",
"(",
"data_len",
",",
"self",
".",
"pvd",
".",
"logical_block_size",
"(",
")",
")",
"csum",
"=",
"0",
... | An internal method to calculate the checksum for an El Torito Boot Info
Table. This checksum is a simple 32-bit checksum over all of the data
in the boot file, starting right after the Boot Info Table itself.
Parameters:
data_fp - The file object to read the input data from.
... | [
"An",
"internal",
"method",
"to",
"calculate",
"the",
"checksum",
"for",
"an",
"El",
"Torito",
"Boot",
"Info",
"Table",
".",
"This",
"checksum",
"is",
"a",
"simple",
"32",
"-",
"bit",
"checksum",
"over",
"all",
"of",
"the",
"data",
"in",
"the",
"boot",
... | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L1977-L2011 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._check_for_eltorito_boot_info_table | def _check_for_eltorito_boot_info_table(self, ino):
# type: (inode.Inode) -> None
'''
An internal method to check a boot directory record to see if it has
an El Torito Boot Info Table embedded inside of it.
Parameters:
ino - The Inode to check for a Boot Info Table.
... | python | def _check_for_eltorito_boot_info_table(self, ino):
# type: (inode.Inode) -> None
'''
An internal method to check a boot directory record to see if it has
an El Torito Boot Info Table embedded inside of it.
Parameters:
ino - The Inode to check for a Boot Info Table.
... | [
"def",
"_check_for_eltorito_boot_info_table",
"(",
"self",
",",
"ino",
")",
":",
"orig",
"=",
"self",
".",
"_cdfp",
".",
"tell",
"(",
")",
"with",
"inode",
".",
"InodeOpenData",
"(",
"ino",
",",
"self",
".",
"pvd",
".",
"logical_block_size",
"(",
")",
")... | An internal method to check a boot directory record to see if it has
an El Torito Boot Info Table embedded inside of it.
Parameters:
ino - The Inode to check for a Boot Info Table.
Returns:
Nothing. | [
"An",
"internal",
"method",
"to",
"check",
"a",
"boot",
"directory",
"record",
"to",
"see",
"if",
"it",
"has",
"an",
"El",
"Torito",
"Boot",
"Info",
"Table",
"embedded",
"inside",
"of",
"it",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L2013-L2037 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._check_rr_name | def _check_rr_name(self, rr_name):
# type: (Optional[str]) -> bytes
'''
An internal method to check whether this ISO requires or does not
require a Rock Ridge path.
Parameters:
rr_name - The Rock Ridge name.
Returns:
The Rock Ridge name in bytes if this... | python | def _check_rr_name(self, rr_name):
# type: (Optional[str]) -> bytes
'''
An internal method to check whether this ISO requires or does not
require a Rock Ridge path.
Parameters:
rr_name - The Rock Ridge name.
Returns:
The Rock Ridge name in bytes if this... | [
"def",
"_check_rr_name",
"(",
"self",
",",
"rr_name",
")",
":",
"if",
"self",
".",
"rock_ridge",
":",
"if",
"not",
"rr_name",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'A rock ridge name must be passed for a rock-ridge ISO'",
")",
"if",
"rr... | An internal method to check whether this ISO requires or does not
require a Rock Ridge path.
Parameters:
rr_name - The Rock Ridge name.
Returns:
The Rock Ridge name in bytes if this is a Rock Ridge ISO, None otherwise. | [
"An",
"internal",
"method",
"to",
"check",
"whether",
"this",
"ISO",
"requires",
"or",
"does",
"not",
"require",
"a",
"Rock",
"Ridge",
"path",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L2039-L2062 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._normalize_joliet_path | def _normalize_joliet_path(self, joliet_path):
# type: (str) -> bytes
'''
An internal method to check whether this ISO does or does not require
a Joliet path. If a Joliet path is required, the path is normalized
and returned.
Parameters:
joliet_path - The jolie... | python | def _normalize_joliet_path(self, joliet_path):
# type: (str) -> bytes
'''
An internal method to check whether this ISO does or does not require
a Joliet path. If a Joliet path is required, the path is normalized
and returned.
Parameters:
joliet_path - The jolie... | [
"def",
"_normalize_joliet_path",
"(",
"self",
",",
"joliet_path",
")",
":",
"tmp_path",
"=",
"b''",
"if",
"self",
".",
"joliet_vd",
"is",
"not",
"None",
":",
"if",
"not",
"joliet_path",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'A Jol... | An internal method to check whether this ISO does or does not require
a Joliet path. If a Joliet path is required, the path is normalized
and returned.
Parameters:
joliet_path - The joliet_path to normalize (if necessary).
Returns:
The normalized joliet_path if this I... | [
"An",
"internal",
"method",
"to",
"check",
"whether",
"this",
"ISO",
"does",
"or",
"does",
"not",
"require",
"a",
"Joliet",
"path",
".",
"If",
"a",
"Joliet",
"path",
"is",
"required",
"the",
"path",
"is",
"normalized",
"and",
"returned",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L2064-L2085 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._link_eltorito | def _link_eltorito(self, extent_to_inode):
# type: (Dict[int, inode.Inode]) -> None
'''
An internal method to link the El Torito entries into their
corresponding Directory Records, creating new ones if they are
'hidden'. Should only be called on an El Torito ISO.
Parame... | python | def _link_eltorito(self, extent_to_inode):
# type: (Dict[int, inode.Inode]) -> None
'''
An internal method to link the El Torito entries into their
corresponding Directory Records, creating new ones if they are
'hidden'. Should only be called on an El Torito ISO.
Parame... | [
"def",
"_link_eltorito",
"(",
"self",
",",
"extent_to_inode",
")",
":",
"if",
"self",
".",
"eltorito_boot_catalog",
"is",
"None",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Trying to link El Torito entries on a non-El Torito ISO'",
")",
"log_blo... | An internal method to link the El Torito entries into their
corresponding Directory Records, creating new ones if they are
'hidden'. Should only be called on an El Torito ISO.
Parameters:
extent_to_inode - The map that maps extents to Inodes.
Returns:
Nothing. | [
"An",
"internal",
"method",
"to",
"link",
"the",
"El",
"Torito",
"entries",
"into",
"their",
"corresponding",
"Directory",
"Records",
"creating",
"new",
"ones",
"if",
"they",
"are",
"hidden",
".",
"Should",
"only",
"be",
"called",
"on",
"an",
"El",
"Torito",... | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L2087-L2121 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._parse_udf_vol_descs | def _parse_udf_vol_descs(self, extent, length, descs):
# type: (int, int, PyCdlib._UDFDescriptors) -> None
'''
An internal method to parse a set of UDF Volume Descriptors.
Parameters:
extent - The extent at which to start parsing.
length - The number of bytes to read f... | python | def _parse_udf_vol_descs(self, extent, length, descs):
# type: (int, int, PyCdlib._UDFDescriptors) -> None
'''
An internal method to parse a set of UDF Volume Descriptors.
Parameters:
extent - The extent at which to start parsing.
length - The number of bytes to read f... | [
"def",
"_parse_udf_vol_descs",
"(",
"self",
",",
"extent",
",",
"length",
",",
"descs",
")",
":",
"self",
".",
"_seek_to_extent",
"(",
"extent",
")",
"vd_data",
"=",
"self",
".",
"_cdfp",
".",
"read",
"(",
"length",
")",
"block_size",
"=",
"self",
".",
... | An internal method to parse a set of UDF Volume Descriptors.
Parameters:
extent - The extent at which to start parsing.
length - The number of bytes to read from the incoming ISO.
descs - The _UDFDescriptors object to store parsed objects into.
Returns:
Nothing. | [
"An",
"internal",
"method",
"to",
"parse",
"a",
"set",
"of",
"UDF",
"Volume",
"Descriptors",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L2123-L2169 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._parse_udf_descriptors | def _parse_udf_descriptors(self):
# type: () -> None
'''
An internal method to parse the UDF descriptors on the ISO. This should
only be called if it the ISO has a valid UDF Volume Recognition Sequence
at the beginning of the ISO.
Parameters:
None.
Retu... | python | def _parse_udf_descriptors(self):
# type: () -> None
'''
An internal method to parse the UDF descriptors on the ISO. This should
only be called if it the ISO has a valid UDF Volume Recognition Sequence
at the beginning of the ISO.
Parameters:
None.
Retu... | [
"def",
"_parse_udf_descriptors",
"(",
"self",
")",
":",
"block_size",
"=",
"self",
".",
"pvd",
".",
"logical_block_size",
"(",
")",
"anchor_locations",
"=",
"[",
"(",
"256",
"*",
"block_size",
",",
"os",
".",
"SEEK_SET",
")",
",",
"(",
"-",
"2048",
",",
... | An internal method to parse the UDF descriptors on the ISO. This should
only be called if it the ISO has a valid UDF Volume Recognition Sequence
at the beginning of the ISO.
Parameters:
None.
Returns:
Nothing. | [
"An",
"internal",
"method",
"to",
"parse",
"the",
"UDF",
"descriptors",
"on",
"the",
"ISO",
".",
"This",
"should",
"only",
"be",
"called",
"if",
"it",
"the",
"ISO",
"has",
"a",
"valid",
"UDF",
"Volume",
"Recognition",
"Sequence",
"at",
"the",
"beginning",
... | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L2171-L2248 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._parse_udf_file_entry | def _parse_udf_file_entry(self, abs_file_entry_extent, icb, parent):
# type: (int, udfmod.UDFLongAD, Optional[udfmod.UDFFileEntry]) -> Optional[udfmod.UDFFileEntry]
'''
An internal method to parse a single UDF File Entry and return the
corresponding object.
Parameters:
... | python | def _parse_udf_file_entry(self, abs_file_entry_extent, icb, parent):
# type: (int, udfmod.UDFLongAD, Optional[udfmod.UDFFileEntry]) -> Optional[udfmod.UDFFileEntry]
'''
An internal method to parse a single UDF File Entry and return the
corresponding object.
Parameters:
... | [
"def",
"_parse_udf_file_entry",
"(",
"self",
",",
"abs_file_entry_extent",
",",
"icb",
",",
"parent",
")",
":",
"self",
".",
"_seek_to_extent",
"(",
"abs_file_entry_extent",
")",
"icbdata",
"=",
"self",
".",
"_cdfp",
".",
"read",
"(",
"icb",
".",
"extent_lengt... | An internal method to parse a single UDF File Entry and return the
corresponding object.
Parameters:
part_start - The extent number the partition starts at.
icb - The ICB object for the data.
parent - The parent of the UDF File Entry.
Returns:
A UDF File Entr... | [
"An",
"internal",
"method",
"to",
"parse",
"a",
"single",
"UDF",
"File",
"Entry",
"and",
"return",
"the",
"corresponding",
"object",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L2250-L2281 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._walk_udf_directories | def _walk_udf_directories(self, extent_to_inode):
# type: (Dict[int, inode.Inode]) -> None
'''
An internal method to walk a UDF filesystem and add all the metadata
to this object.
Parameters:
extent_to_inode - A map from extent numbers to Inodes.
Returns:
... | python | def _walk_udf_directories(self, extent_to_inode):
# type: (Dict[int, inode.Inode]) -> None
'''
An internal method to walk a UDF filesystem and add all the metadata
to this object.
Parameters:
extent_to_inode - A map from extent numbers to Inodes.
Returns:
... | [
"def",
"_walk_udf_directories",
"(",
"self",
",",
"extent_to_inode",
")",
":",
"part_start",
"=",
"self",
".",
"udf_main_descs",
".",
"partition",
".",
"part_start_location",
"self",
".",
"udf_root",
"=",
"self",
".",
"_parse_udf_file_entry",
"(",
"part_start",
"+... | An internal method to walk a UDF filesystem and add all the metadata
to this object.
Parameters:
extent_to_inode - A map from extent numbers to Inodes.
Returns:
Nothing. | [
"An",
"internal",
"method",
"to",
"walk",
"a",
"UDF",
"filesystem",
"and",
"add",
"all",
"the",
"metadata",
"to",
"this",
"object",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L2283-L2373 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._udf_get_file_from_iso_fp | def _udf_get_file_from_iso_fp(self, outfp, blocksize, udf_path):
# type: (BinaryIO, int, bytes) -> None
'''
An internal method to fetch a single UDF file from the ISO and write it
out to the file object.
Parameters:
outfp - The file object to write data to.
blo... | python | def _udf_get_file_from_iso_fp(self, outfp, blocksize, udf_path):
# type: (BinaryIO, int, bytes) -> None
'''
An internal method to fetch a single UDF file from the ISO and write it
out to the file object.
Parameters:
outfp - The file object to write data to.
blo... | [
"def",
"_udf_get_file_from_iso_fp",
"(",
"self",
",",
"outfp",
",",
"blocksize",
",",
"udf_path",
")",
":",
"if",
"self",
".",
"udf_root",
"is",
"None",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'Cannot fetch a udf_path from a non-UDF ISO'",
... | An internal method to fetch a single UDF file from the ISO and write it
out to the file object.
Parameters:
outfp - The file object to write data to.
blocksize - The number of bytes in each transfer.
udf_path - The absolute UDF path to lookup on the ISO.
Returns:
... | [
"An",
"internal",
"method",
"to",
"fetch",
"a",
"single",
"UDF",
"file",
"from",
"the",
"ISO",
"and",
"write",
"it",
"out",
"to",
"the",
"file",
"object",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L2557-L2585 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._outfp_write_with_check | def _outfp_write_with_check(self, outfp, data, enable_overwrite_check=True):
# type: (BinaryIO, bytes, bool) -> None
'''
Internal method to write data out to the output file descriptor,
ensuring that it doesn't go beyond the bounds of the ISO.
Parameters:
outfp - The fi... | python | def _outfp_write_with_check(self, outfp, data, enable_overwrite_check=True):
# type: (BinaryIO, bytes, bool) -> None
'''
Internal method to write data out to the output file descriptor,
ensuring that it doesn't go beyond the bounds of the ISO.
Parameters:
outfp - The fi... | [
"def",
"_outfp_write_with_check",
"(",
"self",
",",
"outfp",
",",
"data",
",",
"enable_overwrite_check",
"=",
"True",
")",
":",
"start",
"=",
"outfp",
".",
"tell",
"(",
")",
"outfp",
".",
"write",
"(",
"data",
")",
"if",
"self",
".",
"_track_writes",
":"... | Internal method to write data out to the output file descriptor,
ensuring that it doesn't go beyond the bounds of the ISO.
Parameters:
outfp - The file object to write to.
data - The actual data to write.
enable_overwrite_check - Whether to do overwrite checking if it is enab... | [
"Internal",
"method",
"to",
"write",
"data",
"out",
"to",
"the",
"output",
"file",
"descriptor",
"ensuring",
"that",
"it",
"doesn",
"t",
"go",
"beyond",
"the",
"bounds",
"of",
"the",
"ISO",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L2686-L2709 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._output_file_data | def _output_file_data(self, outfp, blocksize, ino):
# type: (BinaryIO, int, inode.Inode) -> int
'''
Internal method to write a directory record entry out.
Parameters:
outfp - The file object to write the data to.
blocksize - The blocksize to use when writing the data o... | python | def _output_file_data(self, outfp, blocksize, ino):
# type: (BinaryIO, int, inode.Inode) -> int
'''
Internal method to write a directory record entry out.
Parameters:
outfp - The file object to write the data to.
blocksize - The blocksize to use when writing the data o... | [
"def",
"_output_file_data",
"(",
"self",
",",
"outfp",
",",
"blocksize",
",",
"ino",
")",
":",
"log_block_size",
"=",
"self",
".",
"pvd",
".",
"logical_block_size",
"(",
")",
"outfp",
".",
"seek",
"(",
"ino",
".",
"extent_location",
"(",
")",
"*",
"log_b... | Internal method to write a directory record entry out.
Parameters:
outfp - The file object to write the data to.
blocksize - The blocksize to use when writing the data out.
ino - The Inode to write.
Returns:
The total number of bytes written out. | [
"Internal",
"method",
"to",
"write",
"a",
"directory",
"record",
"entry",
"out",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L2711-L2744 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._write_directory_records | def _write_directory_records(self, vd, outfp, progress):
# type: (headervd.PrimaryOrSupplementaryVD, BinaryIO, PyCdlib._Progress) -> None
'''
An internal method to write out the directory records from a particular
Volume Descriptor.
Parameters:
vd - The Volume Descripto... | python | def _write_directory_records(self, vd, outfp, progress):
# type: (headervd.PrimaryOrSupplementaryVD, BinaryIO, PyCdlib._Progress) -> None
'''
An internal method to write out the directory records from a particular
Volume Descriptor.
Parameters:
vd - The Volume Descripto... | [
"def",
"_write_directory_records",
"(",
"self",
",",
"vd",
",",
"outfp",
",",
"progress",
")",
":",
"log_block_size",
"=",
"vd",
".",
"logical_block_size",
"(",
")",
"le_ptr_offset",
"=",
"0",
"be_ptr_offset",
"=",
"0",
"dirs",
"=",
"collections",
".",
"dequ... | An internal method to write out the directory records from a particular
Volume Descriptor.
Parameters:
vd - The Volume Descriptor to write the Directory Records from.
outfp - The file object to write data to.
progress - The _Progress object to use for outputting progress.
... | [
"An",
"internal",
"method",
"to",
"write",
"out",
"the",
"directory",
"records",
"from",
"a",
"particular",
"Volume",
"Descriptor",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L2784-L2850 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._write_udf_descs | def _write_udf_descs(self, descs, outfp, progress):
# type: (PyCdlib._UDFDescriptors, BinaryIO, PyCdlib._Progress) -> None
'''
An internal method to write out a UDF Descriptor sequence.
Parameters:
descs - The UDF Descriptors object to write out.
outfp - The output fil... | python | def _write_udf_descs(self, descs, outfp, progress):
# type: (PyCdlib._UDFDescriptors, BinaryIO, PyCdlib._Progress) -> None
'''
An internal method to write out a UDF Descriptor sequence.
Parameters:
descs - The UDF Descriptors object to write out.
outfp - The output fil... | [
"def",
"_write_udf_descs",
"(",
"self",
",",
"descs",
",",
"outfp",
",",
"progress",
")",
":",
"log_block_size",
"=",
"self",
".",
"pvd",
".",
"logical_block_size",
"(",
")",
"outfp",
".",
"seek",
"(",
"descs",
".",
"pvd",
".",
"extent_location",
"(",
")... | An internal method to write out a UDF Descriptor sequence.
Parameters:
descs - The UDF Descriptors object to write out.
outfp - The output file descriptor to use for writing.
progress - The _Progress object to use for updating progress.
Returns:
Nothing. | [
"An",
"internal",
"method",
"to",
"write",
"out",
"a",
"UDF",
"Descriptor",
"sequence",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L2852-L2894 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._update_rr_ce_entry | def _update_rr_ce_entry(self, rec):
# type: (dr.DirectoryRecord) -> int
'''
An internal method to update the Rock Ridge CE entry for the given
record.
Parameters:
rec - The record to update the Rock Ridge CE entry for (if it exists).
Returns:
The number... | python | def _update_rr_ce_entry(self, rec):
# type: (dr.DirectoryRecord) -> int
'''
An internal method to update the Rock Ridge CE entry for the given
record.
Parameters:
rec - The record to update the Rock Ridge CE entry for (if it exists).
Returns:
The number... | [
"def",
"_update_rr_ce_entry",
"(",
"self",
",",
"rec",
")",
":",
"if",
"rec",
".",
"rock_ridge",
"is",
"not",
"None",
"and",
"rec",
".",
"rock_ridge",
".",
"dr_entries",
".",
"ce_record",
"is",
"not",
"None",
":",
"celen",
"=",
"rec",
".",
"rock_ridge",
... | An internal method to update the Rock Ridge CE entry for the given
record.
Parameters:
rec - The record to update the Rock Ridge CE entry for (if it exists).
Returns:
The number of additional bytes needed for this Rock Ridge CE entry. | [
"An",
"internal",
"method",
"to",
"update",
"the",
"Rock",
"Ridge",
"CE",
"entry",
"for",
"the",
"given",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L3096-L3115 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._finish_add | def _finish_add(self, num_bytes_to_add, num_partition_bytes_to_add):
# type: (int, int) -> None
'''
An internal method to do all of the accounting needed whenever
something is added to the ISO. This method should only be called by
public API implementations.
Parameters:... | python | def _finish_add(self, num_bytes_to_add, num_partition_bytes_to_add):
# type: (int, int) -> None
'''
An internal method to do all of the accounting needed whenever
something is added to the ISO. This method should only be called by
public API implementations.
Parameters:... | [
"def",
"_finish_add",
"(",
"self",
",",
"num_bytes_to_add",
",",
"num_partition_bytes_to_add",
")",
":",
"for",
"pvd",
"in",
"self",
".",
"pvds",
":",
"pvd",
".",
"add_to_space_size",
"(",
"num_bytes_to_add",
"+",
"num_partition_bytes_to_add",
")",
"if",
"self",
... | An internal method to do all of the accounting needed whenever
something is added to the ISO. This method should only be called by
public API implementations.
Parameters:
num_bytes_to_add - The number of additional bytes to add to all
descriptors.
... | [
"An",
"internal",
"method",
"to",
"do",
"all",
"of",
"the",
"accounting",
"needed",
"whenever",
"something",
"is",
"added",
"to",
"the",
"ISO",
".",
"This",
"method",
"should",
"only",
"be",
"called",
"by",
"public",
"API",
"implementations",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L3117-L3151 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._finish_remove | def _finish_remove(self, num_bytes_to_remove, is_partition):
# type: (int, bool) -> None
'''
An internal method to do all of the accounting needed whenever
something is removed from the ISO. This method should only be called
by public API implementations.
Parameters:
... | python | def _finish_remove(self, num_bytes_to_remove, is_partition):
# type: (int, bool) -> None
'''
An internal method to do all of the accounting needed whenever
something is removed from the ISO. This method should only be called
by public API implementations.
Parameters:
... | [
"def",
"_finish_remove",
"(",
"self",
",",
"num_bytes_to_remove",
",",
"is_partition",
")",
":",
"for",
"pvd",
"in",
"self",
".",
"pvds",
":",
"pvd",
".",
"remove_from_space_size",
"(",
"num_bytes_to_remove",
")",
"if",
"self",
".",
"joliet_vd",
"is",
"not",
... | An internal method to do all of the accounting needed whenever
something is removed from the ISO. This method should only be called
by public API implementations.
Parameters:
num_bytes_to_remove - The number of additional bytes to remove from the descriptors.
is_partition - W... | [
"An",
"internal",
"method",
"to",
"do",
"all",
"of",
"the",
"accounting",
"needed",
"whenever",
"something",
"is",
"removed",
"from",
"the",
"ISO",
".",
"This",
"method",
"should",
"only",
"be",
"called",
"by",
"public",
"API",
"implementations",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L3153-L3185 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._rm_dr_link | def _rm_dr_link(self, rec):
# type: (dr.DirectoryRecord) -> int
'''
An internal method to remove a Directory Record link given the record.
Parameters:
rec - The Directory Record to remove.
Returns:
The number of bytes to remove from the ISO.
'''
... | python | def _rm_dr_link(self, rec):
# type: (dr.DirectoryRecord) -> int
'''
An internal method to remove a Directory Record link given the record.
Parameters:
rec - The Directory Record to remove.
Returns:
The number of bytes to remove from the ISO.
'''
... | [
"def",
"_rm_dr_link",
"(",
"self",
",",
"rec",
")",
":",
"if",
"not",
"rec",
".",
"is_file",
"(",
")",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'Cannot remove a directory with rm_hard_link (try rm_directory instead)'",
")",
"num_bytes_to_remov... | An internal method to remove a Directory Record link given the record.
Parameters:
rec - The Directory Record to remove.
Returns:
The number of bytes to remove from the ISO. | [
"An",
"internal",
"method",
"to",
"remove",
"a",
"Directory",
"Record",
"link",
"given",
"the",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L3435-L3490 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._rm_udf_file_ident | def _rm_udf_file_ident(self, parent, fi):
# type: (udfmod.UDFFileEntry, bytes) -> int
'''
An internal method to remove a UDF File Identifier from the parent
and remove any space from the Logical Volume as necessary.
Parameters:
parent - The parent entry to remove the UD... | python | def _rm_udf_file_ident(self, parent, fi):
# type: (udfmod.UDFFileEntry, bytes) -> int
'''
An internal method to remove a UDF File Identifier from the parent
and remove any space from the Logical Volume as necessary.
Parameters:
parent - The parent entry to remove the UD... | [
"def",
"_rm_udf_file_ident",
"(",
"self",
",",
"parent",
",",
"fi",
")",
":",
"logical_block_size",
"=",
"self",
".",
"pvd",
".",
"logical_block_size",
"(",
")",
"num_extents_to_remove",
"=",
"parent",
".",
"remove_file_ident_desc_by_name",
"(",
"fi",
",",
"logi... | An internal method to remove a UDF File Identifier from the parent
and remove any space from the Logical Volume as necessary.
Parameters:
parent - The parent entry to remove the UDF File Identifier from.
fi - The file identifier to remove.
Returns:
The number of bytes... | [
"An",
"internal",
"method",
"to",
"remove",
"a",
"UDF",
"File",
"Identifier",
"from",
"the",
"parent",
"and",
"remove",
"any",
"space",
"from",
"the",
"Logical",
"Volume",
"as",
"necessary",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L3492-L3511 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._rm_udf_link | def _rm_udf_link(self, rec):
# type: (udfmod.UDFFileEntry) -> int
'''
An internal method to remove a UDF File Entry link.
Parameters:
rec - The UDF File Entry to remove.
Returns:
The number of bytes to remove from the ISO.
'''
if not rec.is_file... | python | def _rm_udf_link(self, rec):
# type: (udfmod.UDFFileEntry) -> int
'''
An internal method to remove a UDF File Entry link.
Parameters:
rec - The UDF File Entry to remove.
Returns:
The number of bytes to remove from the ISO.
'''
if not rec.is_file... | [
"def",
"_rm_udf_link",
"(",
"self",
",",
"rec",
")",
":",
"if",
"not",
"rec",
".",
"is_file",
"(",
")",
"and",
"not",
"rec",
".",
"is_symlink",
"(",
")",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'Cannot remove a directory with rm_har... | An internal method to remove a UDF File Entry link.
Parameters:
rec - The UDF File Entry to remove.
Returns:
The number of bytes to remove from the ISO. | [
"An",
"internal",
"method",
"to",
"remove",
"a",
"UDF",
"File",
"Entry",
"link",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L3513-L3578 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._add_joliet_dir | def _add_joliet_dir(self, joliet_path):
# type: (bytes) -> int
'''
An internal method to add a joliet directory to the ISO.
Parameters:
joliet_path - The path to add to the Joliet portion of the ISO.
Returns:
The number of additional bytes needed on the ISO to ... | python | def _add_joliet_dir(self, joliet_path):
# type: (bytes) -> int
'''
An internal method to add a joliet directory to the ISO.
Parameters:
joliet_path - The path to add to the Joliet portion of the ISO.
Returns:
The number of additional bytes needed on the ISO to ... | [
"def",
"_add_joliet_dir",
"(",
"self",
",",
"joliet_path",
")",
":",
"if",
"self",
".",
"joliet_vd",
"is",
"None",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Tried to add joliet dir to non-Joliet ISO'",
")",
"(",
"joliet_name",
",",
"jolie... | An internal method to add a joliet directory to the ISO.
Parameters:
joliet_path - The path to add to the Joliet portion of the ISO.
Returns:
The number of additional bytes needed on the ISO to fit this directory. | [
"An",
"internal",
"method",
"to",
"add",
"a",
"joliet",
"directory",
"to",
"the",
"ISO",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L3580-L3617 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._rm_joliet_dir | def _rm_joliet_dir(self, joliet_path):
# type: (bytes) -> int
'''
An internal method to remove a directory from the Joliet portion of the ISO.
Parameters:
joliet_path - The Joliet directory to remove.
Returns:
The number of bytes to remove from the ISO for this... | python | def _rm_joliet_dir(self, joliet_path):
# type: (bytes) -> int
'''
An internal method to remove a directory from the Joliet portion of the ISO.
Parameters:
joliet_path - The Joliet directory to remove.
Returns:
The number of bytes to remove from the ISO for this... | [
"def",
"_rm_joliet_dir",
"(",
"self",
",",
"joliet_path",
")",
":",
"if",
"self",
".",
"joliet_vd",
"is",
"None",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Tried to remove joliet dir from non-Joliet ISO'",
")",
"log_block_size",
"=",
"self"... | An internal method to remove a directory from the Joliet portion of the ISO.
Parameters:
joliet_path - The Joliet directory to remove.
Returns:
The number of bytes to remove from the ISO for this Joliet directory. | [
"An",
"internal",
"method",
"to",
"remove",
"a",
"directory",
"from",
"the",
"Joliet",
"portion",
"of",
"the",
"ISO",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L3619-L3643 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._get_entry | def _get_entry(self, iso_path, rr_path, joliet_path):
# type: (Optional[bytes], Optional[bytes], Optional[bytes]) -> dr.DirectoryRecord
'''
Internal method to get the directory record for a particular path.
Parameters:
iso_path - The path on the ISO filesystem to look up the re... | python | def _get_entry(self, iso_path, rr_path, joliet_path):
# type: (Optional[bytes], Optional[bytes], Optional[bytes]) -> dr.DirectoryRecord
'''
Internal method to get the directory record for a particular path.
Parameters:
iso_path - The path on the ISO filesystem to look up the re... | [
"def",
"_get_entry",
"(",
"self",
",",
"iso_path",
",",
"rr_path",
",",
"joliet_path",
")",
":",
"if",
"self",
".",
"_needs_reshuffle",
":",
"self",
".",
"_reshuffle_extents",
"(",
")",
"rec",
"=",
"None",
"if",
"joliet_path",
"is",
"not",
"None",
":",
"... | Internal method to get the directory record for a particular path.
Parameters:
iso_path - The path on the ISO filesystem to look up the record for.
rr_path - The Rock Ridge path on the ISO filesystem to look up the
record for.
joliet_path - The path on the Joliet f... | [
"Internal",
"method",
"to",
"get",
"the",
"directory",
"record",
"for",
"a",
"particular",
"path",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L3645-L3673 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._get_udf_entry | def _get_udf_entry(self, udf_path):
# type: (str) -> udfmod.UDFFileEntry
'''
Internal method to get the UDF File Entry for a particular path.
Parameters:
udf_path - The path on the UDF filesystem to look up the record for.
Returns:
A udfmod.UDFFileEntry object ... | python | def _get_udf_entry(self, udf_path):
# type: (str) -> udfmod.UDFFileEntry
'''
Internal method to get the UDF File Entry for a particular path.
Parameters:
udf_path - The path on the UDF filesystem to look up the record for.
Returns:
A udfmod.UDFFileEntry object ... | [
"def",
"_get_udf_entry",
"(",
"self",
",",
"udf_path",
")",
":",
"if",
"self",
".",
"_needs_reshuffle",
":",
"self",
".",
"_reshuffle_extents",
"(",
")",
"(",
"ident_unused",
",",
"rec",
")",
"=",
"self",
".",
"_find_udf_record",
"(",
"utils",
".",
"normpa... | Internal method to get the UDF File Entry for a particular path.
Parameters:
udf_path - The path on the UDF filesystem to look up the record for.
Returns:
A udfmod.UDFFileEntry object representing the path. | [
"Internal",
"method",
"to",
"get",
"the",
"UDF",
"File",
"Entry",
"for",
"a",
"particular",
"path",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L3675-L3692 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._create_dot | def _create_dot(self, vd, parent, rock_ridge, xa, file_mode):
# type: (headervd.PrimaryOrSupplementaryVD, dr.DirectoryRecord, str, bool, int) -> None
'''
An internal method to create a new 'dot' Directory Record.
Parameters:
vd - The volume descriptor to attach the 'dot' Direct... | python | def _create_dot(self, vd, parent, rock_ridge, xa, file_mode):
# type: (headervd.PrimaryOrSupplementaryVD, dr.DirectoryRecord, str, bool, int) -> None
'''
An internal method to create a new 'dot' Directory Record.
Parameters:
vd - The volume descriptor to attach the 'dot' Direct... | [
"def",
"_create_dot",
"(",
"self",
",",
"vd",
",",
"parent",
",",
"rock_ridge",
",",
"xa",
",",
"file_mode",
")",
":",
"dot",
"=",
"dr",
".",
"DirectoryRecord",
"(",
")",
"dot",
".",
"new_dot",
"(",
"vd",
",",
"parent",
",",
"vd",
".",
"sequence_numb... | An internal method to create a new 'dot' Directory Record.
Parameters:
vd - The volume descriptor to attach the 'dot' Directory Record to.
parent - The parent Directory Record for new Directory Record.
rock_ridge - The Rock Ridge version to use for this entry (if any).
xa - ... | [
"An",
"internal",
"method",
"to",
"create",
"a",
"new",
"dot",
"Directory",
"Record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L3694-L3711 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib._create_dotdot | def _create_dotdot(self, vd, parent, rock_ridge, relocated, xa, file_mode):
# type: (headervd.PrimaryOrSupplementaryVD, dr.DirectoryRecord, str, bool, bool, int) -> dr.DirectoryRecord
'''
An internal method to create a new 'dotdot' Directory Record.
Parameters:
vd - The volume ... | python | def _create_dotdot(self, vd, parent, rock_ridge, relocated, xa, file_mode):
# type: (headervd.PrimaryOrSupplementaryVD, dr.DirectoryRecord, str, bool, bool, int) -> dr.DirectoryRecord
'''
An internal method to create a new 'dotdot' Directory Record.
Parameters:
vd - The volume ... | [
"def",
"_create_dotdot",
"(",
"self",
",",
"vd",
",",
"parent",
",",
"rock_ridge",
",",
"relocated",
",",
"xa",
",",
"file_mode",
")",
":",
"dotdot",
"=",
"dr",
".",
"DirectoryRecord",
"(",
")",
"dotdot",
".",
"new_dotdot",
"(",
"vd",
",",
"parent",
",... | An internal method to create a new 'dotdot' Directory Record.
Parameters:
vd - The volume descriptor to attach the 'dotdot' Directory Record to.
parent - The parent Directory Record for new Directory Record.
rock_ridge - The Rock Ridge version to use for this entry (if any).
... | [
"An",
"internal",
"method",
"to",
"create",
"a",
"new",
"dotdot",
"Directory",
"Record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L3713-L3732 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib.open | def open(self, filename):
# type: (str) -> None
'''
Open up an existing ISO for inspection and modification.
Parameters:
filename - The filename containing the ISO to open up.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlib... | python | def open(self, filename):
# type: (str) -> None
'''
Open up an existing ISO for inspection and modification.
Parameters:
filename - The filename containing the ISO to open up.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlib... | [
"def",
"open",
"(",
"self",
",",
"filename",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'This object already has an ISO; either close it or create a new object'",
")",
"fp",
"=",
"open",
"(",
"filen... | Open up an existing ISO for inspection and modification.
Parameters:
filename - The filename containing the ISO to open up.
Returns:
Nothing. | [
"Open",
"up",
"an",
"existing",
"ISO",
"for",
"inspection",
"and",
"modification",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L4025-L4044 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib.open_fp | def open_fp(self, fp):
# type: (BinaryIO) -> None
'''
Open up an existing ISO for inspection and modification. Note that the
file object passed in here must stay open for the lifetime of this
object, as the PyCdlib class uses it internally to do writing and reading
opera... | python | def open_fp(self, fp):
# type: (BinaryIO) -> None
'''
Open up an existing ISO for inspection and modification. Note that the
file object passed in here must stay open for the lifetime of this
object, as the PyCdlib class uses it internally to do writing and reading
opera... | [
"def",
"open_fp",
"(",
"self",
",",
"fp",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'This object already has an ISO; either close it or create a new object'",
")",
"self",
".",
"_open_fp",
"(",
"fp... | Open up an existing ISO for inspection and modification. Note that the
file object passed in here must stay open for the lifetime of this
object, as the PyCdlib class uses it internally to do writing and reading
operations. If you want PyCdlib to manage this for you, use 'open'
instead... | [
"Open",
"up",
"an",
"existing",
"ISO",
"for",
"inspection",
"and",
"modification",
".",
"Note",
"that",
"the",
"file",
"object",
"passed",
"in",
"here",
"must",
"stay",
"open",
"for",
"the",
"lifetime",
"of",
"this",
"object",
"as",
"the",
"PyCdlib",
"clas... | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L4046-L4063 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib.get_file_from_iso | def get_file_from_iso(self, local_path, **kwargs):
# type: (str, Any) -> None
'''
A method to fetch a single file from the ISO and write it out
to a local file.
Parameters:
local_path - The local file to write to.
blocksize - The number of bytes in each transfe... | python | def get_file_from_iso(self, local_path, **kwargs):
# type: (str, Any) -> None
'''
A method to fetch a single file from the ISO and write it out
to a local file.
Parameters:
local_path - The local file to write to.
blocksize - The number of bytes in each transfe... | [
"def",
"get_file_from_iso",
"(",
"self",
",",
"local_path",
",",
"**",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'This object is not yet initialized; call either open() or new() to cre... | A method to fetch a single file from the ISO and write it out
to a local file.
Parameters:
local_path - The local file to write to.
blocksize - The number of bytes in each transfer.
iso_path - The absolute ISO9660 path to lookup on the ISO (exclusive
with ... | [
"A",
"method",
"to",
"fetch",
"a",
"single",
"file",
"from",
"the",
"ISO",
"and",
"write",
"it",
"out",
"to",
"a",
"local",
"file",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L4065-L4119 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib.get_file_from_iso_fp | def get_file_from_iso_fp(self, outfp, **kwargs):
# type: (BinaryIO, Any) -> None
'''
A method to fetch a single file from the ISO and write it out
to the file object.
Parameters:
outfp - The file object to write data to.
blocksize - The number of bytes in each ... | python | def get_file_from_iso_fp(self, outfp, **kwargs):
# type: (BinaryIO, Any) -> None
'''
A method to fetch a single file from the ISO and write it out
to the file object.
Parameters:
outfp - The file object to write data to.
blocksize - The number of bytes in each ... | [
"def",
"get_file_from_iso_fp",
"(",
"self",
",",
"outfp",
",",
"**",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'This object is not yet initialized; call either open() or new() to creat... | A method to fetch a single file from the ISO and write it out
to the file object.
Parameters:
outfp - The file object to write data to.
blocksize - The number of bytes in each transfer.
iso_path - The absolute ISO9660 path to lookup on the ISO (exclusive
w... | [
"A",
"method",
"to",
"fetch",
"a",
"single",
"file",
"from",
"the",
"ISO",
"and",
"write",
"it",
"out",
"to",
"the",
"file",
"object",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L4121-L4174 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib.write | def write(self, filename, blocksize=32768, progress_cb=None, progress_opaque=None):
# type: (str, int, Optional[Callable[[int, int, Any], None]], Optional[Any]) -> None
'''
Write a properly formatted ISO out to the filename passed in. This
also goes by the name of 'mastering'.
... | python | def write(self, filename, blocksize=32768, progress_cb=None, progress_opaque=None):
# type: (str, int, Optional[Callable[[int, int, Any], None]], Optional[Any]) -> None
'''
Write a properly formatted ISO out to the filename passed in. This
also goes by the name of 'mastering'.
... | [
"def",
"write",
"(",
"self",
",",
"filename",
",",
"blocksize",
"=",
"32768",
",",
"progress_cb",
"=",
"None",
",",
"progress_opaque",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInpu... | Write a properly formatted ISO out to the filename passed in. This
also goes by the name of 'mastering'.
Parameters:
filename - The filename to write the data to.
blocksize - The blocksize to use when copying data; set to 32768 by default.
progress_cb - If not None, a functi... | [
"Write",
"a",
"properly",
"formatted",
"ISO",
"out",
"to",
"the",
"filename",
"passed",
"in",
".",
"This",
"also",
"goes",
"by",
"the",
"name",
"of",
"mastering",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L4224-L4244 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib.add_file | def add_file(self, filename, iso_path, rr_name=None, joliet_path=None,
file_mode=None, udf_path=None):
# type: (Any, str, Optional[str], str, Optional[int], Optional[str]) -> None
'''
Add a file to the ISO. If the ISO is a Rock Ridge one, then a Rock
Ridge name must als... | python | def add_file(self, filename, iso_path, rr_name=None, joliet_path=None,
file_mode=None, udf_path=None):
# type: (Any, str, Optional[str], str, Optional[int], Optional[str]) -> None
'''
Add a file to the ISO. If the ISO is a Rock Ridge one, then a Rock
Ridge name must als... | [
"def",
"add_file",
"(",
"self",
",",
"filename",
",",
"iso_path",
",",
"rr_name",
"=",
"None",
",",
"joliet_path",
"=",
"None",
",",
"file_mode",
"=",
"None",
",",
"udf_path",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise... | Add a file to the ISO. If the ISO is a Rock Ridge one, then a Rock
Ridge name must also be provided. If the ISO is a Joliet one, then a
Joliet path may also be provided; while it is optional to do so, it is
highly recommended.
Parameters:
filename - The filename to use for th... | [
"Add",
"a",
"file",
"to",
"the",
"ISO",
".",
"If",
"the",
"ISO",
"is",
"a",
"Rock",
"Ridge",
"one",
"then",
"a",
"Rock",
"Ridge",
"name",
"must",
"also",
"be",
"provided",
".",
"If",
"the",
"ISO",
"is",
"a",
"Joliet",
"one",
"then",
"a",
"Joliet",
... | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L4303-L4331 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib.rm_file | def rm_file(self, iso_path, rr_name=None, joliet_path=None, udf_path=None): # pylint: disable=unused-argument
# type: (str, Optional[str], Optional[str], Optional[str]) -> None
'''
Remove a file from the ISO.
Parameters:
iso_path - The path to the file to remove.
rr_n... | python | def rm_file(self, iso_path, rr_name=None, joliet_path=None, udf_path=None): # pylint: disable=unused-argument
# type: (str, Optional[str], Optional[str], Optional[str]) -> None
'''
Remove a file from the ISO.
Parameters:
iso_path - The path to the file to remove.
rr_n... | [
"def",
"rm_file",
"(",
"self",
",",
"iso_path",
",",
"rr_name",
"=",
"None",
",",
"joliet_path",
"=",
"None",
",",
"udf_path",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(... | Remove a file from the ISO.
Parameters:
iso_path - The path to the file to remove.
rr_name - The Rock Ridge name of the file to remove.
joliet_path - The Joliet path to the file to remove.
udf_path - The UDF path to the file to remove.
Returns:
Nothing. | [
"Remove",
"a",
"file",
"from",
"the",
"ISO",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L4797-L4883 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib.get_record | def get_record(self, **kwargs):
# type: (str) -> Union[dr.DirectoryRecord, udfmod.UDFFileEntry]
'''
Get the directory record for a particular path.
Parameters:
iso_path - The absolute path on the ISO9660 filesystem to get the
record for.
rr_path - T... | python | def get_record(self, **kwargs):
# type: (str) -> Union[dr.DirectoryRecord, udfmod.UDFFileEntry]
'''
Get the directory record for a particular path.
Parameters:
iso_path - The absolute path on the ISO9660 filesystem to get the
record for.
rr_path - T... | [
"def",
"get_record",
"(",
"self",
",",
"**",
"kwargs",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'This object is not yet initialized; call either open() or new() to create an ISO'",
")",
"num_pa... | Get the directory record for a particular path.
Parameters:
iso_path - The absolute path on the ISO9660 filesystem to get the
record for.
rr_path - The absolute path on the Rock Ridge filesystem to get the
record for.
joliet_path - The absolute ... | [
"Get",
"the",
"directory",
"record",
"for",
"a",
"particular",
"path",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L5489-L5528 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib.full_path_from_dirrecord | def full_path_from_dirrecord(self, rec, rockridge=False):
# type: (Union[dr.DirectoryRecord, udfmod.UDFFileEntry], bool) -> str
'''
A method to get the absolute path of a directory record.
Parameters:
rec - The directory record to get the full path for.
rockridge - Whe... | python | def full_path_from_dirrecord(self, rec, rockridge=False):
# type: (Union[dr.DirectoryRecord, udfmod.UDFFileEntry], bool) -> str
'''
A method to get the absolute path of a directory record.
Parameters:
rec - The directory record to get the full path for.
rockridge - Whe... | [
"def",
"full_path_from_dirrecord",
"(",
"self",
",",
"rec",
",",
"rockridge",
"=",
"False",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'This object is not yet initialized; call either open() or... | A method to get the absolute path of a directory record.
Parameters:
rec - The directory record to get the full path for.
rockridge - Whether to get the rock ridge full path.
Returns:
A string representing the absolute path to the file on the ISO. | [
"A",
"method",
"to",
"get",
"the",
"absolute",
"path",
"of",
"a",
"directory",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L5593-L5650 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib.duplicate_pvd | def duplicate_pvd(self):
# type: () -> None
'''
A method to add a duplicate PVD to the ISO. This is a mostly useless
feature allowed by Ecma-119 to have duplicate PVDs to avoid possible
corruption.
Parameters:
None.
Returns:
Nothing.
''... | python | def duplicate_pvd(self):
# type: () -> None
'''
A method to add a duplicate PVD to the ISO. This is a mostly useless
feature allowed by Ecma-119 to have duplicate PVDs to avoid possible
corruption.
Parameters:
None.
Returns:
Nothing.
''... | [
"def",
"duplicate_pvd",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'This object is not yet initialized; call either open() or new() to create an ISO'",
")",
"pvd",
"=",
"headervd",
"... | A method to add a duplicate PVD to the ISO. This is a mostly useless
feature allowed by Ecma-119 to have duplicate PVDs to avoid possible
corruption.
Parameters:
None.
Returns:
Nothing. | [
"A",
"method",
"to",
"add",
"a",
"duplicate",
"PVD",
"to",
"the",
"ISO",
".",
"This",
"is",
"a",
"mostly",
"useless",
"feature",
"allowed",
"by",
"Ecma",
"-",
"119",
"to",
"have",
"duplicate",
"PVDs",
"to",
"avoid",
"possible",
"corruption",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L5652-L5671 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib.clear_hidden | def clear_hidden(self, iso_path=None, rr_path=None, joliet_path=None):
# type: (Optional[str], Optional[str], Optional[str]) -> None
'''
Clear the ISO9660 hidden attribute on a file or directory. This will
cause the file or directory to show up when listing entries on the ISO.
E... | python | def clear_hidden(self, iso_path=None, rr_path=None, joliet_path=None):
# type: (Optional[str], Optional[str], Optional[str]) -> None
'''
Clear the ISO9660 hidden attribute on a file or directory. This will
cause the file or directory to show up when listing entries on the ISO.
E... | [
"def",
"clear_hidden",
"(",
"self",
",",
"iso_path",
"=",
"None",
",",
"rr_path",
"=",
"None",
",",
"joliet_path",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'This obje... | Clear the ISO9660 hidden attribute on a file or directory. This will
cause the file or directory to show up when listing entries on the ISO.
Exactly one of iso_path, rr_path, or joliet_path must be specified.
Parameters:
iso_path - The path on the ISO to clear the hidden bit from.
... | [
"Clear",
"the",
"ISO9660",
"hidden",
"attribute",
"on",
"a",
"file",
"or",
"directory",
".",
"This",
"will",
"cause",
"the",
"file",
"or",
"directory",
"to",
"show",
"up",
"when",
"listing",
"entries",
"on",
"the",
"ISO",
".",
"Exactly",
"one",
"of",
"is... | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L5703-L5731 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib.set_relocated_name | def set_relocated_name(self, name, rr_name):
# type: (str, str) -> None
'''
Set the name of the relocated directory on a Rock Ridge ISO. The ISO
must be a Rock Ridge one, and must not have previously had the relocated
name set.
Parameters:
name - The name for a... | python | def set_relocated_name(self, name, rr_name):
# type: (str, str) -> None
'''
Set the name of the relocated directory on a Rock Ridge ISO. The ISO
must be a Rock Ridge one, and must not have previously had the relocated
name set.
Parameters:
name - The name for a... | [
"def",
"set_relocated_name",
"(",
"self",
",",
"name",
",",
"rr_name",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'This object is not yet initialized; call either open() or new() to create an ISO'"... | Set the name of the relocated directory on a Rock Ridge ISO. The ISO
must be a Rock Ridge one, and must not have previously had the relocated
name set.
Parameters:
name - The name for a relocated directory.
rr_name - The Rock Ridge name for a relocated directory.
Retu... | [
"Set",
"the",
"name",
"of",
"the",
"relocated",
"directory",
"on",
"a",
"Rock",
"Ridge",
"ISO",
".",
"The",
"ISO",
"must",
"be",
"a",
"Rock",
"Ridge",
"one",
"and",
"must",
"not",
"have",
"previously",
"had",
"the",
"relocated",
"name",
"set",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L5753-L5781 | train |
clalancette/pycdlib | pycdlib/pycdlib.py | PyCdlib.close | def close(self):
# type: () -> None
'''
Close the PyCdlib object, and re-initialize the object to the defaults.
The object can then be re-used for manipulation of another ISO.
Parameters:
None.
Returns:
Nothing.
'''
if not self._initiali... | python | def close(self):
# type: () -> None
'''
Close the PyCdlib object, and re-initialize the object to the defaults.
The object can then be re-used for manipulation of another ISO.
Parameters:
None.
Returns:
Nothing.
'''
if not self._initiali... | [
"def",
"close",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'This object is not yet initialized; call either open() or new() to create an ISO'",
")",
"if",
"self",
".",
"_managing_fp"... | Close the PyCdlib object, and re-initialize the object to the defaults.
The object can then be re-used for manipulation of another ISO.
Parameters:
None.
Returns:
Nothing. | [
"Close",
"the",
"PyCdlib",
"object",
"and",
"re",
"-",
"initialize",
"the",
"object",
"to",
"the",
"defaults",
".",
"The",
"object",
"can",
"then",
"be",
"re",
"-",
"used",
"for",
"manipulation",
"of",
"another",
"ISO",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L5936-L5954 | train |
sashahart/vex | vex/options.py | make_arg_parser | def make_arg_parser():
"""Return a standard ArgumentParser object.
"""
parser = argparse.ArgumentParser(
formatter_class=argparse.RawTextHelpFormatter,
usage="vex [OPTIONS] VIRTUALENV_NAME COMMAND_TO_RUN ...",
)
make = parser.add_argument_group(title='To make a new virtualenv')
... | python | def make_arg_parser():
"""Return a standard ArgumentParser object.
"""
parser = argparse.ArgumentParser(
formatter_class=argparse.RawTextHelpFormatter,
usage="vex [OPTIONS] VIRTUALENV_NAME COMMAND_TO_RUN ...",
)
make = parser.add_argument_group(title='To make a new virtualenv')
... | [
"def",
"make_arg_parser",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"formatter_class",
"=",
"argparse",
".",
"RawTextHelpFormatter",
",",
"usage",
"=",
"\"vex [OPTIONS] VIRTUALENV_NAME COMMAND_TO_RUN ...\"",
",",
")",
"make",
"=",
"parser",... | Return a standard ArgumentParser object. | [
"Return",
"a",
"standard",
"ArgumentParser",
"object",
"."
] | b7680c40897b8cbe6aae55ec9812b4fb11738192 | https://github.com/sashahart/vex/blob/b7680c40897b8cbe6aae55ec9812b4fb11738192/vex/options.py#L5-L90 | train |
sashahart/vex | vex/options.py | get_options | def get_options(argv):
"""Called to parse the given list as command-line arguments.
:returns:
an options object as returned by argparse.
"""
arg_parser = make_arg_parser()
options, unknown = arg_parser.parse_known_args(argv)
if unknown:
arg_parser.print_help()
raise exce... | python | def get_options(argv):
"""Called to parse the given list as command-line arguments.
:returns:
an options object as returned by argparse.
"""
arg_parser = make_arg_parser()
options, unknown = arg_parser.parse_known_args(argv)
if unknown:
arg_parser.print_help()
raise exce... | [
"def",
"get_options",
"(",
"argv",
")",
":",
"arg_parser",
"=",
"make_arg_parser",
"(",
")",
"options",
",",
"unknown",
"=",
"arg_parser",
".",
"parse_known_args",
"(",
"argv",
")",
"if",
"unknown",
":",
"arg_parser",
".",
"print_help",
"(",
")",
"raise",
... | Called to parse the given list as command-line arguments.
:returns:
an options object as returned by argparse. | [
"Called",
"to",
"parse",
"the",
"given",
"list",
"as",
"command",
"-",
"line",
"arguments",
"."
] | b7680c40897b8cbe6aae55ec9812b4fb11738192 | https://github.com/sashahart/vex/blob/b7680c40897b8cbe6aae55ec9812b4fb11738192/vex/options.py#L94-L107 | train |
unixsurfer/anycast_healthchecker | anycast_healthchecker/healthchecker.py | HealthChecker._update_bird_conf_file | def _update_bird_conf_file(self, operation):
"""Update BIRD configuration.
It adds to or removes IP prefix from BIRD configuration. It also
updates generation time stamp in the configuration file.
Main program will exit if configuration file cant be read/written.
Arguments:
... | python | def _update_bird_conf_file(self, operation):
"""Update BIRD configuration.
It adds to or removes IP prefix from BIRD configuration. It also
updates generation time stamp in the configuration file.
Main program will exit if configuration file cant be read/written.
Arguments:
... | [
"def",
"_update_bird_conf_file",
"(",
"self",
",",
"operation",
")",
":",
"conf_updated",
"=",
"False",
"prefixes",
"=",
"[",
"]",
"ip_version",
"=",
"operation",
".",
"ip_version",
"config_file",
"=",
"self",
".",
"bird_configuration",
"[",
"ip_version",
"]",
... | Update BIRD configuration.
It adds to or removes IP prefix from BIRD configuration. It also
updates generation time stamp in the configuration file.
Main program will exit if configuration file cant be read/written.
Arguments:
operation (obj): Either an AddOperation or Del... | [
"Update",
"BIRD",
"configuration",
"."
] | 3ab9c1d65d550eb30621ced2434252f61d1fdd33 | https://github.com/unixsurfer/anycast_healthchecker/blob/3ab9c1d65d550eb30621ced2434252f61d1fdd33/anycast_healthchecker/healthchecker.py#L78-L174 | train |
unixsurfer/anycast_healthchecker | anycast_healthchecker/healthchecker.py | HealthChecker.run | def run(self):
"""Lunch checks and triggers updates on BIRD configuration."""
# Lunch a thread for each configuration
if not self.services:
self.log.warning("no service checks are configured")
else:
self.log.info("going to lunch %s threads", len(self.services))
... | python | def run(self):
"""Lunch checks and triggers updates on BIRD configuration."""
# Lunch a thread for each configuration
if not self.services:
self.log.warning("no service checks are configured")
else:
self.log.info("going to lunch %s threads", len(self.services))
... | [
"def",
"run",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"services",
":",
"self",
".",
"log",
".",
"warning",
"(",
"\"no service checks are configured\"",
")",
"else",
":",
"self",
".",
"log",
".",
"info",
"(",
"\"going to lunch %s threads\"",
",",
"... | Lunch checks and triggers updates on BIRD configuration. | [
"Lunch",
"checks",
"and",
"triggers",
"updates",
"on",
"BIRD",
"configuration",
"."
] | 3ab9c1d65d550eb30621ced2434252f61d1fdd33 | https://github.com/unixsurfer/anycast_healthchecker/blob/3ab9c1d65d550eb30621ced2434252f61d1fdd33/anycast_healthchecker/healthchecker.py#L176-L228 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.