class
ScriptExternalFileObject.
ScriptExternalFileObjectMarker
Bases: object
Determines whether this object is an external file object or can contain them.
3.5.9.0
is_external_file_object
Gets a value indicating whether this ScriptObject is is an external file object.
bool
True if it is an external file object; otherwise, False.
may_contain_external_file_objects
Gets a value indicating whether this ScriptObject or ScriptProject may contain external file objects.
The project root may always contain external file objects, those are not downloaded to the devices. Devices and Applications may contain files which are synchronized to the runtime, depending on the device description and settings.
bool
True if it may contain external file objects; otherwise, False
class
ScriptExternalFileObject.
ScriptExternalFileObject
Bases: ScriptExternalFileObject.ScriptExternalFileObjectMarker
Provides the actual functionality of the external file objects.
3.5.9.0
file_path
Gets the file path.
str
reference_mode
Gets the reference mode.
ExternalFileObject.ReferenceMode
auto_update_mode
Gets the auto update mode.
ExternalFileObject.AutoUpdateMode
change_modes
reference_mode
auto_update_mode=None
Changes the modes of the external file object.
reference_mode (ReferenceMode) -- The reference mode.
auto_update_mode (AutoUpdateMode) -- The auto update mode. This is optional, and only makes sense if reference_mode is set to ReferenceMode.LinkAndEmbed. Defaults to AutoUpdateMode.Never if omitted.
update
Updates this instance.
calculate_checksum
Calculates the checksum of the data.
The CRC 32 value of the data.
last_modification
Gets the last modification date.
DateTime
length
Gets the length of the data in bytes.
long
get_data
stream
filename
Gets the data as a byte array.
WARNING | |
---|---|
get_data(self) (1/3)
list <byte>
get_data(self, stream) (2/3)
Gets the data by writing it into the given stream.
get_data(self, filename) (3/3)
Gets the data by writing it to the specified filename.
create_edit_path
Gets the absolute path where this file reference is edited.
This is the absolute path itself if the file reference is linked to a file system object, or a temporary path if it is embedded into a project.
The edit path of this file reference.
class
ScriptExternalFileObject.
ScriptExternalFileObjectContainer
Bases: ScriptExternalFileObject.ScriptExternalFileObjectMarker
This interface is implemented by the project root, and by objects which can contain synchable external file objects.
The project root may always contain external file objects, those are not downloaded to the devices. Devices and Applications may contain files which are synchronized to the runtime, depending on the device description and settings.
3.5.9.0
create_external_file_object
file_path
name=None
reference_mode='ReferenceMode.Embed'
auto_update_mode='AutoUpdateMode.Never'
Creates an external file objects with the specified name.
file_path (str) -- The file path with the contents of the external file object.
name (str) -- The name. This is optional, if it is omitted, the filename will be extracted from the path.
reference_mode (ReferenceMode) -- The reference mode.
auto_update_mode (AutoUpdateMode) -- The automatic update mode.
The newly created external file object.