The next version of the Kiosk code is up on my github now. I cleaned things up to the point where customizing it is easy thanks to configparser. Why have I never seen this library before?
Here's a sample configuration file.
# Kiosk Settings
# cycler settings...
[kiosk_cycler]
# location of where to toss things
file_location = /Users/fossrit/Desktop
# host to ping to test for a working internet connection
ping_host = www.google.com
# number of times to retry a connection. -1 for unending attempts
ping_counter = 3
# number of seconds to wait in between ping attempts
ping_timer = 30
# list of hosts for the feeds. Follows the format:
# host : /location
# candidate feeds are delimited by commas.
feed_hosts = foss.rit.edu : /files/bookmarks.rss, cs.rit.edu : /~ear7631/feed.rss
And here's the python code to parse it.
parser = SafeConfigParser()
parser.read('kiosk_config')
file_location = parser.get('kiosk_cycler', 'file_location')
ping_host = parser.get('kiosk_cycler', 'ping_host')
ping_counter = int(parser.get('kiosk_cycler', 'ping_counter'))
ping_timer = int(parser.get('kiosk_cycler', 'ping_timer'))
feed_hosts_dirty = parser.get('kiosk_cycler', 'feed_hosts')
Easy, isn't it? I was also messing around with wxWoof, too, and finally got around to tinkering with wxPython a bit more. You can look at the full code here, but I really just wanted to share how easy adding drag-and-drop functionality is. My goal was to make a button that, not only brought up a file selection if clicked, but had file recognized drag-and-drop implemented as well. All that really needs to be done is hook up a FileDropTarget to your container, which handles the magic.
self.boxButton.SetDropTarget(self.dropTarget)
self.dropTarget = FileDropTarget(self.boxButton)
After that it's just a matter of hooking up the OnDropFiles function your FileDropTarget.
I've now started working with html5 forms, jquery, and the twisted web framework, so there will be posts on my experiences with these in the coming days.
I've now started working with html5 forms, jquery, and the twisted web framework, so there will be posts on my experiences with these in the coming days.
No comments:
Post a Comment