pyRscript/pyRscript.py
def decode_cmd_out(self, completed_cmd):
        """
        return a standard message
        """
        try:
            stdout = completed_cmd.stdout.encode('utf-8').decode()
        except AttributeError:
            try:
                stdout = str(bytes(completed_cmd.stdout), 'big5').strip()
            except AttributeError:
                stdout = str(bytes(completed_cmd.stdout).decode('utf-8')).strip()
        try:
            stderr = completed_cmd.stderr.encode('utf-8').decode()
        except AttributeError:
            try:
                stderr = str(bytes(completed_cmd.stderr), 'big5').strip()
            except AttributeError:
                stderr = str(bytes(completed_cmd.stderr).decode('utf-8')).strip()
        return ParsedCompletedCommand(
            completed_cmd.returncode,
            completed_cmd.args,
            stdout,
            stderr
        )
def decode_cmd_out(self, completed_cmd):
        """
        return a standard message
        """
        try:
            stdout = completed_cmd.stdout.encode('utf-8').decode()
        except AttributeError:
            try:
                stdout = str(bytes(completed_cmd.stdout), 'big5').strip()
            except AttributeError:
                stdout = str(bytes(completed_cmd.stdout).decode('utf-8')).strip()
        try:
            stderr = completed_cmd.stderr.encode('utf-8').decode()
        except AttributeError:
            try:
                stderr = str(bytes(completed_cmd.stderr), 'big5').strip()
            except AttributeError:
                stderr = str(bytes(completed_cmd.stderr).decode('utf-8')).strip()
        return ParsedCompletedCommand(
            completed_cmd.returncode,
            completed_cmd.args,
            stdout,
            stderr
        )
def decode_cmd_out ( self , completed_cmd ) : try : stdout = completed_cmd . stdout . encode ( 'utf-8' ) . decode ( ) except AttributeError : try : stdout = str ( bytes ( completed_cmd . stdout ) , 'big5' ) . strip ( ) except AttributeError : stdout = str ( bytes ( completed_cmd . stdout ) . decode ( 'utf-8' ) ) . strip ( ) try : stderr = completed_cmd . stderr . encode ( 'utf-8' ) . decode ( ) except AttributeError : try : stderr = str ( bytes ( completed_cmd . stderr ) , 'big5' ) . strip ( ) except AttributeError : stderr = str ( bytes ( completed_cmd . stderr ) . decode ( 'utf-8' ) ) . strip ( ) return ParsedCompletedCommand ( completed_cmd . returncode , completed_cmd . args , stdout , stderr )
return a standard message
return a standard message