Add the beginnings of a high level API to isofs. Currently only does

initialization and getting/setting volume attributes.
master
Dave 16 years ago
parent 24730f52d1
commit 0ae442220a
  1. 2
      bindings/python/isofs/__init__.py
  2. 9
      bindings/python/isofs/defines.py
  3. 30
      bindings/python/isofs/isofs.py

@ -0,0 +1,2 @@
from defines import *
from isofs import IsoFS

@ -0,0 +1,9 @@
# The automatic code generator does not wrap enums into python. As
# isofs has only two enum values publicly defined, they are hardcoded
# here.
# from enum ecma119_extension_flag
ECMA119_ROCKRIDGE = 1
ECMA119_JOLIET = 2
__all__ = ['ECMA119_ROCKRIDGE', 'ECMA119_JOLIET']

@ -0,0 +1,30 @@
# High level interface to the isofs library.
import core
import defines
def _wrap_volume_property(var_name, core_setter):
def get(self):
return getattr(self, var_name)
def set(self, value):
setattr(self, var_name, value)
core_setter(self._volume, value)
return property(get, set)
class IsoFS(object):
def __init__(self, volume_id='', publisher_id='',
data_preparer_id=''):
self._volume_id = volume_id
self._publisher_id = publisher_id
self._data_preparer_id = data_preparer_id
self._volume = core.iso_volume_new(
volume_id, publisher_id, data_preparer_id)
self._volset = core.iso_volset_new(self._volume, volume_id)
volume_id = _wrap_volume_property(
'_volume_id', core.iso_volume_set_volume_id)
publisher_id = _wrap_volume_property(
'_publisher_id', core.iso_volume_set_publisher_id)
data_preparer_id = _wrap_volume_property(
'_data_preparer_id', core.iso_volume_set_data_preparer_id)
Loading…
Cancel
Save