ArkAttribute objects support the following methods:
- GetName()
Return the name of the attribute.
- GetType()
Return the attribute type as it is used in the arKitect ('bool', 'int', 'str', 'pyscript', ...)
- GetValue()
Return the value of the attribute. The type of the returned object depends on the attribute type (Integer, Boolean, ...).
NB! If no value is set it will still return 0 for all numeric types - use HasValue() method if there is a need to understand whether attribute has got a value or not.
- HasValue()
Returns True if attribute has got a value - this method allows to distinguish no value from 0 value for numeric types (this method should be prefered when it is important to understand whether attribute has a value or not at all) SetValue( value )
Set the value of the attribute. The type of value must match the same rules used by GetValue().- ClearValue()
Remove the existing value of the attribute.
- Execute()
For the attributes of type 'Program': executes the code in the attribute. Method returns the value, returned by the code. For other attribute types, method raises a ValueError exceptio - IsModifiable()
Returns True if attribute value can be modified, False otherwise. - GetArkObj()
Returns ArkObj owner object.
Methods for "SavedFiles" attributes:
- DownloadFileSVN( fileName, folder=default files folder, revisionNumber=None)
For the attributes of type 'Saved files': Download chosen file to specified or default folder.
(revisionNumber parameter type : integer) if "revisionNumber" is not specified the latest is returned. Returns the path to the downloaded file
- UploadFileSVN( path, fileComment=None, revisionComment=None)
For the attributes of type 'Saved files': Upload chosen file on server side and add this file to attribute value. Optionally can set comment for the file.
If a standard file with the same name already exists, the file you are uploading will be added as a new version of that file. Third argument allows specifying revision message. Upload failed if a shared file with same name already exist. Returns the resulting revision number from SVN server. - GetFileRevisionListSVN(fileName)
Returns a list of dictionaries with the following keys ['user', 'time', 'description', 'file', 'revision'].
(Values are of type "String" except the last one: "revison" of type "Integer"). - RemoveFileSVN(fileName)
Remove the saved file from SVN using its "fileName". Deleted file also removed from the attribute attached file list. Can not be used with shared files, use DetachSharedFile for them.
- AttachSharedFile(fileName)
Attaches named shared saved file to the object. Shared file can't be attached if a standard file already exists in attribute with the same name. Doesn't check existence
- DetachSharedFile(fileName)
Detaches named shared saved file from the object. Doesn't check existence
Examples: