parameters: ()
docstring: Internal function, configures the correct environment directories
docstring_summary: Internal function, configures the correct environment directories
docstring_tokens: Internal function configures the correct environment directories
function: def _setup():
      '''
      Internal function, configures the correct environment directories
      '''
      if not files.exists(os.path.join(TOOL_DIR, 'apps')):
          sudo('mkdir -p "%(dir)s"' % {'dir': os.path.join(TOOL_DIR, 'apps')})
  
      if not files.exists(os.path.join(TOOL_DIR, 'apps', 'core')):
          sudo('mkdir -p "%(dir)s"' % {'dir': os.path.join(TOOL_DIR, 'apps', 'core')})
  
      if not files.exists(os.path.join(TOOL_DIR, 'apps', 'core', 'releases')):
          sudo('mkdir -p "%(dir)s"' % {'dir': os.path.join(TOOL_DIR, 'apps', 'core', 'releases')})
  
      if not files.exists(os.path.join(TOOL_DIR, 'apps', 'bot')):
          print('Cloning repo')
          sudo('git clone "%(url)s" "%(dir)s"' % {
              'dir': os.path.join(TOOL_DIR, 'apps', 'bot'),
              'url': BOT_REPO_URL
          })
  
      if not files.exists(os.path.join(TOOL_DIR, 'apps', 'utils')):
          print('Cloning repo')
          sudo('git clone "%(url)s" "%(dir)s"' % {
              'dir': os.path.join(TOOL_DIR, 'apps', 'utils'),
              'url': UTIL_REPO_URL
          })
  
      if not files.exists(os.path.join(TOOL_DIR, 'apps', 'report_interface')):
          print('Cloning repo')
          sudo('git clone "%(url)s" "%(dir)s"' % {
              'dir': os.path.join(TOOL_DIR, 'apps', 'report_interface'),
              'url': UI_REPO_URL
          })
  
      sudo('ln -sf %(release)s %(current)s' % {
          'release': os.path.join(TOOL_DIR, 'apps', 'report_interface'),
          'current': os.path.join(TOOL_DIR, 'public_html').rstrip('/'),
      })
  
  
      if not files.exists(os.path.join(TOOL_DIR, 'node')):
          print('Installing node')
          sudo('wget https://nodejs.org/dist/v6.10.0/node-v6.10.0-linux-x64.tar.xz')
          sudo('tar -xvf node-v6.10.0-linux-x64.tar.xz')
          sudo('rm -f node-v6.10.0-linux-x64.tar.xz')
          sudo('mv node-v6.10.0-linux-x64 node')
  
      if not files.exists(os.path.join(TOOL_DIR, 'node_modules', 'irc')):
          sudo('/data/project/cluebotng/node/bin/npm install irc')
function_tokens: def _setup ( ) : if not files . exists ( os . path . join ( TOOL_DIR , 'apps' ) ) : sudo ( 'mkdir -p "%(dir)s"' % { 'dir' : os . path . join ( TOOL_DIR , 'apps' ) } ) if not files . exists ( os . path . join ( TOOL_DIR , 'apps' , 'core' ) ) : sudo ( 'mkdir -p "%(dir)s"' % { 'dir' : os . path . join ( TOOL_DIR , 'apps' , 'core' ) } ) if not files . exists ( os . path . join ( TOOL_DIR , 'apps' , 'core' , 'releases' ) ) : sudo ( 'mkdir -p "%(dir)s"' % { 'dir' : os . path . join ( TOOL_DIR , 'apps' , 'core' , 'releases' ) } ) if not files . exists ( os . path . join ( TOOL_DIR , 'apps' , 'bot' ) ) : print ( 'Cloning repo' ) sudo ( 'git clone "%(url)s" "%(dir)s"' % { 'dir' : os . path . join ( TOOL_DIR , 'apps' , 'bot' ) , 'url' : BOT_REPO_URL } ) if not files . exists ( os . path . join ( TOOL_DIR , 'apps' , 'utils' ) ) : print ( 'Cloning repo' ) sudo ( 'git clone "%(url)s" "%(dir)s"' % { 'dir' : os . path . join ( TOOL_DIR , 'apps' , 'utils' ) , 'url' : UTIL_REPO_URL } ) if not files . exists ( os . path . join ( TOOL_DIR , 'apps' , 'report_interface' ) ) : print ( 'Cloning repo' ) sudo ( 'git clone "%(url)s" "%(dir)s"' % { 'dir' : os . path . join ( TOOL_DIR , 'apps' , 'report_interface' ) , 'url' : UI_REPO_URL } ) sudo ( 'ln -sf %(release)s %(current)s' % { 'release' : os . path . join ( TOOL_DIR , 'apps' , 'report_interface' ) , 'current' : os . path . join ( TOOL_DIR , 'public_html' ) . rstrip ( '/' ) , } ) if not files . exists ( os . path . join ( TOOL_DIR , 'node' ) ) : print ( 'Installing node' ) sudo ( 'wget https://nodejs.org/dist/v6.10.0/node-v6.10.0-linux-x64.tar.xz' ) sudo ( 'tar -xvf node-v6.10.0-linux-x64.tar.xz' ) sudo ( 'rm -f node-v6.10.0-linux-x64.tar.xz' ) sudo ( 'mv node-v6.10.0-linux-x64 node' ) if not files . exists ( os . path . join ( TOOL_DIR , 'node_modules' , 'irc' ) ) : sudo ( '/data/project/cluebotng/node/bin/npm install irc' )