Metabolic network file
File class.
/!\ The class that extend file can only have a path and file_store_id attributes. Other attributes will not be provided when creating the resource
Views
Functions
Constructor, please do not overwrite this method, use the init method instead Leave the constructor without parameters.
Name | Type | Default value | Description |
---|---|---|---|
path | str | '' |
Add technical information on the resource. Technical info are useful to set additional information on the resource.
Name | Type | Default value | Description |
---|---|---|---|
technical_info | TechnicalInfo | Technical information to add (key, value) |
You can redefine this method to define custom logic to check this resource. If there is a problem with the resource, return a string that define the error, otherwise return None This method is called on output resources of a task. If there is an error returned, the task will be set to error and next proceses will not be run. It is also call when uploading a resource (usually for files or folder), if there is an error returned, the resource will not be uploaded
Union[str, NoneType] |
Clone the resource to create a new instance with a new id. It copies the RFields.
ResourceType |
Copy the node to the directory and keep the same base name
Name | Type | Default value | Description |
---|---|---|---|
destination | str | _description_ |
str |
Copy the file to the target path
Name | Type | Default value | Description |
---|---|---|---|
destination | str |
str |
Name | Type | Default value | Description |
---|---|---|---|
default_encoding | str | utf-8 |
str |
str |
You can redefine this method to set a name of the resource. When saving the resource the name will be saved automatically This can be useful to distinguish this resource from another one or to search for the resource
str |
Name | Type | Default value | Description |
---|---|---|---|
page | int | 1 |
View |
int |
Get the technical information of the resource
Name | Type | Default value | Description |
---|---|---|---|
key | str | Key of the technical information |
TechnicalInfo |
Name | Type | Default value | Description |
---|---|---|---|
start_line | int | 1 |
SimpleTextView |
This can be overwritten to perform custom initialization of the resource. This method is called just after the init (constructor) of the resource. The default values of RFields are set before this method is called.
bool |
bool |
Open the file
Name | Type | Default value | Description |
---|---|---|---|
mode | str | ||
encoding | str | None |
Any |
Name | Type | Default value | Description |
---|---|---|---|
size | int | -1 |
AnyStr |
Name | Type | Default value | Description |
---|---|---|---|
from_line | int | 0 | |
to_line | int | 10 |
str |
Write in the file
Name | Type | Default value | Description |
---|---|---|---|
data | str |