From 3f95f10679a90249ca86db3b60482c2500356d44 Mon Sep 17 00:00:00 2001 From: drunsinn Date: Wed, 27 Jan 2021 16:36:42 +0100 Subject: [PATCH] fix spelling --- locales/en/LC_MESSAGES/error_text.po | 8 ++-- pyLSV2/client.py | 69 ++++++++++++++-------------- pyLSV2/low_level_com.py | 2 +- 3 files changed, 40 insertions(+), 39 deletions(-) diff --git a/locales/en/LC_MESSAGES/error_text.po b/locales/en/LC_MESSAGES/error_text.po index 789e970..ab0cbaf 100644 --- a/locales/en/LC_MESSAGES/error_text.po +++ b/locales/en/LC_MESSAGES/error_text.po @@ -151,7 +151,7 @@ msgstr "wrong operating mode'" #: translate_error.py:134 msgid "LSV2_ERROR_T_ER_NO_NEXT_ERROR" -msgstr "no next error availible" +msgstr "no next error available" #: translate_error.py:135 msgid "LSV2_ERROR_T_ER_ACCESS_TIMEOUT" @@ -195,7 +195,7 @@ msgstr "could not activate file" #: translate_error.py:145 msgid "LSV2_ERROR_T_ER_DSP_CHANNEL" -msgstr "DSP channel not availible" +msgstr "DSP channel not available" #: translate_error.py:146 msgid "LSV2_ERROR_T_ER_DSP_PARA" @@ -231,7 +231,7 @@ msgstr "remanten PLC memory was cleared" #: translate_error.py:154 msgid "LSV2_ERROR_T_ER_OSZI_CHSEL" -msgstr "chanel selection for remote scope incorrect" +msgstr "channel selection for remote scope incorrect" #: translate_error.py:155 msgid "LSV2_ERROR_LSV2_BUSY" @@ -319,7 +319,7 @@ msgstr "buffer overrund, boude rate to low" #: translate_error.py:176 msgid "LSV2_ERROR_T_BD_FD" -msgstr "block transfer finished successfuly" +msgstr "block transfer finished successfully" #: translate_error.py:177 msgid "LSV2_ERROR_T_USER_ERROR" diff --git a/pyLSV2/client.py b/pyLSV2/client.py index b7976e2..b1e3c6e 100644 --- a/pyLSV2/client.py +++ b/pyLSV2/client.py @@ -414,11 +414,11 @@ def _configure_connection(self): 'successfully configured connection parameters and basic logins. selected buffer size is %d, use secure file send: %s', self._buffer_size, self._secure_file_send) def login(self, login, password=None): - """Request aditional access rights. To elevate this level a logon has to be performed. Some levels require a password. + """Request additional access rights. To elevate this level a logon has to be performed. Some levels require a password. :param str login: One of the known login strings :param str password: optional. Password for login - :returns: True if execution was succesfull + :returns: True if execution was successful :rtype: bool """ if login in self._active_logins: @@ -449,7 +449,7 @@ def logout(self, login=None): """Drop one or all access right. If no login is supplied all active access rights are dropped. :param str login: optional. One of the known login strings - :returns: True if execution was succesfull + :returns: True if execution was successful :rtype: bool """ if login in self._known_logins or login is None: @@ -482,7 +482,7 @@ def set_system_command(self, command, parameter=None): :param int command: system command :param str parameter: optional. parameter payload for system command - :returns: True if execution was succesfull + :returns: True if execution was successful :rtype: bool """ if command in self._known_sys_cmd: @@ -497,10 +497,10 @@ def set_system_command(self, command, parameter=None): return False def get_system_parameter(self, force=False): - """Get all version information, result is bufferd since it is also used internaly. With parameter force it is - possible to manualy re-read the information form the control + """Get all version information, result is bufferd since it is also used internally. With parameter force it is + possible to manually re-read the information form the control - :param bool force: if Ture the information is read even if it is already buffered + :param bool force: if True the information is read even if it is already buffered :returns: dictionary with system parameters like number of plc variables, supported lsv2 version etc. :rtype: dict """ @@ -564,10 +564,10 @@ def get_system_parameter(self, force=False): return False def get_versions(self, force=False): - """Get all version information, result is bufferd since it is also used internaly. With parameter force it is - possible to manualy re-read the information form the control + """Get all version information, result is bufferd since it is also used internally. With parameter force it is + possible to manually re-read the information form the control - :param bool force: if Ture the information is read even if it is already buffered + :param bool force: if True the information is read even if it is already buffered :returns: dictionary with version text for control type, nc software, plc software, software options etc. :rtype: dict """ @@ -639,7 +639,7 @@ def get_program_status(self): LSV2.COMMAND_R_RI, LSV2.RESPONSE_S_RI, payload) if result: pgm_state = struct.unpack('!H', result)[0] - logging.debug('succesfully read state of active program: %s', + logging.debug('successfuly read state of active program: %s', self.get_program_status_text(pgm_state)) return pgm_state else: @@ -689,7 +689,7 @@ def get_program_stack(self): stack_info['Current_PGM'] = result[4:].split( b'\x00')[1].decode().strip('\x00').replace('\\', '/') logging.debug( - 'succesfully read active program stack and line number: %s', stack_info) + 'successfuly read active program stack and line number: %s', stack_info) return stack_info else: logging.error( @@ -722,7 +722,8 @@ def get_execution_status_text(code, language='en'): """Translate status code of execution state to text See https://github.com/drunsinn/pyLSV2/issues/1 - :param int code: status code of execution staautopte + :param int code: status code of execution status + :param str language: optional. language code for translation of text :returns: readable text for execution state :rtype: str """ @@ -736,10 +737,10 @@ def get_execution_status_text(code, language='en'): LSV2.EXEC_STATE_UNDEFINED: translate.gettext('EXEC_STATE_UNDEFINED')}.get(code, translate.gettext('EXEC_STATE_UNKNOWN')) def get_directory_info(self, remote_directory=None): - """Query information a the current working direcory on the control + """Query information a the current working directory on the control :param str remote_directory: optional. If set, working directory will be changed - :returns: dictionary with info about the directory or False if an error occured + :returns: dictionary with info about the directory or False if an error occurred :rtype: dict """ if remote_directory is not None and not self.change_directory(remote_directory): @@ -762,7 +763,7 @@ def get_directory_info(self, remote_directory=None): dir_info['Path'] = result[164:].decode().strip( '\x00').replace('\\', '/') logging.debug( - 'succesfully received directory information %s', dir_info) + 'successfuly received directory information %s', dir_info) return dir_info else: @@ -773,7 +774,7 @@ def change_directory(self, remote_directory): """Change the current working directoyon the control :param str remote_directory: path of directory on the control - :returns: True if changing of directory succeded + :returns: True if changing of directory succeeded :rtype: bool """ dir_path = remote_directory.replace('\\', '/') @@ -810,7 +811,7 @@ def get_file_info(self, remote_file_path): '\x00').replace('\\', '/') file_info['Attributs'] = struct.unpack('!L', result[8:12])[0] logging.debug( - 'succesfully received file information %s', file_info) + 'successfuly received file information %s', file_info) return file_info else: logging.warning( @@ -841,7 +842,7 @@ def get_directory_content(self): file_info['Attributs'] = struct.unpack('!L', entry[8:12])[0] dir_content.append(file_info) logging.debug( - 'succesfully received directory information %s', dir_content) + 'successfuly received directory information %s', dir_content) return dir_content def get_drive_info(self): @@ -867,14 +868,14 @@ def get_drive_info(self): drive_info['unknown'] = drive drives_list.append(drive_info) - logging.debug('succesfully received drive information %s', drives_list) + logging.debug('successfuly received drive information %s', drives_list) return drives_list def make_directory(self, dir_path): """Create a directory on control. If necessary also creates parent directories :param str dir_path: path of directory on the control - :returns: True if creating of directory completed successfuly + :returns: True if creating of directory completed successfully :rtype: bool """ path_parts = dir_path.replace( @@ -888,7 +889,7 @@ def make_directory(self, dir_path): payload.extend(map(ord, path_to_check)) payload.append(0x00) # terminate string if self._send_recive_ack(command=LSV2.COMMAND_C_DM, payload=payload): - logging.debug('Directory created succesfully') + logging.debug('Directory created successfuly') else: raise Exception( 'an error occurred while creating directory {}'.format(dir_path)) @@ -900,7 +901,7 @@ def delete_empty_directory(self, dir_path): """Delete empty directory on control :param str file_path: path of directory on the control - :returns: True if deleting of directory completed successfuly + :returns: True if deleting of directory completed successfully :rtype: bool """ dir_path = dir_path.replace('\\', '/') @@ -911,14 +912,14 @@ def delete_empty_directory(self, dir_path): logging.warning( 'an error occurred while deleting directory %s, this might also indicate that it it does not exist', dir_path) return False - logging.debug('succesfully deleted directory %s', dir_path) + logging.debug('successfuly deleted directory %s', dir_path) return True def delete_file(self, file_path): """Delete file on control :param str file_path: path of file on the control - :returns: True if deleting of file completed successfuly + :returns: True if deleting of file completed successfully :rtype: bool """ file_path = file_path.replace('\\', '/') @@ -929,15 +930,15 @@ def delete_file(self, file_path): logging.warning( 'an error occurred while deleting file %s, this might also indicate that it it does not exist', file_path) return False - logging.debug('succesfully deleted file %s', file_path) + logging.debug('successfuly deleted file %s', file_path) return True def copy_local_file(self, source_path, target_path): """Copy file on control from one place to another :param str source_path: path of file on the control - :param str target_path: path fo target location - :returns: True if copying of file completed successfuly + :param str target_path: path of target location + :returns: True if copying of file completed successfully :rtype: bool """ source_path = source_path.replace('\\', '/') @@ -967,15 +968,15 @@ def copy_local_file(self, source_path, target_path): logging.warning( 'an error occurred copying file %s to %s', source_path, target_path) return False - logging.debug('succesfully copied file %s', source_path) + logging.debug('successfuly copied file %s', source_path) return True def move_local_file(self, source_path, target_path): """Move file on control from one place to another :param str source_path: path of file on the control - :param str target_path: path fo target location - :returns: True if moving of file completed successfuly + :param str target_path: path of target location + :returns: True if moving of file completed successfully :rtype: bool """ source_path = source_path.replace('\\', '/') @@ -1004,7 +1005,7 @@ def move_local_file(self, source_path, target_path): logging.warning( 'an error occurred moving file %s to %s', source_path, target_path) return False - logging.debug('succesfully moved file %s', source_path) + logging.debug('successfuly moved file %s', source_path) return True def send_file(self, local_path, remote_path, override_file=False, binary_mode=False): @@ -1014,7 +1015,7 @@ def send_file(self, local_path, remote_path, override_file=False, binary_mode=Fa :param str local_path: local path of destination with or without file name :param bool override_file: flag if file should be replaced if it already exists :param bool binary_mode: flag if binary transfer mode should be used, if not set the file name is checked for known binary file type - :returns: True if transfer completed successfuly + :returns: True if transfer completed successfully :rtype: bool """ local_file = Path(local_path) @@ -1118,7 +1119,7 @@ def recive_file(self, remote_path, local_path, override_file=False, binary_mode= :param str local_path: local path of destination with or without file name :param bool override_file: flag if file should be replaced if it already exists :param bool binary_mode: flag if binary transfer mode should be used, if not set the file name is checked for known binary file type - :returns: True if transfer completed successfuly + :returns: True if transfer completed successfully :rtype: bool """ diff --git a/pyLSV2/low_level_com.py b/pyLSV2/low_level_com.py index 98b09af..c99ef99 100644 --- a/pyLSV2/low_level_com.py +++ b/pyLSV2/low_level_com.py @@ -69,7 +69,7 @@ def disconnect(self): logging.debug('Connection to %s closed', self._host_ip) def telegram(self, command, payload=None, buffer_size=0, wait_for_response=True): - """Send LSV2 telegram and recive response if necesarry. + """Send LSV2 telegram and receive response if necessary. :param str command: command string. :param byte array payload: command payload.