Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
#
Expand All @@ -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]:
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/local_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/raise_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/remote_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down