Page 1
THE NEXT ITERATION OF YOUR GUI
PEP 342 (Coroutines via Enhanced Generators) PEP 380 (Syntax for Delegating to a Subgenerator)
conceptive.be @erikjanssshore.be @jeroendierckxpython-camelot.com
Page 2
WHAT'S GOING ONinteraction
Page 3
TRADEOFFS
user friendlinesssimplicity of development
testability
Page 4
TRADEOFFSuser friendliness
Page 5
• use a progress indicator
• provide a cancel button
• respond to events
• similar controls as in other places
USER FRIENDLINESSOSX human interface guidlines
Page 6
USER FRIENDLINESSMultithreaded toolkits - A failed dream?
Graham Hamiltonhttps://weblogs.java.net/blog/kgh/archive/2004/10/multithreaded_t.html
Page 7
TRADEOFFSsimplicity of development
Page 8
TRADEOFFStestability
Page 9
TRADEOFFStestability
Page 10
EXAMPLE APPLICATIONprocess pickinglist
Page 11
PROCESS PICKINGLISTstep one. scan items in warehouse
example application
Page 12
PROCESS PICKINGLISTstep two. import scanned lines
example application
Page 13
PROCESS PICKINGLISTstep two. import scanned lines
example application
Page 14
PROCESS PICKINGLISTstep three. verify import data
example application
Page 15
PROCESS PICKINGLISTpossible issues. freeze
example application
Page 16
PROCESS PICKINGLISTpossible issues. exceptions
example application
Page 17
PROCESS PICKINGLISTshow and tell
example application
Page 18
THE COMPETITION
user friendlinesssimplicity of development
testability
Page 20
TRADEOFFSuser friendliness
Page 21
TRADEOFFStestability
Page 22
TRADEOFFSsimplicity of development
Page 23
user friendlinesssimplicity of development
testability
BALANCEvisual basic
Page 25
TRADEOFFSuser friendliness
Page 26
TRADEOFFStestability
Page 27
TRADEOFFSsimplicity of development
Page 28
BALANCEjava
user friendlinesssimplicity of development
testability
Page 29
PYTHONunique language features
Page 30
PEP 255Simple generators
Page 31
PEP 342Coroutines via Enhanced Generators
Page 32
PEP 342Coroutines via Enhanced Generators
1. Redefine `yield` to be an expression2. Add a new send() method3. Add a new throw() method4. Allow "yield" to be used in try/finally blocks
Page 33
PEP 342An application as a series of action steps
Page 34
EXAMPLE APPLICATIONselect a file
PEP 342
Page 35
• ChangeObject
• ChangeObjects
• PrintChart
• PrintPreview
• PrintHtml
ACTION STEPS
• PrintJinjaTemplate
•OpenFile
•OpenStream
•OpenJinjaTemplate
• CloseView
•MessageBox
• Refresh
•OpenFormView
• ShowPixmap
• ShowChart
• SelectFile
• SelectObject
out of the box in Camelot
Page 36
EVENT LOOP INTEGRATIONUsing multiple threads to prevent freezes
Page 37
EXAMPLE APPLICATIONimport data
event loop integration
Page 38
EXCEPTIONSwait ... what?
Page 39
EXAMPLE APPLICATIONuser cancels import
Page 40
•get_collection
•get_selection
•get_object
WHAT'S THE CONTEXT
obligatory xkcd comic
Page 42
UNITTESTINGexample application in action and code ...
Page 44
BALANCEpython (camelot)
user friendlinesssimplicity of development
testability
Page 45
PEP 380delegating to a subgenerator
Page 46
THE NEXT ITERATION OF YOUR GUI
PEP 342 (Coroutines via Enhanced Generators) PEP 380 (Syntax for Delegating to a Subgenerator)
python-camelot.com
conceptive.be @erikjanssshore.be @jeroendierckx
Page 47
THE NEXT ITERATION OF YOUR GUI
PEP 342 (Coroutines via Enhanced Generators) PEP 380 (Syntax for Delegating to a Subgenerator)
python-camelot.comThanks !Questions ?
We’re hiring !
conceptive.be @erikjanssshore.be @jeroendierckx