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/utils.py | file_object_supports_binary | def file_object_supports_binary(fp):
# type: (BinaryIO) -> bool
'''
A function to check whether a file-like object supports binary mode.
Parameters:
fp - The file-like object to check for binary mode support.
Returns:
True if the file-like object supports binary mode, False otherwise.
... | python | def file_object_supports_binary(fp):
# type: (BinaryIO) -> bool
'''
A function to check whether a file-like object supports binary mode.
Parameters:
fp - The file-like object to check for binary mode support.
Returns:
True if the file-like object supports binary mode, False otherwise.
... | [
"def",
"file_object_supports_binary",
"(",
"fp",
")",
":",
"if",
"hasattr",
"(",
"fp",
",",
"'mode'",
")",
":",
"return",
"'b'",
"in",
"fp",
".",
"mode",
"if",
"sys",
".",
"version_info",
">=",
"(",
"3",
",",
"0",
")",
":",
"return",
"isinstance",
"(... | A function to check whether a file-like object supports binary mode.
Parameters:
fp - The file-like object to check for binary mode support.
Returns:
True if the file-like object supports binary mode, False otherwise. | [
"A",
"function",
"to",
"check",
"whether",
"a",
"file",
"-",
"like",
"object",
"supports",
"binary",
"mode",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/utils.py#L304-L322 | train |
clalancette/pycdlib | pycdlib/isohybrid.py | IsoHybrid.parse | def parse(self, instr):
# type: (bytes) -> bool
'''
A method to parse ISO hybridization info out of an existing ISO.
Parameters:
instr - The data for the ISO hybridization.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexc... | python | def parse(self, instr):
# type: (bytes) -> bool
'''
A method to parse ISO hybridization info out of an existing ISO.
Parameters:
instr - The data for the ISO hybridization.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexc... | [
"def",
"parse",
"(",
"self",
",",
"instr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'This IsoHybrid object is already initialized'",
")",
"if",
"len",
"(",
"instr",
")",
"!=",
"512",
":",
... | A method to parse ISO hybridization info out of an existing ISO.
Parameters:
instr - The data for the ISO hybridization.
Returns:
Nothing. | [
"A",
"method",
"to",
"parse",
"ISO",
"hybridization",
"info",
"out",
"of",
"an",
"existing",
"ISO",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/isohybrid.py#L50-L107 | train |
clalancette/pycdlib | pycdlib/isohybrid.py | IsoHybrid.new | def new(self, mac, part_entry, mbr_id, part_offset,
geometry_sectors, geometry_heads, part_type):
# type: (bool, int, Optional[int], int, int, int, int) -> None
'''
A method to add ISO hybridization to an ISO.
Parameters:
mac - Whether this ISO should be made bootab... | python | def new(self, mac, part_entry, mbr_id, part_offset,
geometry_sectors, geometry_heads, part_type):
# type: (bool, int, Optional[int], int, int, int, int) -> None
'''
A method to add ISO hybridization to an ISO.
Parameters:
mac - Whether this ISO should be made bootab... | [
"def",
"new",
"(",
"self",
",",
"mac",
",",
"part_entry",
",",
"mbr_id",
",",
"part_offset",
",",
"geometry_sectors",
",",
"geometry_heads",
",",
"part_type",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalE... | A method to add ISO hybridization to an ISO.
Parameters:
mac - Whether this ISO should be made bootable for the Macintosh.
part_entry - The partition entry for the hybridization.
mbr_id - The mbr_id to use for the hybridization.
part_offset - The partition offset to use for ... | [
"A",
"method",
"to",
"add",
"ISO",
"hybridization",
"to",
"an",
"ISO",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/isohybrid.py#L109-L154 | train |
clalancette/pycdlib | pycdlib/isohybrid.py | IsoHybrid._calc_cc | def _calc_cc(self, iso_size):
# type: (int) -> Tuple[int, int]
'''
A method to calculate the 'cc' and the 'padding' values for this
hybridization.
Parameters:
iso_size - The size of the ISO, excluding the hybridization.
Returns:
A tuple containing the c... | python | def _calc_cc(self, iso_size):
# type: (int) -> Tuple[int, int]
'''
A method to calculate the 'cc' and the 'padding' values for this
hybridization.
Parameters:
iso_size - The size of the ISO, excluding the hybridization.
Returns:
A tuple containing the c... | [
"def",
"_calc_cc",
"(",
"self",
",",
"iso_size",
")",
":",
"cylsize",
"=",
"self",
".",
"geometry_heads",
"*",
"self",
".",
"geometry_sectors",
"*",
"512",
"frac",
"=",
"iso_size",
"%",
"cylsize",
"padding",
"=",
"0",
"if",
"frac",
">",
"0",
":",
"padd... | A method to calculate the 'cc' and the 'padding' values for this
hybridization.
Parameters:
iso_size - The size of the ISO, excluding the hybridization.
Returns:
A tuple containing the cc value and the padding. | [
"A",
"method",
"to",
"calculate",
"the",
"cc",
"and",
"the",
"padding",
"values",
"for",
"this",
"hybridization",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/isohybrid.py#L156-L176 | train |
clalancette/pycdlib | pycdlib/isohybrid.py | IsoHybrid.record | def record(self, iso_size):
# type: (int) -> bytes
'''
A method to generate a string containing the ISO hybridization.
Parameters:
iso_size - The size of the ISO, excluding the hybridization.
Returns:
A string containing the ISO hybridization.
'''
... | python | def record(self, iso_size):
# type: (int) -> bytes
'''
A method to generate a string containing the ISO hybridization.
Parameters:
iso_size - The size of the ISO, excluding the hybridization.
Returns:
A string containing the ISO hybridization.
'''
... | [
"def",
"record",
"(",
"self",
",",
"iso_size",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'This IsoHybrid object is not yet initialized'",
")",
"outlist",
"=",
"[",
"struct",
".",
"pack"... | A method to generate a string containing the ISO hybridization.
Parameters:
iso_size - The size of the ISO, excluding the hybridization.
Returns:
A string containing the ISO hybridization. | [
"A",
"method",
"to",
"generate",
"a",
"string",
"containing",
"the",
"ISO",
"hybridization",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/isohybrid.py#L178-L208 | train |
clalancette/pycdlib | pycdlib/isohybrid.py | IsoHybrid.record_padding | def record_padding(self, iso_size):
# type: (int) -> bytes
'''
A method to record padding for the ISO hybridization.
Parameters:
iso_size - The size of the ISO, excluding the hybridization.
Returns:
A string of zeros the right size to pad the ISO.
'''
... | python | def record_padding(self, iso_size):
# type: (int) -> bytes
'''
A method to record padding for the ISO hybridization.
Parameters:
iso_size - The size of the ISO, excluding the hybridization.
Returns:
A string of zeros the right size to pad the ISO.
'''
... | [
"def",
"record_padding",
"(",
"self",
",",
"iso_size",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'This IsoHybrid object is not yet initialized'",
")",
"return",
"b'\\x00'",
"*",
"self",
"... | A method to record padding for the ISO hybridization.
Parameters:
iso_size - The size of the ISO, excluding the hybridization.
Returns:
A string of zeros the right size to pad the ISO. | [
"A",
"method",
"to",
"record",
"padding",
"for",
"the",
"ISO",
"hybridization",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/isohybrid.py#L210-L223 | train |
clalancette/pycdlib | pycdlib/isohybrid.py | IsoHybrid.update_rba | def update_rba(self, current_extent):
# type: (int) -> None
'''
A method to update the current rba for the ISO hybridization.
Parameters:
current_extent - The new extent to set the RBA to.
Returns:
Nothing.
'''
if not self._initialized:
... | python | def update_rba(self, current_extent):
# type: (int) -> None
'''
A method to update the current rba for the ISO hybridization.
Parameters:
current_extent - The new extent to set the RBA to.
Returns:
Nothing.
'''
if not self._initialized:
... | [
"def",
"update_rba",
"(",
"self",
",",
"current_extent",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'This IsoHybrid object is not yet initialized'",
")",
"self",
".",
"rba",
"=",
"current_... | A method to update the current rba for the ISO hybridization.
Parameters:
current_extent - The new extent to set the RBA to.
Returns:
Nothing. | [
"A",
"method",
"to",
"update",
"the",
"current",
"rba",
"for",
"the",
"ISO",
"hybridization",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/isohybrid.py#L225-L238 | train |
clalancette/pycdlib | pycdlib/dr.py | XARecord.parse | def parse(self, xastr):
# type: (bytes) -> None
'''
Parse an Extended Attribute Record out of a string.
Parameters:
xastr - The string to parse.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalError(... | python | def parse(self, xastr):
# type: (bytes) -> None
'''
Parse an Extended Attribute Record out of a string.
Parameters:
xastr - The string to parse.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalError(... | [
"def",
"parse",
"(",
"self",
",",
"xastr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'This XARecord is already initialized!'",
")",
"(",
"self",
".",
"_group_id",
",",
"self",
".",
"_user_id... | Parse an Extended Attribute Record out of a string.
Parameters:
xastr - The string to parse.
Returns:
Nothing. | [
"Parse",
"an",
"Extended",
"Attribute",
"Record",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L54-L76 | train |
clalancette/pycdlib | pycdlib/dr.py | XARecord.new | def new(self):
# type: () -> None
'''
Create a new Extended Attribute Record.
Parameters:
None.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('This XARecord is already initialized!')
... | python | def new(self):
# type: () -> None
'''
Create a new Extended Attribute Record.
Parameters:
None.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('This XARecord is already initialized!')
... | [
"def",
"new",
"(",
"self",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'This XARecord is already initialized!'",
")",
"self",
".",
"_group_id",
"=",
"0",
"self",
".",
"_user_id",
"=",
"0",
"... | Create a new Extended Attribute Record.
Parameters:
None.
Returns:
Nothing. | [
"Create",
"a",
"new",
"Extended",
"Attribute",
"Record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L78-L96 | train |
clalancette/pycdlib | pycdlib/dr.py | XARecord.record | def record(self):
# type: () -> bytes
'''
Record this Extended Attribute Record.
Parameters:
None.
Returns:
A string representing this Extended Attribute Record.
'''
if not self._initialized:
raise pycdlibexception.PyCdlibInternalErr... | python | def record(self):
# type: () -> bytes
'''
Record this Extended Attribute Record.
Parameters:
None.
Returns:
A string representing this Extended Attribute Record.
'''
if not self._initialized:
raise pycdlibexception.PyCdlibInternalErr... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'This XARecord is not yet initialized!'",
")",
"return",
"struct",
".",
"pack",
"(",
"self",
".",
"FMT",
",",
... | Record this Extended Attribute Record.
Parameters:
None.
Returns:
A string representing this Extended Attribute Record. | [
"Record",
"this",
"Extended",
"Attribute",
"Record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L98-L112 | train |
clalancette/pycdlib | pycdlib/dr.py | DirectoryRecord._new | def _new(self, vd, name, parent, seqnum, isdir, length, xa):
# type: (headervd.PrimaryOrSupplementaryVD, bytes, Optional[DirectoryRecord], int, bool, int, bool) -> None
'''
Internal method to create a new Directory Record.
Parameters:
vd - The Volume Descriptor this record is p... | python | def _new(self, vd, name, parent, seqnum, isdir, length, xa):
# type: (headervd.PrimaryOrSupplementaryVD, bytes, Optional[DirectoryRecord], int, bool, int, bool) -> None
'''
Internal method to create a new Directory Record.
Parameters:
vd - The Volume Descriptor this record is p... | [
"def",
"_new",
"(",
"self",
",",
"vd",
",",
"name",
",",
"parent",
",",
"seqnum",
",",
"isdir",
",",
"length",
",",
"xa",
")",
":",
"self",
".",
"date",
"=",
"dates",
".",
"DirectoryRecordDate",
"(",
")",
"self",
".",
"date",
".",
"new",
"(",
")"... | Internal method to create a new Directory Record.
Parameters:
vd - The Volume Descriptor this record is part of.
name - The name for this directory record.
parent - The parent of this directory record.
seqnum - The sequence number to associate with this directory record.
... | [
"Internal",
"method",
"to",
"create",
"a",
"new",
"Directory",
"Record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L402-L487 | train |
clalancette/pycdlib | pycdlib/dr.py | DirectoryRecord.new_symlink | def new_symlink(self, vd, name, parent, rr_target, seqnum, rock_ridge,
rr_name, xa):
# type: (headervd.PrimaryOrSupplementaryVD, bytes, DirectoryRecord, bytes, int, str, bytes, bool) -> None
'''
Create a new symlink Directory Record. This implies that the new
record ... | python | def new_symlink(self, vd, name, parent, rr_target, seqnum, rock_ridge,
rr_name, xa):
# type: (headervd.PrimaryOrSupplementaryVD, bytes, DirectoryRecord, bytes, int, str, bytes, bool) -> None
'''
Create a new symlink Directory Record. This implies that the new
record ... | [
"def",
"new_symlink",
"(",
"self",
",",
"vd",
",",
"name",
",",
"parent",
",",
"rr_target",
",",
"seqnum",
",",
"rock_ridge",
",",
"rr_name",
",",
"xa",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalErr... | Create a new symlink Directory Record. This implies that the new
record will be Rock Ridge.
Parameters:
vd - The Volume Descriptor this record is part of.
name - The name for this directory record.
parent - The parent of this directory record.
rr_target - The symlin... | [
"Create",
"a",
"new",
"symlink",
"Directory",
"Record",
".",
"This",
"implies",
"that",
"the",
"new",
"record",
"will",
"be",
"Rock",
"Ridge",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L489-L514 | train |
clalancette/pycdlib | pycdlib/dr.py | DirectoryRecord.new_file | def new_file(self, vd, length, isoname, parent, seqnum, rock_ridge, rr_name,
xa, file_mode):
# type: (headervd.PrimaryOrSupplementaryVD, int, bytes, DirectoryRecord, int, str, bytes, bool, int) -> None
'''
Create a new file Directory Record.
Parameters:
vd - Th... | python | def new_file(self, vd, length, isoname, parent, seqnum, rock_ridge, rr_name,
xa, file_mode):
# type: (headervd.PrimaryOrSupplementaryVD, int, bytes, DirectoryRecord, int, str, bytes, bool, int) -> None
'''
Create a new file Directory Record.
Parameters:
vd - Th... | [
"def",
"new_file",
"(",
"self",
",",
"vd",
",",
"length",
",",
"isoname",
",",
"parent",
",",
"seqnum",
",",
"rock_ridge",
",",
"rr_name",
",",
"xa",
",",
"file_mode",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
... | Create a new file Directory Record.
Parameters:
vd - The Volume Descriptor this record is part of.
length - The length of the data.
isoname - The name for this directory record.
parent - The parent of this directory record.
seqnum - The sequence number for this dire... | [
"Create",
"a",
"new",
"file",
"Directory",
"Record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L516-L541 | train |
clalancette/pycdlib | pycdlib/dr.py | DirectoryRecord.new_root | def new_root(self, vd, seqnum, log_block_size):
# type: (headervd.PrimaryOrSupplementaryVD, int, int) -> None
'''
Create a new root Directory Record.
Parameters:
vd - The Volume Descriptor this record is part of.
seqnum - The sequence number for this directory record.
... | python | def new_root(self, vd, seqnum, log_block_size):
# type: (headervd.PrimaryOrSupplementaryVD, int, int) -> None
'''
Create a new root Directory Record.
Parameters:
vd - The Volume Descriptor this record is part of.
seqnum - The sequence number for this directory record.
... | [
"def",
"new_root",
"(",
"self",
",",
"vd",
",",
"seqnum",
",",
"log_block_size",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Directory Record already initialized'",
")",
"self",
".",
"_new",
... | Create a new root Directory Record.
Parameters:
vd - The Volume Descriptor this record is part of.
seqnum - The sequence number for this directory record.
log_block_size - The logical block size to use.
Returns:
Nothing. | [
"Create",
"a",
"new",
"root",
"Directory",
"Record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L543-L558 | train |
clalancette/pycdlib | pycdlib/dr.py | DirectoryRecord.new_dot | def new_dot(self, vd, parent, seqnum, rock_ridge, log_block_size, xa,
file_mode):
# type: (headervd.PrimaryOrSupplementaryVD, DirectoryRecord, int, str, int, bool, int) -> None
'''
Create a new 'dot' Directory Record.
Parameters:
vd - The Volume Descriptor this ... | python | def new_dot(self, vd, parent, seqnum, rock_ridge, log_block_size, xa,
file_mode):
# type: (headervd.PrimaryOrSupplementaryVD, DirectoryRecord, int, str, int, bool, int) -> None
'''
Create a new 'dot' Directory Record.
Parameters:
vd - The Volume Descriptor this ... | [
"def",
"new_dot",
"(",
"self",
",",
"vd",
",",
"parent",
",",
"seqnum",
",",
"rock_ridge",
",",
"log_block_size",
",",
"xa",
",",
"file_mode",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
... | Create a new 'dot' Directory Record.
Parameters:
vd - The Volume Descriptor this record is part of.
parent - The parent of this directory record.
seqnum - The sequence number for this directory record.
rock_ridge - Whether to make this a Rock Ridge directory record.
... | [
"Create",
"a",
"new",
"dot",
"Directory",
"Record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L560-L582 | train |
clalancette/pycdlib | pycdlib/dr.py | DirectoryRecord.new_dotdot | def new_dotdot(self, vd, parent, seqnum, rock_ridge, log_block_size,
rr_relocated_parent, xa, file_mode):
# type: (headervd.PrimaryOrSupplementaryVD, DirectoryRecord, int, str, int, bool, bool, int) -> None
'''
Create a new 'dotdot' Directory Record.
Parameters:
... | python | def new_dotdot(self, vd, parent, seqnum, rock_ridge, log_block_size,
rr_relocated_parent, xa, file_mode):
# type: (headervd.PrimaryOrSupplementaryVD, DirectoryRecord, int, str, int, bool, bool, int) -> None
'''
Create a new 'dotdot' Directory Record.
Parameters:
... | [
"def",
"new_dotdot",
"(",
"self",
",",
"vd",
",",
"parent",
",",
"seqnum",
",",
"rock_ridge",
",",
"log_block_size",
",",
"rr_relocated_parent",
",",
"xa",
",",
"file_mode",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
... | Create a new 'dotdot' Directory Record.
Parameters:
vd - The Volume Descriptor this record is part of.
parent - The parent of this directory record.
seqnum - The sequence number for this directory record.
rock_ridge - Whether to make this a Rock Ridge directory record.
... | [
"Create",
"a",
"new",
"dotdot",
"Directory",
"Record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L584-L607 | train |
clalancette/pycdlib | pycdlib/dr.py | DirectoryRecord.new_dir | def new_dir(self, vd, name, parent, seqnum, rock_ridge, rr_name, log_block_size,
rr_relocated_child, rr_relocated, xa, file_mode):
# type: (headervd.PrimaryOrSupplementaryVD, bytes, DirectoryRecord, int, str, bytes, int, bool, bool, bool, int) -> None
'''
Create a new directory D... | python | def new_dir(self, vd, name, parent, seqnum, rock_ridge, rr_name, log_block_size,
rr_relocated_child, rr_relocated, xa, file_mode):
# type: (headervd.PrimaryOrSupplementaryVD, bytes, DirectoryRecord, int, str, bytes, int, bool, bool, bool, int) -> None
'''
Create a new directory D... | [
"def",
"new_dir",
"(",
"self",
",",
"vd",
",",
"name",
",",
"parent",
",",
"seqnum",
",",
"rock_ridge",
",",
"rr_name",
",",
"log_block_size",
",",
"rr_relocated_child",
",",
"rr_relocated",
",",
"xa",
",",
"file_mode",
")",
":",
"if",
"self",
".",
"_ini... | Create a new directory Directory Record.
Parameters:
vd - The Volume Descriptor this record is part of.
name - The name for this directory record.
parent - The parent of this directory record.
seqnum - The sequence number for this directory record.
rock_ridge - Whet... | [
"Create",
"a",
"new",
"directory",
"Directory",
"Record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L609-L642 | train |
clalancette/pycdlib | pycdlib/dr.py | DirectoryRecord.change_existence | def change_existence(self, is_hidden):
# type: (bool) -> None
'''
Change the ISO9660 existence flag of this Directory Record.
Parameters:
is_hidden - True if this Directory Record should be hidden, False otherwise.
Returns:
Nothing.
'''
if not s... | python | def change_existence(self, is_hidden):
# type: (bool) -> None
'''
Change the ISO9660 existence flag of this Directory Record.
Parameters:
is_hidden - True if this Directory Record should be hidden, False otherwise.
Returns:
Nothing.
'''
if not s... | [
"def",
"change_existence",
"(",
"self",
",",
"is_hidden",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Directory Record not yet initialized'",
")",
"if",
"is_hidden",
":",
"self",
".",
"f... | Change the ISO9660 existence flag of this Directory Record.
Parameters:
is_hidden - True if this Directory Record should be hidden, False otherwise.
Returns:
Nothing. | [
"Change",
"the",
"ISO9660",
"existence",
"flag",
"of",
"this",
"Directory",
"Record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L644-L660 | train |
clalancette/pycdlib | pycdlib/dr.py | DirectoryRecord._recalculate_extents_and_offsets | def _recalculate_extents_and_offsets(self, index, logical_block_size):
# type: (int, int) -> Tuple[int, int]
'''
Internal method to recalculate the extents and offsets associated with
children of this directory record.
Parameters:
index - The index at which to start the... | python | def _recalculate_extents_and_offsets(self, index, logical_block_size):
# type: (int, int) -> Tuple[int, int]
'''
Internal method to recalculate the extents and offsets associated with
children of this directory record.
Parameters:
index - The index at which to start the... | [
"def",
"_recalculate_extents_and_offsets",
"(",
"self",
",",
"index",
",",
"logical_block_size",
")",
":",
"if",
"index",
"==",
"0",
":",
"dirrecord_offset",
"=",
"0",
"num_extents",
"=",
"1",
"else",
":",
"dirrecord_offset",
"=",
"self",
".",
"children",
"[",... | Internal method to recalculate the extents and offsets associated with
children of this directory record.
Parameters:
index - The index at which to start the recalculation.
logical_block_size - The block size to use for comparisons.
Returns:
A tuple where the first el... | [
"Internal",
"method",
"to",
"recalculate",
"the",
"extents",
"and",
"offsets",
"associated",
"with",
"children",
"of",
"this",
"directory",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L662-L694 | train |
clalancette/pycdlib | pycdlib/dr.py | DirectoryRecord._add_child | def _add_child(self, child, logical_block_size, allow_duplicate, check_overflow):
# type: (DirectoryRecord, int, bool, bool) -> bool
'''
An internal method to add a child to this object. Note that this is called both
during parsing and when adding a new object to the system, so it
... | python | def _add_child(self, child, logical_block_size, allow_duplicate, check_overflow):
# type: (DirectoryRecord, int, bool, bool) -> bool
'''
An internal method to add a child to this object. Note that this is called both
during parsing and when adding a new object to the system, so it
... | [
"def",
"_add_child",
"(",
"self",
",",
"child",
",",
"logical_block_size",
",",
"allow_duplicate",
",",
"check_overflow",
")",
":",
"if",
"not",
"self",
".",
"isdir",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInvalidInput",
"(",
"'Trying to add a child to a rec... | An internal method to add a child to this object. Note that this is called both
during parsing and when adding a new object to the system, so it
it shouldn't have any functionality that is not appropriate for both.
Parameters:
child - The child directory record object to add.
... | [
"An",
"internal",
"method",
"to",
"add",
"a",
"child",
"to",
"this",
"object",
".",
"Note",
"that",
"this",
"is",
"called",
"both",
"during",
"parsing",
"and",
"when",
"adding",
"a",
"new",
"object",
"to",
"the",
"system",
"so",
"it",
"it",
"shouldn",
... | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L696-L776 | train |
clalancette/pycdlib | pycdlib/dr.py | DirectoryRecord.add_child | def add_child(self, child, logical_block_size, allow_duplicate=False):
# type: (DirectoryRecord, int, bool) -> bool
'''
A method to add a new child to this directory record.
Parameters:
child - The child directory record object to add.
logical_block_size - The size of ... | python | def add_child(self, child, logical_block_size, allow_duplicate=False):
# type: (DirectoryRecord, int, bool) -> bool
'''
A method to add a new child to this directory record.
Parameters:
child - The child directory record object to add.
logical_block_size - The size of ... | [
"def",
"add_child",
"(",
"self",
",",
"child",
",",
"logical_block_size",
",",
"allow_duplicate",
"=",
"False",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Directory Record not yet initial... | A method to add a new child to this directory record.
Parameters:
child - The child directory record object to add.
logical_block_size - The size of a logical block for this volume descriptor.
allow_duplicate - Whether to allow duplicate names, as there are
... | [
"A",
"method",
"to",
"add",
"a",
"new",
"child",
"to",
"this",
"directory",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L778-L795 | train |
clalancette/pycdlib | pycdlib/dr.py | DirectoryRecord.track_child | def track_child(self, child, logical_block_size, allow_duplicate=False):
# type: (DirectoryRecord, int, bool) -> None
'''
A method to track an existing child of this directory record.
Parameters:
child - The child directory record object to add.
logical_block_size - Th... | python | def track_child(self, child, logical_block_size, allow_duplicate=False):
# type: (DirectoryRecord, int, bool) -> None
'''
A method to track an existing child of this directory record.
Parameters:
child - The child directory record object to add.
logical_block_size - Th... | [
"def",
"track_child",
"(",
"self",
",",
"child",
",",
"logical_block_size",
",",
"allow_duplicate",
"=",
"False",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Directory Record not yet initi... | A method to track an existing child of this directory record.
Parameters:
child - The child directory record object to add.
logical_block_size - The size of a logical block for this volume descriptor.
allow_duplicate - Whether to allow duplicate names, as there are
... | [
"A",
"method",
"to",
"track",
"an",
"existing",
"child",
"of",
"this",
"directory",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L797-L813 | train |
clalancette/pycdlib | pycdlib/dr.py | DirectoryRecord.remove_child | def remove_child(self, child, index, logical_block_size):
# type: (DirectoryRecord, int, int) -> bool
'''
A method to remove a child from this Directory Record.
Parameters:
child - The child DirectoryRecord object to remove.
index - The index of the child into this Dir... | python | def remove_child(self, child, index, logical_block_size):
# type: (DirectoryRecord, int, int) -> bool
'''
A method to remove a child from this Directory Record.
Parameters:
child - The child DirectoryRecord object to remove.
index - The index of the child into this Dir... | [
"def",
"remove_child",
"(",
"self",
",",
"child",
",",
"index",
",",
"logical_block_size",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Directory Record not yet initialized'",
")",
"if",
... | A method to remove a child from this Directory Record.
Parameters:
child - The child DirectoryRecord object to remove.
index - The index of the child into this DirectoryRecord children list.
logical_block_size - The size of a logical block on this volume descriptor.
Returns:
... | [
"A",
"method",
"to",
"remove",
"a",
"child",
"from",
"this",
"Directory",
"Record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L815-L887 | train |
clalancette/pycdlib | pycdlib/dr.py | DirectoryRecord.record | def record(self):
# type: () -> bytes
'''
A method to generate the string representing this Directory Record.
Parameters:
None.
Returns:
String representing this Directory Record.
'''
if not self._initialized:
raise pycdlibexception.... | python | def record(self):
# type: () -> bytes
'''
A method to generate the string representing this Directory Record.
Parameters:
None.
Returns:
String representing this Directory Record.
'''
if not self._initialized:
raise pycdlibexception.... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Directory Record not yet initialized'",
")",
"self",
".",
"date",
"=",
"dates",
".",
"DirectoryRecordDate",
"(",... | A method to generate the string representing this Directory Record.
Parameters:
None.
Returns:
String representing this Directory Record. | [
"A",
"method",
"to",
"generate",
"the",
"string",
"representing",
"this",
"Directory",
"Record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L1001-L1042 | train |
clalancette/pycdlib | pycdlib/dr.py | DirectoryRecord.is_associated_file | def is_associated_file(self):
# type: () -> bool
'''
A method to determine whether this file is 'associated' with another file
on the ISO.
Parameters:
None.
Returns:
True if this file is associated with another file on the ISO, False
otherwise.... | python | def is_associated_file(self):
# type: () -> bool
'''
A method to determine whether this file is 'associated' with another file
on the ISO.
Parameters:
None.
Returns:
True if this file is associated with another file on the ISO, False
otherwise.... | [
"def",
"is_associated_file",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Directory Record not yet initialized'",
")",
"return",
"self",
".",
"file_flags",
"&",
"(",
"1",
"<<... | A method to determine whether this file is 'associated' with another file
on the ISO.
Parameters:
None.
Returns:
True if this file is associated with another file on the ISO, False
otherwise. | [
"A",
"method",
"to",
"determine",
"whether",
"this",
"file",
"is",
"associated",
"with",
"another",
"file",
"on",
"the",
"ISO",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L1044-L1059 | train |
clalancette/pycdlib | pycdlib/dr.py | DirectoryRecord.set_ptr | def set_ptr(self, ptr):
# type: (path_table_record.PathTableRecord) -> None
'''
A method to set the Path Table Record associated with this Directory
Record.
Parameters:
ptr - The path table record to associate with this Directory Record.
Returns:
Nothin... | python | def set_ptr(self, ptr):
# type: (path_table_record.PathTableRecord) -> None
'''
A method to set the Path Table Record associated with this Directory
Record.
Parameters:
ptr - The path table record to associate with this Directory Record.
Returns:
Nothin... | [
"def",
"set_ptr",
"(",
"self",
",",
"ptr",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Directory Record not yet initialized'",
")",
"self",
".",
"ptr",
"=",
"ptr"
] | A method to set the Path Table Record associated with this Directory
Record.
Parameters:
ptr - The path table record to associate with this Directory Record.
Returns:
Nothing. | [
"A",
"method",
"to",
"set",
"the",
"Path",
"Table",
"Record",
"associated",
"with",
"this",
"Directory",
"Record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L1061-L1075 | train |
clalancette/pycdlib | pycdlib/dr.py | DirectoryRecord.set_data_location | def set_data_location(self, current_extent, tag_location): # pylint: disable=unused-argument
# type: (int, int) -> None
'''
A method to set the new extent location that the data for this Directory
Record should live at.
Parameters:
current_extent - The new extent.
... | python | def set_data_location(self, current_extent, tag_location): # pylint: disable=unused-argument
# type: (int, int) -> None
'''
A method to set the new extent location that the data for this Directory
Record should live at.
Parameters:
current_extent - The new extent.
... | [
"def",
"set_data_location",
"(",
"self",
",",
"current_extent",
",",
"tag_location",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Directory Record not yet initialized'",
")",
"self",
".",
"... | A method to set the new extent location that the data for this Directory
Record should live at.
Parameters:
current_extent - The new extent.
Returns:
Nothing. | [
"A",
"method",
"to",
"set",
"the",
"new",
"extent",
"location",
"that",
"the",
"data",
"for",
"this",
"Directory",
"Record",
"should",
"live",
"at",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L1077-L1093 | train |
clalancette/pycdlib | pycdlib/dr.py | DirectoryRecord.get_data_length | def get_data_length(self):
# type: () -> int
'''
A method to get the length of the data that this Directory Record
points to.
Parameters:
None.
Returns:
The length of the data that this Directory Record points to.
'''
if not self._initia... | python | def get_data_length(self):
# type: () -> int
'''
A method to get the length of the data that this Directory Record
points to.
Parameters:
None.
Returns:
The length of the data that this Directory Record points to.
'''
if not self._initia... | [
"def",
"get_data_length",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Directory Record not yet initialized'",
")",
"if",
"self",
".",
"inode",
"is",
"not",
"None",
":",
"r... | A method to get the length of the data that this Directory Record
points to.
Parameters:
None.
Returns:
The length of the data that this Directory Record points to. | [
"A",
"method",
"to",
"get",
"the",
"length",
"of",
"the",
"data",
"that",
"this",
"Directory",
"Record",
"points",
"to",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L1095-L1110 | train |
clalancette/pycdlib | pycdlib/dr.py | DirectoryRecord.set_data_length | def set_data_length(self, length):
# type: (int) -> None
'''
A method to set the length of the data that this Directory Record
points to.
Parameters:
length - The new length for the data.
Returns:
The length of the data that this Directory Record points... | python | def set_data_length(self, length):
# type: (int) -> None
'''
A method to set the length of the data that this Directory Record
points to.
Parameters:
length - The new length for the data.
Returns:
The length of the data that this Directory Record points... | [
"def",
"set_data_length",
"(",
"self",
",",
"length",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Directory Record not yet initialized'",
")",
"self",
".",
"data_length",
"=",
"length"
] | A method to set the length of the data that this Directory Record
points to.
Parameters:
length - The new length for the data.
Returns:
The length of the data that this Directory Record points to. | [
"A",
"method",
"to",
"set",
"the",
"length",
"of",
"the",
"data",
"that",
"this",
"Directory",
"Record",
"points",
"to",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L1112-L1125 | train |
clalancette/pycdlib | pycdlib/inode.py | Inode.new | def new(self, length, fp, manage_fp, offset):
# type: (int, BinaryIO, bool, int) -> None
'''
Initialize a new Inode.
Parameters:
None.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('Inode is ... | python | def new(self, length, fp, manage_fp, offset):
# type: (int, BinaryIO, bool, int) -> None
'''
Initialize a new Inode.
Parameters:
None.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('Inode is ... | [
"def",
"new",
"(",
"self",
",",
"length",
",",
"fp",
",",
"manage_fp",
",",
"offset",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Inode is already initialized'",
")",
"self",
".",
"data_len... | Initialize a new Inode.
Parameters:
None.
Returns:
Nothing. | [
"Initialize",
"a",
"new",
"Inode",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/inode.py#L56-L76 | train |
clalancette/pycdlib | pycdlib/inode.py | Inode.parse | def parse(self, extent, length, fp, log_block_size):
# type: (int, int, BinaryIO, int) -> None
'''
Parse an existing Inode. This just saves off the extent for later use.
Parameters:
extent - The original extent that the data lives at.
Returns:
Nothing.
... | python | def parse(self, extent, length, fp, log_block_size):
# type: (int, int, BinaryIO, int) -> None
'''
Parse an existing Inode. This just saves off the extent for later use.
Parameters:
extent - The original extent that the data lives at.
Returns:
Nothing.
... | [
"def",
"parse",
"(",
"self",
",",
"extent",
",",
"length",
",",
"fp",
",",
"log_block_size",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Inode is already initialized'",
")",
"self",
".",
"o... | Parse an existing Inode. This just saves off the extent for later use.
Parameters:
extent - The original extent that the data lives at.
Returns:
Nothing. | [
"Parse",
"an",
"existing",
"Inode",
".",
"This",
"just",
"saves",
"off",
"the",
"extent",
"for",
"later",
"use",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/inode.py#L78-L100 | train |
clalancette/pycdlib | pycdlib/inode.py | Inode.add_boot_info_table | def add_boot_info_table(self, boot_info_table):
# type: (eltorito.EltoritoBootInfoTable) -> None
'''
A method to add a boot info table to this Inode.
Parameters:
boot_info_table - The Boot Info Table object to add to this Inode.
Returns:
Nothing.
'''
... | python | def add_boot_info_table(self, boot_info_table):
# type: (eltorito.EltoritoBootInfoTable) -> None
'''
A method to add a boot info table to this Inode.
Parameters:
boot_info_table - The Boot Info Table object to add to this Inode.
Returns:
Nothing.
'''
... | [
"def",
"add_boot_info_table",
"(",
"self",
",",
"boot_info_table",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Inode is not yet initialized'",
")",
"self",
".",
"boot_info_table",
"=",
"bo... | A method to add a boot info table to this Inode.
Parameters:
boot_info_table - The Boot Info Table object to add to this Inode.
Returns:
Nothing. | [
"A",
"method",
"to",
"add",
"a",
"boot",
"info",
"table",
"to",
"this",
"Inode",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/inode.py#L149-L162 | train |
clalancette/pycdlib | pycdlib/inode.py | Inode.update_fp | def update_fp(self, fp, length):
# type: (BinaryIO, int) -> None
'''
Update the Inode to use a different file object and length.
Parameters:
fp - A file object that contains the data for this Inode.
length - The length of the data.
Returns:
Nothing.
... | python | def update_fp(self, fp, length):
# type: (BinaryIO, int) -> None
'''
Update the Inode to use a different file object and length.
Parameters:
fp - A file object that contains the data for this Inode.
length - The length of the data.
Returns:
Nothing.
... | [
"def",
"update_fp",
"(",
"self",
",",
"fp",
",",
"length",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Inode is not yet initialized'",
")",
"self",
".",
"original_data_location",
"=",
... | Update the Inode to use a different file object and length.
Parameters:
fp - A file object that contains the data for this Inode.
length - The length of the data.
Returns:
Nothing. | [
"Update",
"the",
"Inode",
"to",
"use",
"a",
"different",
"file",
"object",
"and",
"length",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/inode.py#L164-L181 | train |
clalancette/pycdlib | pycdlib/dates.py | string_to_timestruct | def string_to_timestruct(input_string):
# type: (bytes) -> time.struct_time
'''
A cacheable function to take an input string and decode it into a
time.struct_time from the time module. If the string cannot be decoded
because of an illegal value, then the all-zero time.struct_time will be
return... | python | def string_to_timestruct(input_string):
# type: (bytes) -> time.struct_time
'''
A cacheable function to take an input string and decode it into a
time.struct_time from the time module. If the string cannot be decoded
because of an illegal value, then the all-zero time.struct_time will be
return... | [
"def",
"string_to_timestruct",
"(",
"input_string",
")",
":",
"try",
":",
"timestruct",
"=",
"time",
".",
"strptime",
"(",
"input_string",
".",
"decode",
"(",
"'utf-8'",
")",
",",
"VolumeDescriptorDate",
".",
"TIME_FMT",
")",
"except",
"ValueError",
":",
"time... | A cacheable function to take an input string and decode it into a
time.struct_time from the time module. If the string cannot be decoded
because of an illegal value, then the all-zero time.struct_time will be
returned instead.
Parameters:
input_string - The string to attempt to parse.
Returns... | [
"A",
"cacheable",
"function",
"to",
"take",
"an",
"input",
"string",
"and",
"decode",
"it",
"into",
"a",
"time",
".",
"struct_time",
"from",
"the",
"time",
"module",
".",
"If",
"the",
"string",
"cannot",
"be",
"decoded",
"because",
"of",
"an",
"illegal",
... | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dates.py#L35-L59 | train |
clalancette/pycdlib | pycdlib/dates.py | DirectoryRecordDate.parse | def parse(self, datestr):
# type: (bytes) -> None
'''
Parse a Directory Record date out of a string.
Parameters:
datestr - The string to parse the date out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdli... | python | def parse(self, datestr):
# type: (bytes) -> None
'''
Parse a Directory Record date out of a string.
Parameters:
datestr - The string to parse the date out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdli... | [
"def",
"parse",
"(",
"self",
",",
"datestr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Directory Record Date already initialized'",
")",
"(",
"self",
".",
"years_since_1900",
",",
"self",
"."... | Parse a Directory Record date out of a string.
Parameters:
datestr - The string to parse the date out of.
Returns:
Nothing. | [
"Parse",
"a",
"Directory",
"Record",
"date",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dates.py#L81-L98 | train |
clalancette/pycdlib | pycdlib/dates.py | DirectoryRecordDate.new | def new(self):
# type: () -> None
'''
Create a new Directory Record date based on the current time.
Parameters:
tm - An optional argument that must be None
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInt... | python | def new(self):
# type: () -> None
'''
Create a new Directory Record date based on the current time.
Parameters:
tm - An optional argument that must be None
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInt... | [
"def",
"new",
"(",
"self",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Directory Record Date already initialized'",
")",
"tm",
"=",
"time",
".",
"time",
"(",
")",
"local",
"=",
"time",
".",... | Create a new Directory Record date based on the current time.
Parameters:
tm - An optional argument that must be None
Returns:
Nothing. | [
"Create",
"a",
"new",
"Directory",
"Record",
"date",
"based",
"on",
"the",
"current",
"time",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dates.py#L100-L123 | train |
clalancette/pycdlib | pycdlib/dates.py | DirectoryRecordDate.record | def record(self):
# type: () -> bytes
'''
Return a string representation of the Directory Record date.
Parameters:
None.
Returns:
A string representing this Directory Record Date.
'''
if not self._initialized:
raise pycdlibexception.... | python | def record(self):
# type: () -> bytes
'''
Return a string representation of the Directory Record date.
Parameters:
None.
Returns:
A string representing this Directory Record Date.
'''
if not self._initialized:
raise pycdlibexception.... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Directory Record Date not initialized'",
")",
"return",
"struct",
".",
"pack",
"(",
"self",
".",
"FMT",
",",
... | Return a string representation of the Directory Record date.
Parameters:
None.
Returns:
A string representing this Directory Record Date. | [
"Return",
"a",
"string",
"representation",
"of",
"the",
"Directory",
"Record",
"date",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dates.py#L125-L140 | train |
clalancette/pycdlib | pycdlib/dates.py | VolumeDescriptorDate.parse | def parse(self, datestr):
# type: (bytes) -> None
'''
Parse a Volume Descriptor Date out of a string. A string of all zeros
is valid, which means that the date in this field was not specified.
Parameters:
datestr - string to be parsed
Returns:
Nothin... | python | def parse(self, datestr):
# type: (bytes) -> None
'''
Parse a Volume Descriptor Date out of a string. A string of all zeros
is valid, which means that the date in this field was not specified.
Parameters:
datestr - string to be parsed
Returns:
Nothin... | [
"def",
"parse",
"(",
"self",
",",
"datestr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'This Volume Descriptor Date object is already initialized'",
")",
"if",
"len",
"(",
"datestr",
")",
"!=",
... | Parse a Volume Descriptor Date out of a string. A string of all zeros
is valid, which means that the date in this field was not specified.
Parameters:
datestr - string to be parsed
Returns:
Nothing. | [
"Parse",
"a",
"Volume",
"Descriptor",
"Date",
"out",
"of",
"a",
"string",
".",
"A",
"string",
"of",
"all",
"zeros",
"is",
"valid",
"which",
"means",
"that",
"the",
"date",
"in",
"this",
"field",
"was",
"not",
"specified",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dates.py#L170-L203 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRSPRecord.parse | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Sharing Protocol record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexcep... | python | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Sharing Protocol record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexcep... | [
"def",
"parse",
"(",
"self",
",",
"rrstr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'SP record already initialized!'",
")",
"(",
"su_len",
",",
"su_entry_version_unused",
",",
"check_byte1",
... | Parse a Rock Ridge Sharing Protocol record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing. | [
"Parse",
"a",
"Rock",
"Ridge",
"Sharing",
"Protocol",
"record",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L59-L83 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRSPRecord.new | def new(self, bytes_to_skip):
# type: (int) -> None
'''
Create a new Rock Ridge Sharing Protocol record.
Parameters:
bytes_to_skip - The number of bytes to skip.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdl... | python | def new(self, bytes_to_skip):
# type: (int) -> None
'''
Create a new Rock Ridge Sharing Protocol record.
Parameters:
bytes_to_skip - The number of bytes to skip.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdl... | [
"def",
"new",
"(",
"self",
",",
"bytes_to_skip",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'SP record already initialized!'",
")",
"self",
".",
"bytes_to_skip",
"=",
"bytes_to_skip",
"self",
"... | Create a new Rock Ridge Sharing Protocol record.
Parameters:
bytes_to_skip - The number of bytes to skip.
Returns:
Nothing. | [
"Create",
"a",
"new",
"Rock",
"Ridge",
"Sharing",
"Protocol",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L85-L99 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRSPRecord.record | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Sharing Protocol record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdlibexception... | python | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Sharing Protocol record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdlibexception... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'SP record not yet initialized!'",
")",
"return",
"b'SP'",
"+",
"struct",
".",
"pack",
"(",
"'=BBBBB'",
",",
... | Generate a string representing the Rock Ridge Sharing Protocol record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | [
"Generate",
"a",
"string",
"representing",
"the",
"Rock",
"Ridge",
"Sharing",
"Protocol",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L101-L114 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRRRRecord.new | def new(self):
# type: () -> None
'''
Create a new Rock Ridge Rock Ridge record.
Parameters:
None.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('RR record already initialized!')
sel... | python | def new(self):
# type: () -> None
'''
Create a new Rock Ridge Rock Ridge record.
Parameters:
None.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('RR record already initialized!')
sel... | [
"def",
"new",
"(",
"self",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'RR record already initialized!'",
")",
"self",
".",
"rr_flags",
"=",
"0",
"self",
".",
"_initialized",
"=",
"True"
] | Create a new Rock Ridge Rock Ridge record.
Parameters:
None.
Returns:
Nothing. | [
"Create",
"a",
"new",
"Rock",
"Ridge",
"Rock",
"Ridge",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L167-L181 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRRRRecord.append_field | def append_field(self, fieldname):
# type: (str) -> None
'''
Mark a field as present in the Rock Ridge records.
Parameters:
fieldname - The name of the field to mark as present; should be one
of 'PX', 'PN', 'SL', 'NM', 'CL', 'PL', 'RE', or 'TF'.
Ret... | python | def append_field(self, fieldname):
# type: (str) -> None
'''
Mark a field as present in the Rock Ridge records.
Parameters:
fieldname - The name of the field to mark as present; should be one
of 'PX', 'PN', 'SL', 'NM', 'CL', 'PL', 'RE', or 'TF'.
Ret... | [
"def",
"append_field",
"(",
"self",
",",
"fieldname",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'RR record not yet initialized!'",
")",
"if",
"fieldname",
"==",
"'PX'",
":",
"bit",
"=... | Mark a field as present in the Rock Ridge records.
Parameters:
fieldname - The name of the field to mark as present; should be one
of 'PX', 'PN', 'SL', 'NM', 'CL', 'PL', 'RE', or 'TF'.
Returns:
Nothing. | [
"Mark",
"a",
"field",
"as",
"present",
"in",
"the",
"Rock",
"Ridge",
"records",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L183-L216 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRRRRecord.record | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Rock Ridge record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdlibexception.PyCdl... | python | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Rock Ridge record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdlibexception.PyCdl... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'RR record not yet initialized!'",
")",
"return",
"b'RR'",
"+",
"struct",
".",
"pack",
"(",
"'=BBB'",
",",
"R... | Generate a string representing the Rock Ridge Rock Ridge record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | [
"Generate",
"a",
"string",
"representing",
"the",
"Rock",
"Ridge",
"Rock",
"Ridge",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L218-L231 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRCERecord.parse | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Continuation Entry record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexc... | python | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Continuation Entry record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexc... | [
"def",
"parse",
"(",
"self",
",",
"rrstr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'CE record already initialized!'",
")",
"(",
"su_len",
",",
"su_entry_version_unused",
",",
"bl_cont_area_le"... | Parse a Rock Ridge Continuation Entry record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing. | [
"Parse",
"a",
"Rock",
"Ridge",
"Continuation",
"Entry",
"record",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L261-L297 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRCERecord.new | def new(self):
# type: () -> None
'''
Create a new Rock Ridge Continuation Entry record.
Parameters:
None.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('CE record already initialized!')
... | python | def new(self):
# type: () -> None
'''
Create a new Rock Ridge Continuation Entry record.
Parameters:
None.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('CE record already initialized!')
... | [
"def",
"new",
"(",
"self",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'CE record already initialized!'",
")",
"self",
".",
"bl_cont_area",
"=",
"0",
"self",
".",
"offset_cont_area",
"=",
"0",... | Create a new Rock Ridge Continuation Entry record.
Parameters:
None.
Returns:
Nothing. | [
"Create",
"a",
"new",
"Rock",
"Ridge",
"Continuation",
"Entry",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L299-L316 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRCERecord.update_extent | def update_extent(self, extent):
# type: (int) -> None
'''
Update the extent for this CE record.
Parameters:
extent - The new extent for this CE record.
Returns:
Nothing.
'''
if not self._initialized:
raise pycdlibexception.PyCdlibIn... | python | def update_extent(self, extent):
# type: (int) -> None
'''
Update the extent for this CE record.
Parameters:
extent - The new extent for this CE record.
Returns:
Nothing.
'''
if not self._initialized:
raise pycdlibexception.PyCdlibIn... | [
"def",
"update_extent",
"(",
"self",
",",
"extent",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'CE record not yet initialized!'",
")",
"self",
".",
"bl_cont_area",
"=",
"extent"
] | Update the extent for this CE record.
Parameters:
extent - The new extent for this CE record.
Returns:
Nothing. | [
"Update",
"the",
"extent",
"for",
"this",
"CE",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L318-L331 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRCERecord.update_offset | def update_offset(self, offset):
# type: (int) -> None
'''
Update the offset for this CE record.
Parameters:
extent - The new offset for this CE record.
Returns:
Nothing.
'''
if not self._initialized:
raise pycdlibexception.PyCdlibIn... | python | def update_offset(self, offset):
# type: (int) -> None
'''
Update the offset for this CE record.
Parameters:
extent - The new offset for this CE record.
Returns:
Nothing.
'''
if not self._initialized:
raise pycdlibexception.PyCdlibIn... | [
"def",
"update_offset",
"(",
"self",
",",
"offset",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'CE record not yet initialized!'",
")",
"self",
".",
"offset_cont_area",
"=",
"offset"
] | Update the offset for this CE record.
Parameters:
extent - The new offset for this CE record.
Returns:
Nothing. | [
"Update",
"the",
"offset",
"for",
"this",
"CE",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L333-L346 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRCERecord.record | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Continuation Entry record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdlibexcepti... | python | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Continuation Entry record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdlibexcepti... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'CE record not yet initialized!'",
")",
"return",
"b'CE'",
"+",
"struct",
".",
"pack",
"(",
"'=BBLLLLLL'",
",",... | Generate a string representing the Rock Ridge Continuation Entry record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | [
"Generate",
"a",
"string",
"representing",
"the",
"Rock",
"Ridge",
"Continuation",
"Entry",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L364-L385 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRPXRecord.parse | def parse(self, rrstr):
# type: (bytes) -> int
'''
Parse a Rock Ridge POSIX File Attributes record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
A string representing the RR version, either 1.09 or 1.12.
'''
... | python | def parse(self, rrstr):
# type: (bytes) -> int
'''
Parse a Rock Ridge POSIX File Attributes record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
A string representing the RR version, either 1.09 or 1.12.
'''
... | [
"def",
"parse",
"(",
"self",
",",
"rrstr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'PX record already initialized!'",
")",
"(",
"su_len",
",",
"su_entry_version_unused",
",",
"posix_file_mode_... | Parse a Rock Ridge POSIX File Attributes record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
A string representing the RR version, either 1.09 or 1.12. | [
"Parse",
"a",
"Rock",
"Ridge",
"POSIX",
"File",
"Attributes",
"record",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L421-L476 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRPXRecord.new | def new(self, mode):
# type: (int) -> None
'''
Create a new Rock Ridge POSIX File Attributes record.
Parameters:
mode - The Unix file mode for this record.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInt... | python | def new(self, mode):
# type: (int) -> None
'''
Create a new Rock Ridge POSIX File Attributes record.
Parameters:
mode - The Unix file mode for this record.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInt... | [
"def",
"new",
"(",
"self",
",",
"mode",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'PX record already initialized!'",
")",
"self",
".",
"posix_file_mode",
"=",
"mode",
"self",
".",
"posix_fil... | Create a new Rock Ridge POSIX File Attributes record.
Parameters:
mode - The Unix file mode for this record.
Returns:
Nothing. | [
"Create",
"a",
"new",
"Rock",
"Ridge",
"POSIX",
"File",
"Attributes",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L478-L497 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRPXRecord.record | def record(self, rr_version):
# type: (str) -> bytes
'''
Generate a string representing the Rock Ridge POSIX File Attributes
record.
Parameters:
rr_version - The Rock Ridge version to use.
Returns:
String containing the Rock Ridge record.
'''
... | python | def record(self, rr_version):
# type: (str) -> bytes
'''
Generate a string representing the Rock Ridge POSIX File Attributes
record.
Parameters:
rr_version - The Rock Ridge version to use.
Returns:
String containing the Rock Ridge record.
'''
... | [
"def",
"record",
"(",
"self",
",",
"rr_version",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'PX record not yet initialized!'",
")",
"outlist",
"=",
"[",
"b'PX'",
",",
"struct",
".",
... | Generate a string representing the Rock Ridge POSIX File Attributes
record.
Parameters:
rr_version - The Rock Ridge version to use.
Returns:
String containing the Rock Ridge record. | [
"Generate",
"a",
"string",
"representing",
"the",
"Rock",
"Ridge",
"POSIX",
"File",
"Attributes",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L499-L529 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRERRecord.parse | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Extensions Reference record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibe... | python | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Extensions Reference record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibe... | [
"def",
"parse",
"(",
"self",
",",
"rrstr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'ER record already initialized!'",
")",
"(",
"su_len",
",",
"su_entry_version_unused",
",",
"len_id",
",",
... | Parse a Rock Ridge Extensions Reference record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing. | [
"Parse",
"a",
"Rock",
"Ridge",
"Extensions",
"Reference",
"record",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L566-L599 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRERRecord.new | def new(self, ext_id, ext_des, ext_src):
# type: (bytes, bytes, bytes) -> None
'''
Create a new Rock Ridge Extensions Reference record.
Parameters:
ext_id - The extension identifier to use.
ext_des - The extension descriptor to use.
ext_src - The extension spe... | python | def new(self, ext_id, ext_des, ext_src):
# type: (bytes, bytes, bytes) -> None
'''
Create a new Rock Ridge Extensions Reference record.
Parameters:
ext_id - The extension identifier to use.
ext_des - The extension descriptor to use.
ext_src - The extension spe... | [
"def",
"new",
"(",
"self",
",",
"ext_id",
",",
"ext_des",
",",
"ext_src",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'ER record already initialized!'",
")",
"self",
".",
"ext_id",
"=",
"ext... | Create a new Rock Ridge Extensions Reference record.
Parameters:
ext_id - The extension identifier to use.
ext_des - The extension descriptor to use.
ext_src - The extension specification source to use.
Returns:
Nothing. | [
"Create",
"a",
"new",
"Rock",
"Ridge",
"Extensions",
"Reference",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L601-L621 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRERRecord.record | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Extensions Reference
record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycd... | python | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Extensions Reference
record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycd... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'ER record not yet initialized!'",
")",
"return",
"b'ER'",
"+",
"struct",
".",
"pack",
"(",
"'=BBBBBB'",
",",
... | Generate a string representing the Rock Ridge Extensions Reference
record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | [
"Generate",
"a",
"string",
"representing",
"the",
"Rock",
"Ridge",
"Extensions",
"Reference",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L623-L637 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRERRecord.length | def length(ext_id, ext_des, ext_src):
# type: (bytes, bytes, bytes) -> int
'''
Static method to return the length of the Rock Ridge Extensions Reference
record.
Parameters:
ext_id - The extension identifier to use.
ext_des - The extension descriptor to use.
... | python | def length(ext_id, ext_des, ext_src):
# type: (bytes, bytes, bytes) -> int
'''
Static method to return the length of the Rock Ridge Extensions Reference
record.
Parameters:
ext_id - The extension identifier to use.
ext_des - The extension descriptor to use.
... | [
"def",
"length",
"(",
"ext_id",
",",
"ext_des",
",",
"ext_src",
")",
":",
"return",
"8",
"+",
"len",
"(",
"ext_id",
")",
"+",
"len",
"(",
"ext_des",
")",
"+",
"len",
"(",
"ext_src",
")"
] | Static method to return the length of the Rock Ridge Extensions Reference
record.
Parameters:
ext_id - The extension identifier to use.
ext_des - The extension descriptor to use.
ext_src - The extension specification source to use.
Returns:
The length of this... | [
"Static",
"method",
"to",
"return",
"the",
"length",
"of",
"the",
"Rock",
"Ridge",
"Extensions",
"Reference",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L640-L653 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRESRecord.new | def new(self, extension_sequence):
# type: (int) -> None
'''
Create a new Rock Ridge Extension Selector record.
Parameters:
extension_sequence - The sequence number of this extension.
Returns:
Nothing.
'''
if self._initialized:
raise... | python | def new(self, extension_sequence):
# type: (int) -> None
'''
Create a new Rock Ridge Extension Selector record.
Parameters:
extension_sequence - The sequence number of this extension.
Returns:
Nothing.
'''
if self._initialized:
raise... | [
"def",
"new",
"(",
"self",
",",
"extension_sequence",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'ES record already initialized!'",
")",
"self",
".",
"extension_sequence",
"=",
"extension_sequence"... | Create a new Rock Ridge Extension Selector record.
Parameters:
extension_sequence - The sequence number of this extension.
Returns:
Nothing. | [
"Create",
"a",
"new",
"Rock",
"Ridge",
"Extension",
"Selector",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L689-L703 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRESRecord.record | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Extension Selector record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdlibexcepti... | python | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Extension Selector record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdlibexcepti... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'ES record not yet initialized!'",
")",
"return",
"b'ES'",
"+",
"struct",
".",
"pack",
"(",
"'=BBB'",
",",
"R... | Generate a string representing the Rock Ridge Extension Selector record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | [
"Generate",
"a",
"string",
"representing",
"the",
"Rock",
"Ridge",
"Extension",
"Selector",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L705-L718 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRPNRecord.parse | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge POSIX Device Number record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibex... | python | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge POSIX Device Number record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibex... | [
"def",
"parse",
"(",
"self",
",",
"rrstr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'PN record already initialized!'",
")",
"(",
"su_len",
",",
"su_entry_version_unused",
",",
"dev_t_high_le",
... | Parse a Rock Ridge POSIX Device Number record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing. | [
"Parse",
"a",
"Rock",
"Ridge",
"POSIX",
"Device",
"Number",
"record",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L748-L779 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRPNRecord.new | def new(self, dev_t_high, dev_t_low):
# type: (int, int) -> None
'''
Create a new Rock Ridge POSIX device number record.
Parameters:
dev_t_high - The high-order 32-bits of the device number.
dev_t_low - The low-order 32-bits of the device number.
Returns:
... | python | def new(self, dev_t_high, dev_t_low):
# type: (int, int) -> None
'''
Create a new Rock Ridge POSIX device number record.
Parameters:
dev_t_high - The high-order 32-bits of the device number.
dev_t_low - The low-order 32-bits of the device number.
Returns:
... | [
"def",
"new",
"(",
"self",
",",
"dev_t_high",
",",
"dev_t_low",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'PN record already initialized!'",
")",
"self",
".",
"dev_t_high",
"=",
"dev_t_high",
... | Create a new Rock Ridge POSIX device number record.
Parameters:
dev_t_high - The high-order 32-bits of the device number.
dev_t_low - The low-order 32-bits of the device number.
Returns:
Nothing. | [
"Create",
"a",
"new",
"Rock",
"Ridge",
"POSIX",
"device",
"number",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L781-L798 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRPNRecord.record | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge POSIX Device Number
record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdl... | python | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge POSIX Device Number
record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdl... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'PN record not yet initialized!'",
")",
"return",
"b'PN'",
"+",
"struct",
".",
"pack",
"(",
"'=BBLLLL'",
",",
... | Generate a string representing the Rock Ridge POSIX Device Number
record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | [
"Generate",
"a",
"string",
"representing",
"the",
"Rock",
"Ridge",
"POSIX",
"Device",
"Number",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L800-L814 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRSLRecord.parse | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Symbolic Link record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexceptio... | python | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Symbolic Link record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexceptio... | [
"def",
"parse",
"(",
"self",
",",
"rrstr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'SL record already initialized!'",
")",
"(",
"su_len",
",",
"su_entry_version_unused",
",",
"self",
".",
... | Parse a Rock Ridge Symbolic Link record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing. | [
"Parse",
"a",
"Rock",
"Ridge",
"Symbolic",
"Link",
"record",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L993-L1029 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRSLRecord.add_component | def add_component(self, symlink_comp):
# type: (bytes) -> None
'''
Add a new component to this symlink record.
Parameters:
symlink_comp - The string to add to this symlink record.
Returns:
Nothing.
'''
if not self._initialized:
raise... | python | def add_component(self, symlink_comp):
# type: (bytes) -> None
'''
Add a new component to this symlink record.
Parameters:
symlink_comp - The string to add to this symlink record.
Returns:
Nothing.
'''
if not self._initialized:
raise... | [
"def",
"add_component",
"(",
"self",
",",
"symlink_comp",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'SL record not yet initialized!'",
")",
"if",
"(",
"self",
".",
"current_length",
"("... | Add a new component to this symlink record.
Parameters:
symlink_comp - The string to add to this symlink record.
Returns:
Nothing. | [
"Add",
"a",
"new",
"component",
"to",
"this",
"symlink",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1046-L1062 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRSLRecord.current_length | def current_length(self):
# type: () -> int
'''
Calculate the current length of this symlink record.
Parameters:
None.
Returns:
Length of this symlink record.
'''
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError(... | python | def current_length(self):
# type: () -> int
'''
Calculate the current length of this symlink record.
Parameters:
None.
Returns:
Length of this symlink record.
'''
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError(... | [
"def",
"current_length",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'SL record not yet initialized!'",
")",
"strlist",
"=",
"[",
"]",
"for",
"comp",
"in",
"self",
".",
"... | Calculate the current length of this symlink record.
Parameters:
None.
Returns:
Length of this symlink record. | [
"Calculate",
"the",
"current",
"length",
"of",
"this",
"symlink",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1064-L1081 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRSLRecord.record | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Symbolic Link record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdlibexception.Py... | python | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Symbolic Link record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdlibexception.Py... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'SL record not yet initialized!'",
")",
"outlist",
"=",
"[",
"b'SL'",
",",
"struct",
".",
"pack",
"(",
"'=BBB... | Generate a string representing the Rock Ridge Symbolic Link record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | [
"Generate",
"a",
"string",
"representing",
"the",
"Rock",
"Ridge",
"Symbolic",
"Link",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1083-L1100 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRSLRecord.name | def name(self):
# type: () -> bytes
'''
Generate a string that contains all components of the symlink.
Parameters:
None
Returns:
String containing all components of the symlink.
'''
if not self._initialized:
raise pycdlibexception.Py... | python | def name(self):
# type: () -> bytes
'''
Generate a string that contains all components of the symlink.
Parameters:
None
Returns:
String containing all components of the symlink.
'''
if not self._initialized:
raise pycdlibexception.Py... | [
"def",
"name",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'SL record not yet initialized!'",
")",
"outlist",
"=",
"[",
"]",
"continued",
"=",
"False",
"for",
"comp",
"in... | Generate a string that contains all components of the symlink.
Parameters:
None
Returns:
String containing all components of the symlink. | [
"Generate",
"a",
"string",
"that",
"contains",
"all",
"components",
"of",
"the",
"symlink",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1102-L1131 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRSLRecord.set_last_component_continued | def set_last_component_continued(self):
# type: () -> None
'''
Set the previous component of this SL record to continued.
Parameters:
None.
Returns:
Nothing.
'''
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('... | python | def set_last_component_continued(self):
# type: () -> None
'''
Set the previous component of this SL record to continued.
Parameters:
None.
Returns:
Nothing.
'''
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('... | [
"def",
"set_last_component_continued",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'SL record not yet initialized!'",
")",
"if",
"not",
"self",
".",
"symlink_components",
":",
... | Set the previous component of this SL record to continued.
Parameters:
None.
Returns:
Nothing. | [
"Set",
"the",
"previous",
"component",
"of",
"this",
"SL",
"record",
"to",
"continued",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1148-L1164 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRSLRecord.last_component_continued | def last_component_continued(self):
# type: () -> bool
'''
Determines whether the previous component of this SL record is a
continued one or not.
Parameters:
None.
Returns:
True if the previous component of this SL record is continued, False otherwise.
... | python | def last_component_continued(self):
# type: () -> bool
'''
Determines whether the previous component of this SL record is a
continued one or not.
Parameters:
None.
Returns:
True if the previous component of this SL record is continued, False otherwise.
... | [
"def",
"last_component_continued",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'SL record not yet initialized!'",
")",
"if",
"not",
"self",
".",
"symlink_components",
":",
"rai... | Determines whether the previous component of this SL record is a
continued one or not.
Parameters:
None.
Returns:
True if the previous component of this SL record is continued, False otherwise. | [
"Determines",
"whether",
"the",
"previous",
"component",
"of",
"this",
"SL",
"record",
"is",
"a",
"continued",
"one",
"or",
"not",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1166-L1183 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRSLRecord.length | def length(symlink_components):
# type: (List[bytes]) -> int
'''
Static method to return the length of the Rock Ridge Symbolic Link
record.
Parameters:
symlink_components - A list containing a string for each of the
symbolic link components... | python | def length(symlink_components):
# type: (List[bytes]) -> int
'''
Static method to return the length of the Rock Ridge Symbolic Link
record.
Parameters:
symlink_components - A list containing a string for each of the
symbolic link components... | [
"def",
"length",
"(",
"symlink_components",
")",
":",
"length",
"=",
"RRSLRecord",
".",
"header_length",
"(",
")",
"for",
"comp",
"in",
"symlink_components",
":",
"length",
"+=",
"RRSLRecord",
".",
"Component",
".",
"length",
"(",
"comp",
")",
"return",
"len... | Static method to return the length of the Rock Ridge Symbolic Link
record.
Parameters:
symlink_components - A list containing a string for each of the
symbolic link components.
Returns:
The length of this record in bytes. | [
"Static",
"method",
"to",
"return",
"the",
"length",
"of",
"the",
"Rock",
"Ridge",
"Symbolic",
"Link",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1209-L1224 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRNMRecord.parse | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Alternate Name record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexcepti... | python | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Alternate Name record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexcepti... | [
"def",
"parse",
"(",
"self",
",",
"rrstr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'NM record already initialized!'",
")",
"(",
"su_len",
",",
"su_entry_version_unused",
",",
"self",
".",
... | Parse a Rock Ridge Alternate Name record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing. | [
"Parse",
"a",
"Rock",
"Ridge",
"Alternate",
"Name",
"record",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1239-L1266 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRNMRecord.new | def new(self, rr_name):
# type: (bytes) -> None
'''
Create a new Rock Ridge Alternate Name record.
Parameters:
rr_name - The name for the new record.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalE... | python | def new(self, rr_name):
# type: (bytes) -> None
'''
Create a new Rock Ridge Alternate Name record.
Parameters:
rr_name - The name for the new record.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalE... | [
"def",
"new",
"(",
"self",
",",
"rr_name",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'NM record already initialized!'",
")",
"self",
".",
"posix_name",
"=",
"rr_name",
"self",
".",
"posix_na... | Create a new Rock Ridge Alternate Name record.
Parameters:
rr_name - The name for the new record.
Returns:
Nothing. | [
"Create",
"a",
"new",
"Rock",
"Ridge",
"Alternate",
"Name",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1268-L1284 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRNMRecord.record | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Alternate Name record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdlibexception.P... | python | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Alternate Name record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdlibexception.P... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'NM record not yet initialized!'",
")",
"return",
"b'NM'",
"+",
"struct",
".",
"pack",
"(",
"b'=BBB'",
",",
"... | Generate a string representing the Rock Ridge Alternate Name record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | [
"Generate",
"a",
"string",
"representing",
"the",
"Rock",
"Ridge",
"Alternate",
"Name",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1286-L1299 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRCLRecord.parse | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Child Link record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.P... | python | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Child Link record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.P... | [
"def",
"parse",
"(",
"self",
",",
"rrstr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'CL record already initialized!'",
")",
"(",
"su_len",
",",
"su_entry_version_unused",
",",
"child_log_block_... | Parse a Rock Ridge Child Link record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing. | [
"Parse",
"a",
"Rock",
"Ridge",
"Child",
"Link",
"record",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1344-L1368 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRCLRecord.new | def new(self):
# type: () -> None
'''
Create a new Rock Ridge Child Link record.
Parameters:
None.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('CL record already initialized!')
sel... | python | def new(self):
# type: () -> None
'''
Create a new Rock Ridge Child Link record.
Parameters:
None.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('CL record already initialized!')
sel... | [
"def",
"new",
"(",
"self",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'CL record already initialized!'",
")",
"self",
".",
"child_log_block_num",
"=",
"0",
"self",
".",
"_initialized",
"=",
"... | Create a new Rock Ridge Child Link record.
Parameters:
None.
Returns:
Nothing. | [
"Create",
"a",
"new",
"Rock",
"Ridge",
"Child",
"Link",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1370-L1385 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRCLRecord.set_log_block_num | def set_log_block_num(self, bl):
# type: (int) -> None
'''
Set the logical block number for the child.
Parameters:
bl - Logical block number of the child.
Returns:
Nothing.
'''
if not self._initialized:
raise pycdlibexception.PyCdlib... | python | def set_log_block_num(self, bl):
# type: (int) -> None
'''
Set the logical block number for the child.
Parameters:
bl - Logical block number of the child.
Returns:
Nothing.
'''
if not self._initialized:
raise pycdlibexception.PyCdlib... | [
"def",
"set_log_block_num",
"(",
"self",
",",
"bl",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'CL record not yet initialized!'",
")",
"self",
".",
"child_log_block_num",
"=",
"bl"
] | Set the logical block number for the child.
Parameters:
bl - Logical block number of the child.
Returns:
Nothing. | [
"Set",
"the",
"logical",
"block",
"number",
"for",
"the",
"child",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1402-L1415 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRPLRecord.parse | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Parent Link record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.... | python | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Parent Link record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.... | [
"def",
"parse",
"(",
"self",
",",
"rrstr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'PL record already initialized!'",
")",
"(",
"su_len",
",",
"su_entry_version_unused",
",",
"parent_log_block... | Parse a Rock Ridge Parent Link record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing. | [
"Parse",
"a",
"Rock",
"Ridge",
"Parent",
"Link",
"record",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1445-L1468 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRPLRecord.new | def new(self):
# type: () -> None
'''
Generate a string representing the Rock Ridge Parent Link record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInter... | python | def new(self):
# type: () -> None
'''
Generate a string representing the Rock Ridge Parent Link record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInter... | [
"def",
"new",
"(",
"self",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'PL record already initialized!'",
")",
"self",
".",
"parent_log_block_num",
"=",
"0",
"self",
".",
"_initialized",
"=",
... | Generate a string representing the Rock Ridge Parent Link record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | [
"Generate",
"a",
"string",
"representing",
"the",
"Rock",
"Ridge",
"Parent",
"Link",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1470-L1485 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRPLRecord.set_log_block_num | def set_log_block_num(self, bl):
# type: (int) -> None
'''
Set the logical block number for the parent.
Parameters:
bl - Logical block number of the parent.
Returns:
Nothing.
'''
if not self._initialized:
raise pycdlibexception.PyCdl... | python | def set_log_block_num(self, bl):
# type: (int) -> None
'''
Set the logical block number for the parent.
Parameters:
bl - Logical block number of the parent.
Returns:
Nothing.
'''
if not self._initialized:
raise pycdlibexception.PyCdl... | [
"def",
"set_log_block_num",
"(",
"self",
",",
"bl",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'PL record not yet initialized!'",
")",
"self",
".",
"parent_log_block_num",
"=",
"bl"
] | Set the logical block number for the parent.
Parameters:
bl - Logical block number of the parent.
Returns:
Nothing. | [
"Set",
"the",
"logical",
"block",
"number",
"for",
"the",
"parent",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1502-L1515 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRTFRecord.parse | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Time Stamp record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.P... | python | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Time Stamp record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.P... | [
"def",
"parse",
"(",
"self",
",",
"rrstr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'TF record already initialized!'",
")",
"(",
"su_len",
",",
"su_entry_version_unused",
",",
"self",
".",
... | Parse a Rock Ridge Time Stamp record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing. | [
"Parse",
"a",
"Rock",
"Ridge",
"Time",
"Stamp",
"record",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1558-L1592 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRTFRecord.new | def new(self, time_flags):
# type: (int) -> None
'''
Create a new Rock Ridge Time Stamp record.
Parameters:
time_flags - The flags to use for this time stamp record.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.... | python | def new(self, time_flags):
# type: (int) -> None
'''
Create a new Rock Ridge Time Stamp record.
Parameters:
time_flags - The flags to use for this time stamp record.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.... | [
"def",
"new",
"(",
"self",
",",
"time_flags",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'TF record already initialized!'",
")",
"self",
".",
"time_flags",
"=",
"time_flags",
"tflen",
"=",
"7... | Create a new Rock Ridge Time Stamp record.
Parameters:
time_flags - The flags to use for this time stamp record.
Returns:
Nothing. | [
"Create",
"a",
"new",
"Rock",
"Ridge",
"Time",
"Stamp",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1594-L1621 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRTFRecord.record | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Time Stamp record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdlibexception.PyCdl... | python | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Time Stamp record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdlibexception.PyCdl... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'TF record not yet initialized!'",
")",
"outlist",
"=",
"[",
"b'TF'",
",",
"struct",
".",
"pack",
"(",
"'=BBB... | Generate a string representing the Rock Ridge Time Stamp record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | [
"Generate",
"a",
"string",
"representing",
"the",
"Rock",
"Ridge",
"Time",
"Stamp",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1623-L1642 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRTFRecord.length | def length(time_flags):
# type: (int) -> int
'''
Static method to return the length of the Rock Ridge Time Stamp
record.
Parameters:
time_flags - Integer representing the flags to use.
Returns:
The length of this record in bytes.
'''
tf_... | python | def length(time_flags):
# type: (int) -> int
'''
Static method to return the length of the Rock Ridge Time Stamp
record.
Parameters:
time_flags - Integer representing the flags to use.
Returns:
The length of this record in bytes.
'''
tf_... | [
"def",
"length",
"(",
"time_flags",
")",
":",
"tf_each_size",
"=",
"7",
"if",
"time_flags",
"&",
"(",
"1",
"<<",
"7",
")",
":",
"tf_each_size",
"=",
"17",
"time_flags",
"&=",
"0x7f",
"tf_num",
"=",
"0",
"while",
"time_flags",
":",
"time_flags",
"&=",
"... | Static method to return the length of the Rock Ridge Time Stamp
record.
Parameters:
time_flags - Integer representing the flags to use.
Returns:
The length of this record in bytes. | [
"Static",
"method",
"to",
"return",
"the",
"length",
"of",
"the",
"Rock",
"Ridge",
"Time",
"Stamp",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1645-L1665 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRSFRecord.parse | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Sparse File record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.... | python | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Sparse File record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.... | [
"def",
"parse",
"(",
"self",
",",
"rrstr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'SF record already initialized!'",
")",
"(",
"su_len",
",",
"su_entry_version_unused",
",",
")",
"=",
"st... | Parse a Rock Ridge Sparse File record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing. | [
"Parse",
"a",
"Rock",
"Ridge",
"Sparse",
"File",
"record",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1683-L1721 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRSFRecord.new | def new(self, file_size_high, file_size_low, table_depth):
# type: (Optional[int], int, Optional[int]) -> None
'''
Create a new Rock Ridge Sparse File record.
Parameters:
file_size_high - The high-order 32-bits of the file size.
file_size_low - The low-order 32-bits of... | python | def new(self, file_size_high, file_size_low, table_depth):
# type: (Optional[int], int, Optional[int]) -> None
'''
Create a new Rock Ridge Sparse File record.
Parameters:
file_size_high - The high-order 32-bits of the file size.
file_size_low - The low-order 32-bits of... | [
"def",
"new",
"(",
"self",
",",
"file_size_high",
",",
"file_size_low",
",",
"table_depth",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'SF record already initialized!'",
")",
"self",
".",
"virt... | Create a new Rock Ridge Sparse File record.
Parameters:
file_size_high - The high-order 32-bits of the file size.
file_size_low - The low-order 32-bits of the file size.
table_depth - The maximum virtual file size.
Returns:
Nothing. | [
"Create",
"a",
"new",
"Rock",
"Ridge",
"Sparse",
"File",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1723-L1742 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRSFRecord.record | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Sparse File record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdlibexception.PyCd... | python | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Sparse File record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdlibexception.PyCd... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'SF record not yet initialized!'",
")",
"length",
"=",
"12",
"if",
"self",
".",
"virtual_file_size_high",
"is",
... | Generate a string representing the Rock Ridge Sparse File record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | [
"Generate",
"a",
"string",
"representing",
"the",
"Rock",
"Ridge",
"Sparse",
"File",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1744-L1766 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRRERecord.record | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Relocated Directory
record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdl... | python | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Relocated Directory
record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdl... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'RE record not yet initialized!'",
")",
"return",
"b'RE'",
"+",
"struct",
".",
"pack",
"(",
"'=BB'",
",",
"RR... | Generate a string representing the Rock Ridge Relocated Directory
record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | [
"Generate",
"a",
"string",
"representing",
"the",
"Rock",
"Ridge",
"Relocated",
"Directory",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1839-L1853 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRSTRecord.parse | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge System Terminator record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexce... | python | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge System Terminator record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexce... | [
"def",
"parse",
"(",
"self",
",",
"rrstr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'ST record already initialized!'",
")",
"(",
"su_len",
",",
"su_entry_version_unused",
")",
"=",
"struct",
... | Parse a Rock Ridge System Terminator record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing. | [
"Parse",
"a",
"Rock",
"Ridge",
"System",
"Terminator",
"record",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1882-L1903 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRSTRecord.record | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge System Terminator
record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdlib... | python | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge System Terminator
record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdlib... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'ST record not yet initialized!'",
")",
"return",
"b'ST'",
"+",
"struct",
".",
"pack",
"(",
"'=BB'",
",",
"RR... | Generate a string representing the Rock Ridge System Terminator
record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | [
"Generate",
"a",
"string",
"representing",
"the",
"Rock",
"Ridge",
"System",
"Terminator",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1920-L1934 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRPDRecord.parse | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Platform Dependent record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexc... | python | def parse(self, rrstr):
# type: (bytes) -> None
'''
Parse a Rock Ridge Platform Dependent record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexc... | [
"def",
"parse",
"(",
"self",
",",
"rrstr",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'PD record already initialized!'",
")",
"(",
"su_len_unused",
",",
"su_entry_version_unused",
")",
"=",
"st... | Parse a Rock Ridge Platform Dependent record out of a string.
Parameters:
rrstr - The string to parse the record out of.
Returns:
Nothing. | [
"Parse",
"a",
"Rock",
"Ridge",
"Platform",
"Dependent",
"record",
"out",
"of",
"a",
"string",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1963-L1983 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRPDRecord.new | def new(self):
# type: () -> None
'''
Create a new Rock Ridge Platform Dependent record.
Parameters:
None.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('PD record already initialized!')
... | python | def new(self):
# type: () -> None
'''
Create a new Rock Ridge Platform Dependent record.
Parameters:
None.
Returns:
Nothing.
'''
if self._initialized:
raise pycdlibexception.PyCdlibInternalError('PD record already initialized!')
... | [
"def",
"new",
"(",
"self",
")",
":",
"if",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'PD record already initialized!'",
")",
"self",
".",
"_initialized",
"=",
"True",
"self",
".",
"padding",
"=",
"b''"
] | Create a new Rock Ridge Platform Dependent record.
Parameters:
None.
Returns:
Nothing. | [
"Create",
"a",
"new",
"Rock",
"Ridge",
"Platform",
"Dependent",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L1985-L1999 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RRPDRecord.record | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Platform Dependent
record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdli... | python | def record(self):
# type: () -> bytes
'''
Generate a string representing the Rock Ridge Platform Dependent
record.
Parameters:
None.
Returns:
String containing the Rock Ridge record.
'''
if not self._initialized:
raise pycdli... | [
"def",
"record",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'PD record not yet initialized!'",
")",
"return",
"b'PD'",
"+",
"struct",
".",
"pack",
"(",
"'=BB'",
",",
"RR... | Generate a string representing the Rock Ridge Platform Dependent
record.
Parameters:
None.
Returns:
String containing the Rock Ridge record. | [
"Generate",
"a",
"string",
"representing",
"the",
"Rock",
"Ridge",
"Platform",
"Dependent",
"record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L2001-L2016 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RockRidge.has_entry | def has_entry(self, name):
# type: (str) -> bool
'''
An internal method to tell if we have already parsed an entry of the
named type.
Parameters:
name - The name of the entry to check.
Returns:
True if we have already parsed an entry of the named type, ... | python | def has_entry(self, name):
# type: (str) -> bool
'''
An internal method to tell if we have already parsed an entry of the
named type.
Parameters:
name - The name of the entry to check.
Returns:
True if we have already parsed an entry of the named type, ... | [
"def",
"has_entry",
"(",
"self",
",",
"name",
")",
":",
"return",
"getattr",
"(",
"self",
".",
"dr_entries",
",",
"name",
")",
"or",
"getattr",
"(",
"self",
".",
"ce_entries",
",",
"name",
")"
] | An internal method to tell if we have already parsed an entry of the
named type.
Parameters:
name - The name of the entry to check.
Returns:
True if we have already parsed an entry of the named type, False otherwise. | [
"An",
"internal",
"method",
"to",
"tell",
"if",
"we",
"have",
"already",
"parsed",
"an",
"entry",
"of",
"the",
"named",
"type",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L2095-L2106 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RockRidge._record | def _record(self, entries):
# type: (RockRidgeEntries) -> bytes
'''
Return a string representing the Rock Ridge entry.
Parameters:
entries - The dr_entries or ce_entries to generate a record for.
Returns:
A string representing the Rock Ridge entry.
'''
... | python | def _record(self, entries):
# type: (RockRidgeEntries) -> bytes
'''
Return a string representing the Rock Ridge entry.
Parameters:
entries - The dr_entries or ce_entries to generate a record for.
Returns:
A string representing the Rock Ridge entry.
'''
... | [
"def",
"_record",
"(",
"self",
",",
"entries",
")",
":",
"outlist",
"=",
"[",
"]",
"if",
"entries",
".",
"sp_record",
"is",
"not",
"None",
":",
"outlist",
".",
"append",
"(",
"entries",
".",
"sp_record",
".",
"record",
"(",
")",
")",
"if",
"entries",... | Return a string representing the Rock Ridge entry.
Parameters:
entries - The dr_entries or ce_entries to generate a record for.
Returns:
A string representing the Rock Ridge entry. | [
"Return",
"a",
"string",
"representing",
"the",
"Rock",
"Ridge",
"entry",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L2274-L2331 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RockRidge.record_dr_entries | def record_dr_entries(self):
# type: () -> bytes
'''
Return a string representing the Rock Ridge entries in the Directory Record.
Parameters:
None.
Returns:
A string representing the Rock Ridge entry.
'''
if not self._initialized:
ra... | python | def record_dr_entries(self):
# type: () -> bytes
'''
Return a string representing the Rock Ridge entries in the Directory Record.
Parameters:
None.
Returns:
A string representing the Rock Ridge entry.
'''
if not self._initialized:
ra... | [
"def",
"record_dr_entries",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Rock Ridge extension not yet initialized'",
")",
"return",
"self",
".",
"_record",
"(",
"self",
".",
... | Return a string representing the Rock Ridge entries in the Directory Record.
Parameters:
None.
Returns:
A string representing the Rock Ridge entry. | [
"Return",
"a",
"string",
"representing",
"the",
"Rock",
"Ridge",
"entries",
"in",
"the",
"Directory",
"Record",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L2333-L2346 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RockRidge.record_ce_entries | def record_ce_entries(self):
# type: () -> bytes
'''
Return a string representing the Rock Ridge entries in the Continuation Entry.
Parameters:
None.
Returns:
A string representing the Rock Ridge entry.
'''
if not self._initialized:
... | python | def record_ce_entries(self):
# type: () -> bytes
'''
Return a string representing the Rock Ridge entries in the Continuation Entry.
Parameters:
None.
Returns:
A string representing the Rock Ridge entry.
'''
if not self._initialized:
... | [
"def",
"record_ce_entries",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Rock Ridge extension not yet initialized'",
")",
"return",
"self",
".",
"_record",
"(",
"self",
".",
... | Return a string representing the Rock Ridge entries in the Continuation Entry.
Parameters:
None.
Returns:
A string representing the Rock Ridge entry. | [
"Return",
"a",
"string",
"representing",
"the",
"Rock",
"Ridge",
"entries",
"in",
"the",
"Continuation",
"Entry",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L2348-L2361 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RockRidge._add_ce_record | def _add_ce_record(self, curr_dr_len, thislen):
# type: (int, int) -> int
'''
An internal method to add a new length to a Continuation Entry. If the
Continuation Entry does not yet exist, this method creates it.
Parameters:
curr_dr_len - The current Directory Record le... | python | def _add_ce_record(self, curr_dr_len, thislen):
# type: (int, int) -> int
'''
An internal method to add a new length to a Continuation Entry. If the
Continuation Entry does not yet exist, this method creates it.
Parameters:
curr_dr_len - The current Directory Record le... | [
"def",
"_add_ce_record",
"(",
"self",
",",
"curr_dr_len",
",",
"thislen",
")",
":",
"if",
"self",
".",
"dr_entries",
".",
"ce_record",
"is",
"None",
":",
"self",
".",
"dr_entries",
".",
"ce_record",
"=",
"RRCERecord",
"(",
")",
"self",
".",
"dr_entries",
... | An internal method to add a new length to a Continuation Entry. If the
Continuation Entry does not yet exist, this method creates it.
Parameters:
curr_dr_len - The current Directory Record length.
thislen - The new length to add to the Continuation Entry.
Returns:
An... | [
"An",
"internal",
"method",
"to",
"add",
"a",
"new",
"length",
"to",
"a",
"Continuation",
"Entry",
".",
"If",
"the",
"Continuation",
"Entry",
"does",
"not",
"yet",
"exist",
"this",
"method",
"creates",
"it",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L2363-L2381 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RockRidge._add_name | def _add_name(self, rr_name, curr_dr_len):
# type: (bytes, int) -> int
'''
An internal method to add the appropriate name records to the ISO.
Parameters:
rr_name - The Rock Ridge name to add to the ISO.
curr_dr_len - The current directory record length.
Returns... | python | def _add_name(self, rr_name, curr_dr_len):
# type: (bytes, int) -> int
'''
An internal method to add the appropriate name records to the ISO.
Parameters:
rr_name - The Rock Ridge name to add to the ISO.
curr_dr_len - The current directory record length.
Returns... | [
"def",
"_add_name",
"(",
"self",
",",
"rr_name",
",",
"curr_dr_len",
")",
":",
"len_here",
"=",
"ALLOWED_DR_SIZE",
"-",
"curr_dr_len",
"-",
"5",
"if",
"len_here",
"<",
"len",
"(",
"rr_name",
")",
":",
"curr_dr_len",
"=",
"self",
".",
"_add_ce_record",
"(",... | An internal method to add the appropriate name records to the ISO.
Parameters:
rr_name - The Rock Ridge name to add to the ISO.
curr_dr_len - The current directory record length.
Returns:
The new directory record length. | [
"An",
"internal",
"method",
"to",
"add",
"the",
"appropriate",
"name",
"records",
"to",
"the",
"ISO",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L2502-L2549 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RockRidge.add_to_file_links | def add_to_file_links(self):
# type: () -> None
'''
Increment the number of POSIX file links on this entry by one.
Parameters:
None.
Returns:
Nothing.
'''
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('Rock Ri... | python | def add_to_file_links(self):
# type: () -> None
'''
Increment the number of POSIX file links on this entry by one.
Parameters:
None.
Returns:
Nothing.
'''
if not self._initialized:
raise pycdlibexception.PyCdlibInternalError('Rock Ri... | [
"def",
"add_to_file_links",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Rock Ridge extension not yet initialized'",
")",
"if",
"self",
".",
"dr_entries",
".",
"px_record",
"is... | Increment the number of POSIX file links on this entry by one.
Parameters:
None.
Returns:
Nothing. | [
"Increment",
"the",
"number",
"of",
"POSIX",
"file",
"links",
"on",
"this",
"entry",
"by",
"one",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L2728-L2746 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RockRidge.copy_file_links | def copy_file_links(self, src):
# type: (RockRidge) -> None
'''
Copy the number of file links from the source Rock Ridge entry into
this Rock Ridge entry.
Parameters:
src - The source Rock Ridge entry to copy from.
Returns:
Nothing.
'''
... | python | def copy_file_links(self, src):
# type: (RockRidge) -> None
'''
Copy the number of file links from the source Rock Ridge entry into
this Rock Ridge entry.
Parameters:
src - The source Rock Ridge entry to copy from.
Returns:
Nothing.
'''
... | [
"def",
"copy_file_links",
"(",
"self",
",",
"src",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Rock Ridge extension not yet initialized'",
")",
"if",
"src",
".",
"dr_entries",
".",
"px_r... | Copy the number of file links from the source Rock Ridge entry into
this Rock Ridge entry.
Parameters:
src - The source Rock Ridge entry to copy from.
Returns:
Nothing. | [
"Copy",
"the",
"number",
"of",
"file",
"links",
"from",
"the",
"source",
"Rock",
"Ridge",
"entry",
"into",
"this",
"Rock",
"Ridge",
"entry",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L2768-L2796 | train |
clalancette/pycdlib | pycdlib/rockridge.py | RockRidge.get_file_mode | def get_file_mode(self):
# type: () -> int
'''
Get the POSIX file mode bits for this Rock Ridge entry.
Parameters:
None.
Returns:
The POSIX file mode bits for this Rock Ridge entry.
'''
if not self._initialized:
raise pycdlibexceptio... | python | def get_file_mode(self):
# type: () -> int
'''
Get the POSIX file mode bits for this Rock Ridge entry.
Parameters:
None.
Returns:
The POSIX file mode bits for this Rock Ridge entry.
'''
if not self._initialized:
raise pycdlibexceptio... | [
"def",
"get_file_mode",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_initialized",
":",
"raise",
"pycdlibexception",
".",
"PyCdlibInternalError",
"(",
"'Rock Ridge extension not yet initialized'",
")",
"if",
"self",
".",
"dr_entries",
".",
"px_record",
"is",
... | Get the POSIX file mode bits for this Rock Ridge entry.
Parameters:
None.
Returns:
The POSIX file mode bits for this Rock Ridge entry. | [
"Get",
"the",
"POSIX",
"file",
"mode",
"bits",
"for",
"this",
"Rock",
"Ridge",
"entry",
"."
] | 1e7b77a809e905d67dc71e12d70e850be26b6233 | https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L2798-L2816 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.