@@ -0,0 +1,2279 @@
+import os%0Aimport re%0Aimport platform%0Aimport subprocess%0Aimport yaml%0Aimport distutils.spawn%0A%0A# define some terminal colours to use%0Aclass bcolors:%0A  GOOD = '%5C033%5B92m'%0A  BAD = '%5C033%5B91m'%0A  RESET = '%5C033%5B0m'%0A%0A# define some icons to use%0Aprint_tick = bcolors.GOOD + u%22%5Cu2713%22 + bcolors.RESET%0Aprint_cross = %09bcolors.BAD + u%22%5Cu2A2F%22 + bcolors.RESET%0A%0A# define supported package managers%0Apackage_managers = %5B'yum', 'apt-get', 'pacman', 'emerge'%5D%0Apackage_manager = %22None%22%0A%0A# detect if an application with the provided name is installed%0Adef is_installed(name):%0A  return distutils.spawn.find_executable(name) is not None%0A%0A# check which package manager is installed%0Afor manager in package_managers:%0A  if is_installed(manager):%0A    package_manager = manager%0A%0A# load the manifest file in%0Awith open('manifest.yml', 'r') as f:%0A  try:%0A    manifest = yaml.load(f)%0A  except:%0A    print %22Invalid yaml file%22%0A    exit(0)%0A%0Aprint %22loaded manifest%22%0A%0Ato_install = %5B%5D%0Aunable_to_satisfy = %5B%5D%0A%0A# loop through the manifest setting up the environment%0Aif manifest.has_key('dependancies'):%0A  print %22Checking dependancies%22%0A  cmd = %22where%22 if platform.system() == %22Windows%22 else %22which%22%0A  for dependancy in manifest%5B'dependancies'%5D:%0A    if isinstance(dependancy, basestring):%0A      if is_installed(dependancy):%0A        print (print_tick + dependancy)%0A      else:%0A        print (print_cross + dependancy)%0A        FNULL = open(os.devnull, 'w')%0A        output = subprocess.Popen(%5Bpackage_manager, 'provides', dependancy%5D, stdout=subprocess.PIPE, stderr=FNULL)%0A        provides = output.stdout.read()%0A        found_a_package_to_satisfy_dependancy = False%0A        for result in provides.split('%5Cn'):%0A          if dependancy in result:%0A            package = result.split(' ')%5B0%5D%0A            to_install.append(package)%0A            found_a_package_to_satisfy_dependancy = True%0A        if found_a_package_to_satisfy_dependancy == False:%0A          unable_to_satisfy.append(dependancy)%0A  print %22%5Cr%5Cn%22%0A%0Aif len(to_install) %3E 0:%0A  print %22Packages to install%22%0A  for package in to_install:%0A    print bcolors.GOOD + package + bcolors.RESET%0A  print %22%5Cr%5Cn%22%0A%0Aif len(unable_to_satisfy) %3E 0:%0A  print %22Unable to satisfy dependancies:%22%0A  for application in unable_to_satisfy:%0A    print bcolors.BAD + application + bcolors.RESET%0A  print %22%5Cr%5Cn%22%0A

Create node.py