Mako template code refactor

Mostly refactored some of our common/logical operations into functions in order to clean up the code a bit. This was also done to facilitate better API interaction as galaxy adds API functionality for IEs; we'll be able to remove the current functional call and replace with a call to galaxy's API.
Yeah absolutely. I always forget how to write ternaries in python so I usually do it like that. If you make the change make sure they're lower case strings.

On September 13, 2014 7:53:03 PM GMT+00:00, "Björn Grüning" <notifications@github.com> wrote:
>> +            occupied_ports.add( int(local_port) )
>> +
>> +    # Generate random free port number for our docker container
>> +    while True:
>> +        port = random.randrange(10000,15000)
>> +        if port not in occupied_ports:
>> +            break
>> +    return port
>> +
>> +def generate_pasword(length=12):
>> +    return
>''.join(random.choice('0123456789abcdefghijklmnopqrstuvwxyz') for _ in
>range(length))
>> +
>> +def javascript_boolean(boolean):
>> +    """
>> +        Convenience function to convert boolean for use in JS
>> +    """
>
>Would ```return  "True" if boolean else "False"``` be better?
>
>---
>Reply to this email directly or view it on GitHub:
>https://github.com/bgruening/galaxy-ipython/pull/22/files#r17514102

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.