|
Revision 3, 1.3 kB
(checked in by paul, 5 years ago)
|
Set eol-style to native
|
- Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 |
''' dabo: main.py |
|---|
| 2 |
|
|---|
| 3 |
This is a default script, which you should either copy or |
|---|
| 4 |
completely replace for your custom app. It allows you the |
|---|
| 5 |
flexibility of choosing whether you want to use the dabo |
|---|
| 6 |
framework's app object directly, or perhaps you would rather |
|---|
| 7 |
subclass and extend Dabo's app object. |
|---|
| 8 |
|
|---|
| 9 |
Start your app with a main.py script like this one, that imports |
|---|
| 10 |
an app object and starts the event loop. Don't put much functionality |
|---|
| 11 |
here, as Python doesn't compile main scripts. 'Tis just a |
|---|
| 12 |
Dabo wrapper... |
|---|
| 13 |
|
|---|
| 14 |
If you want to not think about anything at all, just copy this |
|---|
| 15 |
to the root of your custom application directory. |
|---|
| 16 |
|
|---|
| 17 |
If you want to go the subclassing route, you'll need to write your |
|---|
| 18 |
own customApp.py script, put it in the root of your custom app |
|---|
| 19 |
directory, make sure your app object subclasses dabo's app |
|---|
| 20 |
object, and then change the import line to: |
|---|
| 21 |
|
|---|
| 22 |
import customApp as daboApp |
|---|
| 23 |
|
|---|
| 24 |
and it should work fine. Unless you really want to extend the app |
|---|
| 25 |
object, though, just stick with using the daboApp directly. |
|---|
| 26 |
|
|---|
| 27 |
Dabo is fun to say! |
|---|
| 28 |
''' |
|---|
| 29 |
|
|---|
| 30 |
if __name__ == "__main__": |
|---|
| 31 |
import dabo.daboApp as daboApp # dabo must be in PYTHONPATH (hint:site-packages) |
|---|
| 32 |
app = daboApp.MainApp() |
|---|
| 33 |
app.setup() |
|---|
| 34 |
app.MainLoop() |
|---|