Skip to content

Commit

Permalink
Cleanup more of the documentation.
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette committed Jan 3, 2021
1 parent 97f4fc7 commit 547ebfb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# PyCdlib
PyCdlib is a pure python library to parse, write (master), create, and manipulate ISO9660 files. These files are suitable for writing to a CD or USB.

The documentation for PyCdlib is split into several parts. If you are unfamiliar with the ISO and related standards, it is probably best to read the pages in order. If you already have a decent idea about ISO9660, Joliet, Rock Ridge, El Torito, and UDF, you can skip directly to the examples.
The documentation for PyCdlib is split into several parts. If you are unfamiliar with the ISO and related standards, it is probably best to read the pages in order. If you already have a decent idea about ISO9660, Joliet, Rock Ridge, El Torito, and UDF, you can skip directly to the examples to find out how to use PyCdlib.

* [Standards](standards.md)
* [Python compatibility](python-compatibility.md)
Expand Down
11 changes: 3 additions & 8 deletions docs/design.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# Design

## Overview

The aim of PyCdlib is to be a pure Python library that can be used to easily interact with the filesystems that make up various optical disks (collectively known as "ISOs" throughout the rest of this document). This includes the original ISO9660 standard (also known as Ecma-119), the El Torito booting standard, the Joliet and Rock Ridge extensions, and the UDF filesystem.

## Context

The original motivation for writing the library was to replace the subprocess calls to genisoimage in [Oz](https://github.com/clalancette/oz) with something pure Python. During initial research, no suitably complete, Python-only ISO manipulation library was found. It was also discovered that [cdrkit](https://launchpad.net/cdrkit) (the upstream project that contains genisoimage) is dormant, embroiled in a somewhat bitter fork, contains several serious bugs, and lacks an externally visible test suite. PyCdlib was created to address the above problems and provide a pure Python library for ISO introspection and manipulation.

## Goals

* A pure Python library to interact with optical disk filesystems.
* Support for reading, writing (mastering), and introspecting optical disk filesystems.
* Support for all of the common optical disk filesystems and their extensions.
Expand All @@ -21,28 +18,26 @@ The original motivation for writing the library was to replace the subprocess ca
* Performance approaching that of genisoimage.

## Non-Goals

* Support for non-optical disk filesystem (ext4, NTFS, FAT, etc are not supported).
* Speed improvements via a less portable C library.

## Existing solutions

The [cdrkit](https://launchpad.net/cdrkit) project mentioned in the Context section is the canonical Linux ISO filesystem manipulation program on many Linux distributions. The upstream project that it was forked from is called [cdrtools](http://cdrtools.sourceforge.net/private/cdrecord.html). While cdrtools is *not* dormant, it does not offer a Python library, and thus does not meet the original criteria for the project.

## PyCdlib solution
The [isoparser](https://github.com/barneygale/isoparser) project is a Python library to parse ISO9660 and Rock Ridge filesystems, but is unmaintained and now inactive.

## PyCdlib solution
PyCdlib allows the user to either open an existing ISO or create a new ISO from scratch. From that point forward, the ISO can be manipulated or introspected in various ways by calling additional APIs on the object. Once the filesystem has been modified to the users specification, it can then be written out to a file descriptor.

## Testing

PyCdlib has an extensive test suite of hundreds of tests that get run on each release. There are four types of tests that PyCdlib currently runs:

- In unit tests, low-level details of the PyCdlib implementation are tested for completeness and code coverage.
- In parsing integration tests, specific sequences of files and directories are created, and then an ISO is generated using genisoimage from [cdrkit](https://launchpad.net/cdrkit). Then the PyCdlib [open](pycdlib-api.html#PyCdlib-open) method is used to open up the resulting file and check various aspects of the file. This ensures that PyCdlib can successfully open up existing ISOs.
- In new integration tests, a new ISO is created using the PyCdlib [new](pycdlib-api.html#PyCdlib-new) method, and the ISO is manipulated in specific ways. Various aspects of these newly created files are compared against known examples to ensure that things were created as they should be.
- In hybrid integration tests, specific sequences of files and directories are created, and then an ISO is generated using genisoimage from [cdrkit](https://launchpad.net/cdrkit). Then the PyCdlib [open](pycdlib-api.html#PyCdlib-open) method is used to open up the resulting file, and the ISO is manipulated in specific ways. Various aspects of these newly created files are compared against known examples to ensure that things were created as they should be.

PyCdlib currently has 90% code coverage from the tests, and anytime a new bug is found, a test is written to ensure that the bug can’t happen again.
PyCdlib currently has 96% code coverage from the tests, and anytime a new bug is found, a test is written to ensure that the bug can’t happen again.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ El Torito is the name of the standard used to make an ISO bootable. Without goi
1. No emulation - Don't do any emulation for booting. This is the method that is used for BIOS's that know how to boot from ISO, and is the one most commonly used today. There are few restrictions on what the contents of the file must be, other than it should be valid code for the machine it will be used to boot.

## UDF
The "Universal Disk Format" was proposed in the late 1990's to supplant the aging ISO9660 as the filesystem of choice on optical media. It was adopted as the standard DVD filesystem format, and thus started gaining widespread popularity and use. Due to backwards-compatibility concerns, however, it mostly didn't replace ISO9660 as much as augment it as another way to encode the data on a volume. This is often known as the "bridge" format.
The "Universal Disk Format" was proposed in the late 1990's to supplant the aging ISO9660 as the filesystem of choice on optical media. It was adopted as the standard DVD filesystem format, and thus started gaining widespread popularity and use. UDF can either be used as the only filesystem on an ISO, or can be used in combination with the original ISO9660 filesystem. The latter is known as the "bridge" format.

The UDF filesystem format consists of two or three separate specifications, depending on how you count them. Ecma-167 is the base specification that defines the filesystem structure, types, etc. The UDF specification starts with Ecma-167 and adds specific rules and restrictions that, when followed, make a filesystem layout UDF compliant. Further, Ecma TR-071 starts with the UDF specification and adds even more rules and restrictions that, when followed, make a filesystem layout DVD Read-only media compliant.

Expand Down
2 changes: 1 addition & 1 deletion tools/pycdlib-genisoimage
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ def main():
A private function that will be passed into the write_fp method of the
PyCdlib object, and prints out the current progress of the mastering.
Parameters (as prescribe by PyCdlib):
Parameters (as prescribed by PyCdlib):
done - The amount of data written so far
total - The total amount of data to write
progress_data - An object of type ProgressData to track progress
Expand Down

0 comments on commit 547ebfb

Please sign in to comment.