| create_simg | Create an SIMG version of a file. |
| get_simg_contents | Returns the contents of this SIMG. |
| get_simg_header | Returns the header of this SIMG. |
| has_simg | Returns true if this string has an SIMG header. |
| valid_simg | Return true if this is a valid SIMG. |
| SIMGHeader | Container for an SIMG header. |
Create an SIMG version of a file.
>>> from cxmanage_api.simg import create_simg
>>> simg = create_simg(contents='foobarbaz')
>>> simg
'SIMG\x02\x00\x00\x00<\x00\x00\x00\t\x00\x00\x00\x00\x00\x00
\x00\xff\xff\xff\xffK\xf3\xea\x0c\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00foobarbaz'
| Parameters: |
|
|---|---|
| Returns: | String representation of the SIMG file. |
| Return type: | string |
Returns the contents of this SIMG.
>>> from cxmanage_api.simg import get_simg_contents
>>> get_simg_contents(simg=simg)
'foobarbaz'
| Parameters: | simg (string) – Path to SIMG file. |
|---|---|
| Returns: | Contents of this SIMG. |
| Return type: | string |
Returns the header of this SIMG.
>>> from cxmanage_api.simg import get_simg_header
>>> get_simg_header(x)
<cxmanage_api.simg.SIMGHeader instance at 0x7f4d1ce9aef0>
| Parameters: | simg (string) – Path to SIMG file. |
|---|---|
| Returns: | The SIMG header. |
| Return type: | string |
| Raises ValueError: | |
| If the SIMG cannot be read. | |
Returns true if this string has an SIMG header.
>>> from cxmanage_api.simg import create_simg
>>> simg=create_simg(contents='foobarbaz')
>>> from cxmanage_api.simg import has_simg
>>> has_simg(simg=simg)
True
| Parameters: | simg (string) – SIMG string (representation of a SIMG file). |
|---|---|
| Returns: | Whether or not the string has a SIMG header. |
| Return type: | boolean |
Return true if this is a valid SIMG.
>>> from cxmanage_api.simg import create_simg
>>> simg=create_simg(contents='foobarbaz')
>>> from cxmanage_api.simg import valid_simg
>>> valid_simg(simg=simg)
True
| Parameters: | simg (string) – SIMG string (representation of a SIMG file). |
|---|---|
| Returns: | Whether or not the SIMG is valid. |
| Return type: | boolean |