Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| # docker build -t ubuntu1604py36 | |
| FROM ubuntu:16.04 | |
| RUN apt-get update && \ | |
| apt-get install -y software-properties-common && \ | |
| add-apt-repository ppa:jonathonf/python-3.6 | |
| RUN apt-get update | |
| RUN apt-get install -y build-essential python3.6 python3.6-dev python3-pip python3.6-venv | |
| RUN apt-get install -y git |
| import sys, marshal, functools, subprocess | |
| child_script = """ | |
| import marshal, sys, types; | |
| fn, args, kwargs = marshal.load(sys.stdin) | |
| marshal.dump( | |
| types.FunctionType(fn, globals())(*args, **kwargs), | |
| sys.stdout) | |
| """ |
| #!/usr/bin/env python | |
| import os | |
| import re | |
| import subprocess | |
| import sys | |
| modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)') | |
| CHECKS = [ |
| This playbook has been removed as it is now very outdated. |
| #!/bin/bash | |
| ############################################### | |
| # To use: | |
| # https://raw.github.com/gist/2776351/??? | |
| # chmod 777 install_postgresql.sh | |
| # ./install_postgresql.sh | |
| ############################################### | |
| echo "*****************************************" | |
| echo " Installing PostgreSQL" | |
| echo "*****************************************" |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!