GXWA class¶
-
class
geosoft.gxapi.
GXWA
¶ The WA class enables you to access and write data to ASCII files.
-
static
create
((str)arg1, (int)arg2) → GXWA:¶ Creates an ASCII file to write to.
Parameters: - arg1 (str) – Name of the File
- arg2 (int) – WA_OPEN constants
Returns: WA Handle
Return type: New in version 5.0.0.
Note:
ANSI Encoding is assumed, See
geosoft.gxapi.GXWA.create_ex()
to override this.
-
static
create_ex
((str)arg1, (int)arg2, (int)arg3) → GXWA:¶ Creates an ASCII file to write to.
Parameters: - arg1 (str) – Name of the File
- arg2 (int) – WA_OPEN constants
- arg3 (int) – WA_ENCODE constants
Returns: WA Handle
Return type: New in version 6.2.0.
Note:
Before version 6.2. text in on the GX API level were handled as characters in the current ANSI code page defining how characters above ASCII 127 would be displayed. 6.2. introduced Unicode in the core montaj engine that greatly increased the number of symbols that can be used. The WA_ENCODE constants were introduce that controls how text are written to files on disk with the WA class.
-
static
create_sbf
((GXSBF)arg1, (str)arg2, (int)arg3) → GXWA:¶ Creates an ASCII file to write to in an SBF.
Parameters: - arg1 (
geosoft.gxapi.GXSBF
) – Storage - arg2 (str) – Name of the File
- arg3 (int) – WA_OPEN constants
Returns: WA Handle
Return type: New in version 5.0.0.
Note:
See sbf.gxh. ANSI Encoding is assumed, See
geosoft.gxapi.GXWA.create_sbf_ex()
to override this.- arg1 (
-
static
create_sbf_ex
((GXSBF)arg1, (str)arg2, (int)arg3, (int)arg4) → GXWA:¶ Creates an ASCII file to write to in an SBF.
Parameters: - arg1 (
geosoft.gxapi.GXSBF
) – Storage - arg2 (str) – Name of the File
- arg3 (int) – WA_OPEN constants
- arg4 (int) – WA_ENCODE constants
Returns: WA Handle
Return type: New in version 6.2.0.
Note:
Also see sbf.gxh Before version 6.2. text in on the GX API level were handled as characters in the current ANSI code page defining how characters above ASCII 127 would be displayed. 6.2. introduced Unicode in the core montaj engine that greatly increased the number of symbols that can be used. The WA_ENCODE constants were introduce that controls how text are written to files on disk with the WA class.
- arg1 (
-
is_null
() → bool¶ Check if the instance of
geosoft.gxapi.GXWA is null (undefined)
Returns: True if this is a null instance of geosoft.gxapi.GXWA
, False otherwise.Return type: bool`
-
new_line
() → None:¶ Forces a new line in the WA object.
Returns: Nothing Return type: None New in version 5.0.0.
-
static
null
() → GXWA¶ A null (undefined) instance of
geosoft.gxapi.GXWA
Returns: A null geosoft.gxapi.GXWA
Return type: geosoft.gxapi.GXWA
-
puts
((str)arg1) → None:¶ Writes a string to the file.
Parameters: arg1 (str) – String to write Returns: Nothing Return type: None New in version 5.0.0.
-
static
WA_ENCODE constants¶
WA Encode defines
-
gxapi.
WA_ENCODE_ANSI
= 0¶
Current Ansi Code Page (Conversion from UTF-8 data, if an exisiting BOM header found with WA_APPEND,
encoding will switch to WA_ENCODE_UTF8)
-
gxapi.
WA_ENCODE_RAW
= 1¶
Write all data without any conversion check
-
gxapi.
WA_ENCODE_UTF8
= 2¶
UTF8 (If no exisiting BOM header found with WA_APPEND, encoding will switch to WA_ENCODE_ANSI)
-
gxapi.
WA_ENCODE_UTF8_NOHEADER
= 3¶
UTF8 w.o. header (will assume UTF8 encoding if WA_APPEND is used)
-
gxapi.
WA_ENCODE_UTF16_NOHEADER
= 4¶
UTF16 w.o. header (will assume UTF16 encoding if WA_APPEND is used)