Skip to content

Commit 89444ab

Browse files
Merge pull request #22 from jonathanrocher/feature/add_stage_4.0
Add hello world in pyface.
2 parents 800d55a + ddb8bb3 commit 89444ab

File tree

13 files changed

+127
-0
lines changed

13 files changed

+127
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Hello world in ETS pyface!
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
__version__ = "0.0.1"

stage4.0_first_application/pycasa/app/__init__.py

Whitespace-only changes.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# coding=utf-8
2+
""" TaskApplication object for the Pycasa app.
3+
"""
4+
import logging
5+
6+
from pyface.tasks.api import TasksApplication, TaskFactory
7+
from ..ui.tasks.hello_world_task import HelloWorldTask
8+
9+
logger = logging.getLogger(__name__)
10+
11+
12+
class PycasaApplication(TasksApplication):
13+
""" An application to say hello.
14+
"""
15+
id = "pycasa_application"
16+
17+
name = "Pycasa"
18+
19+
description = "An example Tasks application that explores image files."
20+
21+
def _task_factories_default(self):
22+
return [
23+
TaskFactory(
24+
id='pycasa.hello_world_task',
25+
name="Hello World Editor",
26+
factory=HelloWorldTask
27+
)
28+
]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
from pycasa.app.app import PycasaApplication
3+
4+
5+
def main():
6+
app = PycasaApplication()
7+
app.run()
8+
9+
10+
if __name__ == '__main__':
11+
main()

stage4.0_first_application/pycasa/model/__init__.py

Whitespace-only changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from traits.api import HasStrictTraits, Str
2+
3+
4+
class HelloWorldModel(HasStrictTraits):
5+
6+
content = Str
7+
8+
def _content_default(self):
9+
return "Hello World!"

stage4.0_first_application/pycasa/ui/__init__.py

Whitespace-only changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from traits.api import Instance
2+
3+
from traitsui.api import Item, ModelView, View
4+
5+
from ..model.hello_world import HelloWorldModel
6+
7+
8+
class HelloWorldView(ModelView):
9+
model = Instance(HelloWorldModel, ())
10+
11+
def traits_view(self):
12+
return View(
13+
Item("model.content")
14+
)

stage4.0_first_application/pycasa/ui/tasks/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)