@task
def code_install():
 assert env.host_string, 'no hosts specified'
 assert (not is_old_code()), 'Active code is using the old style (directory instead of symlink). Manual intervention required'
 rev = code_prep()
 if code_verify(rev):
  return
 fprint(('Installing code (rev %s)' % rev))
 filename = ('viewfinder.%s.tar.gz' % rev)
 dirname = ('viewfinder.%s' % rev)
 put(filename, ('~/%s' % filename))
 run(('mkdir -p ~/%s' % dirname))
 with cd(('~/%s' % dirname)):
  run(('tar xzvf ../%s' % filename))
 run(('mkdir -p ~/%s/pythonpath' % dirname))
 with cd(('~/%s/pythonpath' % dirname)):
  run(('ln -f -s ~/%s viewfinder' % dirname))
 run(('rm -f ~/%s' % filename))
 code_cleanup()

@ task def code_install ( ) : assert env . host_string , 'no hosts specified' assert ( not is_old_code ( ) ) , 'Active code is using the old style (directory instead of symlink). Manual intervention required' rev = code_prep ( ) if code_verify ( rev ) : return fprint ( ( 'Installing code (rev %s)' % rev ) ) filename = ( 'viewfinder.%s.tar.gz' % rev ) dirname = ( 'viewfinder.%s' % rev ) put ( filename , ( '~/%s' % filename ) ) run ( ( 'mkdir -p ~/%s' % dirname ) ) with cd ( ( '~/%s' % dirname ) ) : run ( ( 'tar xzvf ../%s' % filename ) ) run ( ( 'mkdir -p ~/%s/pythonpath' % dirname ) ) with cd ( ( '~/%s/pythonpath' % dirname ) ) : run ( ( 'ln -f -s ~/%s viewfinder' % dirname ) ) run ( ( 'rm -f ~/%s' % filename ) ) code_cleanup ( )
install latest code from local directory .