Commit Graph

3 Commits

Author SHA1 Message Date
939cf3c0da
Updated extractar
- removed `on_setattr` argument in attr.ib() call for `name` attribute
  in `class@ArchiveInfo`.
- update docstring for class@Archive.
- if `file=` provided with None, ValueError is raised instead of
  RuntimeError.
- changed attributes of class@Archive to be private.
- added setattr dunder method similar to class@ArchiveInfo, but all
  attributes are defined as constant. Any attempt to modify constants
  throws an AttributeError
- added property for attribute `__file` in class@Archive.
- refactored code to use os.path instead of pathlib. Pathlib was
  restrictive on not allowing byte-like strings, and is an inappropriate
  module for the task (os is just simpler).
- ensured that writing the byte contents from an archive to a new file
  occurs within a try-except statement, and raises an IOError if the
  write fails in some way due to IO.
- other minor amendments.
2023-06-30 22:51:36 +01:00
db6dad845f
Updated extractar.py using attrs
The ArchiveInfo class now uses the attrs library and slots over instance
dictionaries.

Class now explicitly inherits from class object for custom setattr
dunder method in AchiveInfo. This override allows for immutability of
class attributes, and flexible mutability when appropriate.
2023-06-11 21:11:33 +01:00
50443715fc
Added extractar.py
Version 1.0 release. Initial commit of library module.

The module has the ability to open, read, and extract files from within
an archived file, using the common format (Debian binary packages can be
unarchived of its contents).
2023-06-07 20:00:52 +01:00