Arguments:
- * source_obj: ArvadosFile | Subcollection --- The file or subcollection
+ * source_obj: arvados.arvfile.ArvadosFile | Subcollection --- The file or subcollection
to add to this collection
* target_name: str --- The path inside this collection where
Arguments:
- * source: str | ArvadosFile | Subcollection --- The file or
- subcollection to add to this collection. If `source` is a str, the
- object will be found by looking up this path from `source_collection`
- (see below).
+ * source: str | arvados.arvfile.ArvadosFile |
+ arvados.collection.Subcollection --- The file or subcollection to
+ add to this collection. If `source` is a str, the object will be
+ found by looking up this path from `source_collection` (see
+ below).
* target_path: str --- The path inside this collection where the
source object should be added.
- * source_collection: Collection | None --- The collection to find the
- source object from when `source` is a path. Defaults to the current
- collection (`self`).
+ * source_collection: arvados.collection.Collection | None --- The
+ collection to find the source object from when `source` is a
+ path. Defaults to the current collection (`self`).
* overwrite: bool --- Controls the behavior of this method when the
collection already contains an object at `target_path`. If `False`
Arguments:
- * source: str | ArvadosFile | Subcollection --- The file or
- subcollection to add to this collection. If `source` is a str, the
- object will be found by looking up this path from `source_collection`
- (see below).
+ * source: str | arvados.arvfile.ArvadosFile |
+ arvados.collection.Subcollection --- The file or subcollection to
+ add to this collection. If `source` is a str, the object will be
+ found by looking up this path from `source_collection` (see
+ below).
* target_path: str --- The path inside this collection where the
source object should be added.
- * source_collection: Collection | None --- The collection to find the
- source object from when `source` is a path. Defaults to the current
- collection (`self`).
+ * source_collection: arvados.collection.Collection | None --- The
+ collection to find the source object from when `source` is a
+ path. Defaults to the current collection (`self`).
* overwrite: bool --- Controls the behavior of this method when the
collection already contains an object at `target_path`. If `False`
Arguments:
- * end_collection: RichCollectionBase --- A collection object with the
- desired end state. The returned diff list will describe how to go
- from the current collection object `self` to `end_collection`.
+ * end_collection: arvados.collection.RichCollectionBase --- A
+ collection object with the desired end state. The returned diff
+ list will describe how to go from the current collection object
+ `self` to `end_collection`.
* prefix: str --- The name to use for this collection's stream in
the diff list. Default `'.'`.
- * holding_collection: Collection | None --- A collection object used to
- hold objects for the returned diff list. By default, a new empty
- collection is created.
+ * holding_collection: arvados.collection.Collection | None --- A
+ collection object used to hold objects for the returned diff
+ list. By default, a new empty collection is created.
"""
changes = []
if holding_collection is None:
Arguments:
- * changes: ChangeList --- The list of differences generated by
- `RichCollectionBase.diff`.
+ * changes: arvados.collection.ChangeList --- The list of differences
+ generated by `RichCollectionBase.diff`.
"""
if changes:
self.set_committed(False)
Arguments:
- * callback: ChangeCallback --- The callable to call each time the
- collection is changed.
+ * callback: arvados.collection.ChangeCallback --- The callable to
+ call each time the collection is changed.
"""
if self._callback is None:
self._callback = callback
* event: Literal[ADD, DEL, MOD, TOK] --- The type of modification to
the collection.
- * collection: RichCollectionBase --- The collection that was modified.
+ * collection: arvados.collection.RichCollectionBase --- The
+ collection that was modified.
* name: str --- The name of the file or stream within `collection` that
was modified.
- * item: ArvadosFile | Subcollection --- The new contents at `name`
+ * item: arvados.arvfile.ArvadosFile |
+ arvados.collection.Subcollection --- The new contents at `name`
within `collection`.
"""
if self._callback:
except errors.SyntaxError as e:
raise errors.ArgumentError("Error processing manifest text: %s", str(e)) from None
- def storage_classes_desired(self) -> list[str]:
+ def storage_classes_desired(self) -> List[str]:
"""Get this collection's `storage_classes_desired` value"""
return self._storage_classes_desired or []
@synchronized
def known_past_version(
self,
- modified_at_and_portable_data_hash: tuple[Optional[str], Optional[str]]
+ modified_at_and_portable_data_hash: Tuple[Optional[str], Optional[str]]
) -> bool:
"""Indicate whether an API record for this collection has been seen before
Arguments:
- * other: Collection | None --- The collection whose contents should be
- merged into this instance. When not provided, this method reloads this
- collection's API record and constructs a Collection object from it.
- If this instance does not have a corresponding API record, this method
- raises `arvados.errors.ArgumentError`.
+ * other: arvados.collection.Collection | None --- The collection
+ whose contents should be merged into this instance. When not
+ provided, this method reloads this collection's API record and
+ constructs a Collection object from it. If this instance does not
+ have a corresponding API record, this method raises
+ `arvados.errors.ArgumentError`.
* num_retries: int | None --- The number of times to retry reloading
the collection's API record from the API server. If not specified,
uses the `num_retries` provided when this instance was constructed.
"""
-
if other is None:
if self._manifest_locator is None:
raise errors.ArgumentError("`other` is None but collection does not have a manifest_locator uuid")
Arguments:
- * new_parent: Collection | None --- This value is passed to the new
- Collection's constructor as the `parent` argument.
+ * new_parent: arvados.collection.Collection | None --- This value is
+ passed to the new Collection's constructor as the `parent`
+ argument.
* new_name: str | None --- This value is unused.
You may only have one file object from the Collection open at a time,
so be sure to close the object when you're done. Using the object in
- a with statement makes that easy::
+ a with statement makes that easy:
- with cwriter.open('./doc/page1.txt') as outfile:
- outfile.write(page1_data)
- with cwriter.open('./doc/page2.txt') as outfile:
- outfile.write(page2_data)
+ with cwriter.open('./doc/page1.txt') as outfile:
+ outfile.write(page1_data)
+ with cwriter.open('./doc/page2.txt') as outfile:
+ outfile.write(page2_data)
"""
if filename is None:
streampath, filename = split(streampath)