Panel | ||||
---|---|---|---|---|
|
Introduction
On this page, we will cover the following:
- Setting up extension.py to handle Cancellation
- Issuing the Cancel command
Step 1 - Setting Up extension.py
to Handle Cancellation
With this extension, it is a little hard to demonstrate cancel functionality in a meaningful manner. So, the feature will be demonstrated using a contrived example.
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
def extension_cancel(self): print('setting self.wait to False') self.wait = False |
Step 2 - Issuing the Cancel Command
The idea is that extension_start
will be stuck in the infinite while-loop, and the only way to exit is if extension_cancel
is called. Go ahead and launch any of the extension_start
configurations, and perform the actions shown below:
...
As you can see in the execution above, the while-loop exited once Cancel
was pressed, which results in extension_cancel
being called.