Copyright (c) Hyperion Entertainment and contributors.

Difference between revisions of "AmigaOS Manual: Python Modules and Packages"

From AmigaOS Documentation Wiki
Jump to navigation Jump to search
(Added modules arexx and asl)
(Added function descriptions)
Line 13: Line 13:
   
 
== asl ==
 
== asl ==
  +
  +
This module contains AmigaOS-specific requester function for file and path queries, message boxes, ans similar aspects.
   
 
=== Functions ===
 
=== Functions ===
* FileRequest
+
==== FileRequest ====
  +
* MessageBox
 
  +
; Format
  +
: drawer, file = FileRequest ( title, drawer, filename, pattern )
  +
  +
Opens a file select requester with the given title, the drawer and filename gadgets predefined by drawer and title. If a pattern is given, a pattern gadget is also displayed and pre-set with the given pattern. The result is a tuple drawer, filename which relects the choice of the user.
  +
  +
; Example:
  +
Opens up a file requester in T: with 'my.log' as a default name, and a filter set to '#?.log':
  +
<syntaxhighlight lang="python">
  +
drawer, file = asl.FileRequest('Python File Request', 'T:', 'my.log', '#?.log' )
  +
</syntaxhighlight>
  +
  +
==== MessageBox ====
  +
  +
; Format
  +
result = MessageBox( title, body_text, buttons )
  +
  +
Opens a message box with the given title and body text. The options on the dialog are taken from the 'buttons' argument. The 'buttons' string contains individual substrings separated by a '|'.
  +
  +
The result of this function is the button number selected by the user. Numbering starts from left with 1, 2 and so on, but the final button is 0.
  +
  +
; Example:
  +
Puts up a requester asking for a 'Yes' or 'No' answer:
  +
<syntaxhighlight lang="python">
  +
result = asl.MessageBox('Python Request', 'AmigaOS rules', 'Yes|No')
  +
</syntaxhighlight>
  +
Selecting 'Yes' returns 1 and selecting 'No' returns 0.
   
 
=== Variables ===
 
=== Variables ===

Revision as of 17:24, 3 January 2019

Modules

arexx

Functions

  • Msg
  • Port
  • dorexx

Variables

  • __doc__
  • __file__
  • __name__

asl

This module contains AmigaOS-specific requester function for file and path queries, message boxes, ans similar aspects.

Functions

FileRequest

Format
drawer, file = FileRequest ( title, drawer, filename, pattern )

Opens a file select requester with the given title, the drawer and filename gadgets predefined by drawer and title. If a pattern is given, a pattern gadget is also displayed and pre-set with the given pattern. The result is a tuple drawer, filename which relects the choice of the user.

Example

Opens up a file requester in T: with 'my.log' as a default name, and a filter set to '#?.log':

drawer, file = asl.FileRequest('Python File Request', 'T:', 'my.log', '#?.log' )

MessageBox

Format

result = MessageBox( title, body_text, buttons )

Opens a message box with the given title and body text. The options on the dialog are taken from the 'buttons' argument. The 'buttons' string contains individual substrings separated by a '|'.

The result of this function is the button number selected by the user. Numbering starts from left with 1, 2 and so on, but the final button is 0.

Example

Puts up a requester asking for a 'Yes' or 'No' answer:

result = asl.MessageBox('Python Request', 'AmigaOS rules', 'Yes|No')

Selecting 'Yes' returns 1 and selecting 'No' returns 0.

Variables

  • __doc__
  • __file__
  • __name__

Packages