binlock.defaults
Defines sane defaults for internal operations.
These may be changed in your program if necessary, but please refer to the documentation for notes and constraints.
Module Attributes
The default file extension for a lock file. |
|
Total size of a .lck file, in bytes. |
|
Maximum character length of an allowed lock name. |
|
Default name to use on the lock, if none is provided to the constructor. |
- binlock.defaults.DEFAULT_FILE_EXTENSION: str = '.lck'
The default file extension for a lock file. This should remain
.lckfor typical Avid environments.
- binlock.defaults.TOTAL_FILE_SIZE: int = 255
Total size of a .lck file, in bytes. This should remain
255for typical Avid environments.
- binlock.defaults.MAX_NAME_LENGTH: int = 22
Maximum character length of an allowed lock name.
There does not appear to be a hard limit (beyond
TOTAL_FILE_SIZE//2 since we’re dealing with UTF-16), but in practice, Avid Media Composer truncates long names to a maximum of22characters with an ellipsis. Thus, to be safe,22seems to be a sane maximum length, but you may wish to change this for experimental purposes.
- binlock.defaults.DEFAULT_LOCK_NAME: str = 'build-27519594-project'
Default name to use on the lock, if none is provided to the constructor.
In normal use, Avid uses the machine’s hostname for the lock name, so I’m using
_default_name_from_hostname()to evaulate the hostname when the module is first loaded (rather than each time a lock is created, to avoid the overhead).