|
Revision 2550, 0.9 kB
(checked in by fperez, 3 years ago)
|
Small comment/formatting cleanups
|
| Line | |
|---|
| 1 |
"""Toy example of a TConfig-based configuration description. |
|---|
| 2 |
""" |
|---|
| 3 |
|
|---|
| 4 |
import enthought.traits.api as T |
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
import tconfig; reload(tconfig) |
|---|
| 8 |
from tconfig import TConfig |
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
class IPythonConfig(TConfig): |
|---|
| 12 |
"""Class Docstring |
|---|
| 13 |
|
|---|
| 14 |
More |
|---|
| 15 |
|
|---|
| 16 |
And more... |
|---|
| 17 |
""" |
|---|
| 18 |
|
|---|
| 19 |
m = T.Int(123) |
|---|
| 20 |
|
|---|
| 21 |
select = T.Trait('only','one','of','these') |
|---|
| 22 |
|
|---|
| 23 |
class InitOnly(TConfig): |
|---|
| 24 |
""" |
|---|
| 25 |
The Read-only part of the configuration. |
|---|
| 26 |
|
|---|
| 27 |
More than one line of info... |
|---|
| 28 |
""" |
|---|
| 29 |
n = T.Int |
|---|
| 30 |
x = T.Float |
|---|
| 31 |
|
|---|
| 32 |
class Protocol(TConfig): |
|---|
| 33 |
"""Specify the Protocol |
|---|
| 34 |
|
|---|
| 35 |
More text... |
|---|
| 36 |
""" |
|---|
| 37 |
include = T.Str |
|---|
| 38 |
ptype = T.Str |
|---|
| 39 |
|
|---|
| 40 |
class Handler(TConfig): |
|---|
| 41 |
"""Specify the handler, a string. |
|---|
| 42 |
|
|---|
| 43 |
More...""" |
|---|
| 44 |
key = T.Str |
|---|
| 45 |
key2 = T.Str |
|---|
| 46 |
|
|---|
| 47 |
class Machine(TConfig): |
|---|
| 48 |
"""Set the machine by ip address and port number.""" |
|---|
| 49 |
ip = T.Str |
|---|
| 50 |
port = T.Int |
|---|