@@ -835,10 +835,10 @@ datetime.datetime(2022, 9, 19, 15, 26, 7)
835835Disabling AVU reloads from the iRODS server
836836------------------------------------------ -
837837
838- With the default setting of reload = True , an iRODSMetaCollection will
838+ With the default setting of ` reload = True ` , an ` iRODSMetaCollection` will
839839proactively read all current AVUs back from the iRODS server after any
840- metadata write done by the client. This helps methods such as items()
841- to return an up- to- date result. Changing that default can, however, greatly
840+ metadata write done by the client. This helps methods such as ` items()`
841+ to return an up- to- date result. Setting ` reload = False ` can, however, greatly
842842increase code efficiency if for example a lot of AVUs must be added or deleted
843843at once without reading any back again.
844844
@@ -850,13 +850,12 @@ for i in range(10):
850850
851851# Force reload of AVUs and display:
852852current_metadata = obj.metadata().items()
853- from pprint import pp
854853print (f " { current_metadata = } " )
855854```
856855
857856Subclassing iRODSMeta
858857-------------------- -
859- The keyword option `iRODSMeta_type` can be used to set up any iRODSMeta
858+ The keyword option `iRODSMeta_type` can be used to set up any ` iRODSMeta`
860859subclass as the translator between native iRODS metadata APIs
861860and the way in which the AVUs thus conveyed should be represented to the
862861client.
@@ -865,12 +864,12 @@ An example is the `irods.meta.iRODSBinOrStringMeta` class which uses the
865864`base64` module to " hide" arbitrary bytestrings within the `value` and
866865`units` attributes of an iRODS metadata AVU :
867866
868- ```
867+ ```py
869868from irods.meta import iRODSBinOrStringMeta as MyMeta
870869d = session.data_objects.get(' /path/to/object' )
871870unencodable_octets = ' \u1000 ' .encode(' utf8' )[:- 1 ]
872871
873- # Use our custom client-metadata type to store arbitrary octet strings
872+ # Use our custom client-metadata type to store arbitrary octet strings.
874873meta_view = d.metadata(iRODSMeta_type = MyMeta)
875874meta_view.set(m1 := MyMeta(' mybinary' , unencodable_octets, b ' \x02 ' ))
876875
@@ -879,15 +878,15 @@ irods.client_configuration.connections.xml_parser_default = 'QUASI_XML'
879878meta_view.set(m2 := MyMeta(' mytext' , ' \1 ' , ' \2 ' ))
880879
881880try :
882- # These two lines are equivalent:
881+ # These two lines are equivalent.
883882 assert {m1,m2} <= (all_avus := set (meta_view.items()))
884883 assert {tuple (m1),tuple (m2)} <= all_avus
885884finally :
886885 del meta_view[' mytext' ], meta_view[' mybinary' ]
887886```
888887
889888Whereas the content of native iRODS AVUs must obey some valid text encoding as
890- determined by the resident ICAT DB , the above is a possible alternative - albeit
889+ determined by the resident iRODS catalog , the above is a possible alternative - albeit
891890one semantically bound to the local application that defines the needed
892891translations. Still, this can be a valid usage for users who need a guarantee
893892that any given octet string they might generate can be placed into metadata without
0 commit comments