diff --git a/src/helpers.py b/src/helpers.py index 1d96b05..4875018 100644 --- a/src/helpers.py +++ b/src/helpers.py @@ -16,7 +16,7 @@ def _make_get_default_encoding_func(): _get_default_encoding_func = _make_get_default_encoding_func.__func__() @staticmethod - def GetDefaultEncoding(): + def get_default_encoding(): # # Original idea/source was: # @@ -40,7 +40,7 @@ def GetDefaultEncoding(): return 'UTF-8' @staticmethod - def PrepareProcessInput( + def prepare_process_input( input: typing.Optional[typing.Union[str, bytes]], encoding: typing.Optional[str], ) -> typing.Optional[bytes]: @@ -51,7 +51,7 @@ def PrepareProcessInput( if type(input) is str: if encoding is None: - return input.encode(__class__.GetDefaultEncoding()) + return input.encode(__class__.get_default_encoding()) assert type(encoding) is str return input.encode(encoding) diff --git a/src/local_ops.py b/src/local_ops.py index 997071d..8ea86ec 100644 --- a/src/local_ops.py +++ b/src/local_ops.py @@ -209,7 +209,7 @@ def _run_command__generic( input_prepared = None if not get_process: - input_prepared = Helpers.PrepareProcessInput(input, encoding) # throw + input_prepared = Helpers.prepare_process_input(input, encoding) # throw assert input_prepared is None or type(input_prepared) is bytes diff --git a/src/raise_error.py b/src/raise_error.py index a7a6800..1d609b1 100644 --- a/src/raise_error.py +++ b/src/raise_error.py @@ -52,7 +52,7 @@ def _TranslateDataIntoString__FromBinary(data): assert type(data) is bytes try: - return data.decode(Helpers.GetDefaultEncoding()) + return data.decode(Helpers.get_default_encoding()) except UnicodeDecodeError: pass diff --git a/src/remote_ops.py b/src/remote_ops.py index 120c4f6..0573768 100644 --- a/src/remote_ops.py +++ b/src/remote_ops.py @@ -177,7 +177,7 @@ def exec_command( input_prepared = None if not get_process: - input_prepared = Helpers.PrepareProcessInput(input, encoding) # throw + input_prepared = Helpers.prepare_process_input(input, encoding) # throw assert input_prepared is None or type(input_prepared) is bytes @@ -523,7 +523,7 @@ def rmdirs( try: self.exec_command( cmd2, - encoding=Helpers.GetDefaultEncoding(), + encoding=Helpers.get_default_encoding(), ) except ExecUtilException as e: if e.exit_code == 2: # No such file or directory