Skip to content

Instantly share code, notes, and snippets.

@shanel
shanel / gist:3189240
Created July 27, 2012 17:24
MVC Thoughts and such...
Currently there isn't really any division between Model and Controller in the control panel. Views are _mostly_ separate into html/Mako templates. This means the big thing we need to do is create that division of Model and Controller. For the most part, CherryPy and its linking of method names to urls is basically doing most of the Controller-like heavy lifting. We are going to want to create Models of the different things (interfaces, webapps, etc) and have a way of letting them access and update their state.
In an ideal world we would break out and refactor files into different directories following a standard MVC setup:
models/
models/wired_network.py
models/wireless_network.py
models/mesh.py
models/daemon.py
models/webapp.py
@shanel
shanel / tuple.rb
Created May 15, 2012 19:47 — forked from kivanio/tuple.rb
Ruby Tuple Class
class Tuple < Array
def initialize(*args)
@array = args.dup.freeze
end
def each(&block)
@array.each(&block)
end
def first