Module Expr Str Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias FunctionDef arguments args NameParam NameParam defaults body Expr Str For NameStore NameLoad body If Call AttributeLoad NameLoad attr NameLoad NameLoad body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults ListLoad Str Str Str Str Str Str body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListComp NameLoad comprehension NameStore NameLoad BoolOpAnd Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Call NameLoad NameLoad NameLoad Assign NameStore ListComp Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad comprehension NameStore NameLoad BoolOpAnd Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Call NameLoad NameLoad NameLoad For NameStore NameLoad body AugAssignAdd NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad Call NameLoad NameLoad Str attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd ListLoad Str Str Str Call NameLoad NameLoad keyword Num keyword AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args defaults body Expr Str TryExcept body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assert Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad Str attr NameLoad Exec Call NameLoad NameLoad Str Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Index Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd NameLoad Str Assign NameStore Call NameLoad Str Expr Call NameLoad NameLoad NameLoad NameLoad Print Call AttributeLoad Str attr NameLoad NameLoad Return Num handlers ExceptHandler type TupleLoad NameLoad NameLoad name NameStore body Print Call AttributeLoad Str attr Call NameLoad NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr Index Num Return Num decorator_list If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr Call NameLoad
N/A N/A Bundle up a collection of python servers for deployment to the
Amazon Web Services cloud on a single AMI instance. Creates a
self-extracting Python deployment file for use with AWS.

Every deployment starts with a deployment template, which is based on
template.py. This file should be copied and modified as appropriate
for the server in question. The deployment template file has comments
which describe each configurable aspect of an instance deployment
profile.

Invoke this script with the deployment template as the argument. The
output will be a file of the same basename with suffix: "_pkg.py" in
the same directory as the deployment template.

On execution, the new _pkg.py script will unpack the specified
python files and packages and run whatever setup script was specified
in the deployment template. The babysitter server is then run to start
the specified servers and monitor them.

The output executable is written to the current directory.
 N/A base64 N/A os N/A os.path N/A re N/A stat N/A string N/A subprocess N/A sys N/A zlib _FileMatches N/A N/A path excl_regexps N/A N/A N/A Returns true if the specified path matches none of the
  specified exclude regular expresions.
   N/A r excl_regexps N/A N/A N/A N/A re match r path N/A N/A False N/A True N/A _GetFilesRecursively N/A N/A path excl_regexps N/A N/A #.* \..+ .*~$ .*\.pyc$ .*_test.py$ .*_pkg.py$ N/A N/A Recursively walks the source directory and locates matching
  files. Returns a list of files.
   N/A entries N/A N/A os listdir path N/A dirs N/A e N/A e entries N/A N/A N/A N/A os path isdir N/A N/A N/A os path join path e N/A _FileMatches e excl_regexps N/A files N/A N/A N/A N/A os path join path e N/A e entries N/A N/A N/A N/A os path isfile N/A N/A N/A os path join path e N/A _FileMatches e excl_regexps N/A d dirs N/A N/A files N/A _GetFilesRecursively N/A N/A N/A os path join path d excl_regexps N/A files N/A _ReadFile N/A N/A path N/A N/A N/A N/A N/A N/A open path rb read N/A _Package N/A N/A template package_out files N/A N/A N/A Package up all files into a self-extracting python script
  suffixed by _pkg.py. This script has one potentially long data
  string, which is the encoded, gzipped contents of the deployment
  files. The files are a .tgz tarball and are un-archived into their
  original directory structure and permissions using subprocess to
  invoke tar.

  Once this is complete, the decode.py script is invoked.
   N/A p N/A N/A subprocess Popen N/A N/A tar czfH - N/A list files bufsize 4096 stdout N/A subprocess PIPE N/A N/A tarball stderr N/A N/A p communicate N/A out N/A open package_out w N/A N/A N/A out write #!/usr/bin/env python
 N/A N/A N/A out write import subprocess, base64, zlib, os, stat, sys
 N/A N/A N/A out write tarball = base64.b64decode(' N/A N/A N/A out write N/A N/A base64 b64encode tarball N/A N/A N/A out write ')
 N/A N/A N/A out write os.mkdir('viewfinder')
 N/A N/A N/A out write os.chdir('viewfinder')
 N/A N/A N/A out write p = subprocess.Popen([ "tar", "xzf", "-" ],
 N/A N/A N/A out write                      bufsize=4096, stdin=subprocess.PIPE)
 N/A N/A N/A out write p.communicate(input=tarball)
 N/A N/A N/A out write N/A N/A os.execv('./backend/prod/deploy.py', ['./backend/prod/deploy.py', '{0}'])
 format template N/A N/A N/A out close N/A N/A N/A os chmod package_out N/A stat S_IRWXU N/A main N/A N/A N/A N/A N/A Extract the deployment template from command line arguments,
  import it, gather the list files to package, and run the packer.
   N/A N/A N/A deploy_template N/A N/A sys argv N/A 1 N/A N/A N/A N/A os path isfile deploy_template N/A N/A deployment template {0} is not a file format deploy_template N/A N/A open deploy_template rb N/A deploy_name N/A N/A N/A N/A os path splitext N/A N/A N/A os path basename deploy_template N/A 0 N/A package_out N/A N/A N/A os path join N/A N/A N/A os path dirname deploy_template N/A deploy_name _pkg.py N/A files N/A _GetFilesRecursively ./ N/A N/A _Package deploy_name package_out files N/A N/A N/A {0} deployment packaged into {1} format deploy_template package_out N/A 0 N/A N/A N/A N/A IndexError AssertionError N/A err N/A N/A N/A N/A Error: {0}, Usage: {1} <deploy-template> format N/A str err N/A N/A N/A os path basename N/A N/A sys argv N/A 0 N/A -1 N/A N/A N/A __name__ __main__ N/A N/A N/A N/A sys exit N/A main