""" Linux.py

    General description:
     This module contains the Linux class, which implements Linux
    platform specific functions.
    (C) 2013, Andrei Tuicu <andrei.tuicu@gmail.com>
                   last review 25.08.2013
"""

import subprocess

class Linux:
    def toolIsInstalled( self, cmd ):
       return subprocess.call("type " + cmd, shell=True, \
                stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0

    def zipExtractAll(self, archivePath ):
        extractCmd = []
        extractCmd.append('unzip')
        extractCmd.append('-q')
        extractCmd.append('-d')
        extractCmd.append('current-test')
        extractCmd.append(archivePath)
        x = subprocess.Popen(extractCmd)
        x.wait()

@@ -247,16 +247,31 @@
 bprocess
+%0Aimport getpass
 %0A%0Aclass 
@@ -326,14 +326,21 @@
     
+ 
 return
+Code =
  sub
@@ -450,16 +450,471 @@
 E) == 0%0A
+        if returnCode is True:%0A            return True%0A%0A        bashrc = %22/home/%22 + getpass.getuser() + %22/.bashrc%22%0A        alias = %22alias %22 + cmd%0A%0A        grep = subprocess.Popen(%5B%22grep%22, alias, bashrc%5D, stdout=subprocess.PIPE, stderr=subprocess.PIPE)%0A        grep.wait()%0A        if grep.returncode != 0:%0A            return False%0A%0A        fullCommand = grep.communicate()%5B0%5D.splitlines()%5B0%5D.split(%22=%22)%5B1%5D%0A        return self.toolIsInstalled(fullCommand)%0A%0A
 %0A    def

Update Linux.py: toolIsInstalled function can look for aliases in ~/.bashrc