ianmiell/shutit — pull request #28 by aidanhs (2014-05-19 00:57:16+00:00)
Title: Split up setup (and more)

Plus some other goodies.

First, the split. Serve mode actually starts in a reasonable amount of time because
a) setup has been renamed to conn_docker, and only contains stuff to connect initially to docker
b) a new setup module has been created to hold apt-get update etc. This happens immediately pre-build as it's module id 0, but mostly has no special significance.
conn_docker is new type of module I've called 'conn'. If shutit were to become generic, all docker specific stuff could be contained in there (e.g. I've already move tag_and_push into the finalize of conn_docker).
On a somewhat related note, the setup module now understands some configs. So if we wanted to speed up tests, we could disable updating and passwd/sudo installs in setup since they won't be used.

Next, I've trimmed down a bit of syntax for adding a module. So
```
if not util.module_exists('shutit.tk.mysql.mysql'):
obj = mysql('shutit.tk.mysql.mysql',0.318,'ShutIt MySql module. Sets up a user/password and the root password.')
obj.add_dependency('shutit.tk.setup')
util.get_shutit_modules().add(obj)
ShutItModule.register(mysql)
```
would become
```
def module():
obj = mysql('shutit.tk.mysql.mysql',0.318,'ShutIt MySql module. Sets up a user/password and the root password.')
obj.add_dependency('shutit.tk.setup')
return obj
```
I've not changed this in most places yet.

Third, I've reworked all the prompt setup and revert stuff.
I'm not entirely sure that revert_prompt is useful very much (you don't need to revert if you're exiting the prompt, per my changes in the mysql module and test 4).

Fourth, I've put another example of send_file in the mysql module.