Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel

Table of Contents
maxLevel3

Introduction

On this page, we will cover the following:

  1. Setting up extension.py to handle Cancellation
  2. 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
languagepy
titleextension.py::extension_cancel
linenumberstrue
collapsetrue
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.

< Previous     Next >