@codesys/mcp-toolkit 1.1.10 → 1.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.1.11] - 2025-05-06
9
+
10
+ ### Fixed
11
+ - Fixed syntax errors in Python scripts by replacing f-strings with older-style formatting
12
+ - Ensures compatibility with Python version used in CODESYS scripting environment
13
+
8
14
  ## [1.1.10] - 2025-05-06
9
15
 
10
16
  ### Fixed
@@ -22,7 +22,7 @@ def sanitize_windows_path(path_str):
22
22
  # Clean up any extraneous quotes
23
23
  sanitized = sanitized.strip('"\'')
24
24
 
25
- print(f"DEBUG: Sanitized path from '{path_str}' to '{sanitized}'")
25
+ print("DEBUG: Sanitized path from '%s' to '%s'" % (path_str, sanitized))
26
26
  return sanitized
27
27
 
28
28
  def ensure_project_open(target_project_path):
@@ -123,7 +123,7 @@ def ensure_project_open(target_project_path):
123
123
  recheck_primary = None
124
124
  try:
125
125
  recheck_primary = script_engine.projects.primary
126
- print(f"DEBUG: Recheck primary project type: {type(recheck_primary).__name__}")
126
+ print("DEBUG: Recheck primary project type: %s" % type(recheck_primary).__name__)
127
127
  except Exception as recheck_primary_err:
128
128
  print("WARN: Error getting primary project after reopen: %s" % recheck_primary_err)
129
129
  traceback.print_exc() # Print full trace for primary project access issue
@@ -61,7 +61,7 @@ def normalize_path(path_str):
61
61
  normalized = path_str.replace('\\', '\\\\')
62
62
  # Remove any quotes that might be present
63
63
  normalized = normalized.strip('"\'')
64
- print(f"DEBUG: Normalized path from '{path_str}' to '{normalized}'")
64
+ print("DEBUG: Normalized path from '%s' to '%s'" % (path_str, normalized))
65
65
  return normalized
66
66
 
67
67
  try:
@@ -73,16 +73,16 @@ try:
73
73
  print("DEBUG: CODESYS version info:")
74
74
  try:
75
75
  version_info = script_engine.get_version_info()
76
- print(f"DEBUG: CODESYS Version: {version_info}")
76
+ print("DEBUG: CODESYS Version: %s" % version_info)
77
77
  except Exception as v_err:
78
- print(f"DEBUG: Error getting CODESYS version: {v_err}")
78
+ print("DEBUG: Error getting CODESYS version: %s" % v_err)
79
79
 
80
80
  print("DEBUG: Opening project...")
81
81
  primary_project = ensure_project_open(normalized_path)
82
82
 
83
83
  if primary_project is None:
84
84
  print("DEBUG: ERROR - Project object is None after ensure_project_open")
85
- raise ValueError(f"Failed to open project: {normalized_path} - project object is None")
85
+ raise ValueError("Failed to open project: %s - project object is None" % normalized_path)
86
86
 
87
87
  print("DEBUG: Project object type: %s" % type(primary_project).__name__)
88
88
  project_name = os.path.basename(normalized_path)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codesys/mcp-toolkit",
3
- "version": "1.1.10",
3
+ "version": "1.1.11",
4
4
  "description": "Model Context Protocol (MCP) server for CODESYS automation platform",
5
5
  "main": "dist/server.js",
6
6
  "bin": {
@@ -22,7 +22,7 @@ def sanitize_windows_path(path_str):
22
22
  # Clean up any extraneous quotes
23
23
  sanitized = sanitized.strip('"\'')
24
24
 
25
- print(f"DEBUG: Sanitized path from '{path_str}' to '{sanitized}'")
25
+ print("DEBUG: Sanitized path from '%s' to '%s'" % (path_str, sanitized))
26
26
  return sanitized
27
27
 
28
28
  def ensure_project_open(target_project_path):
@@ -123,7 +123,7 @@ def ensure_project_open(target_project_path):
123
123
  recheck_primary = None
124
124
  try:
125
125
  recheck_primary = script_engine.projects.primary
126
- print(f"DEBUG: Recheck primary project type: {type(recheck_primary).__name__}")
126
+ print("DEBUG: Recheck primary project type: %s" % type(recheck_primary).__name__)
127
127
  except Exception as recheck_primary_err:
128
128
  print("WARN: Error getting primary project after reopen: %s" % recheck_primary_err)
129
129
  traceback.print_exc() # Print full trace for primary project access issue
@@ -61,7 +61,7 @@ def normalize_path(path_str):
61
61
  normalized = path_str.replace('\\', '\\\\')
62
62
  # Remove any quotes that might be present
63
63
  normalized = normalized.strip('"\'')
64
- print(f"DEBUG: Normalized path from '{path_str}' to '{normalized}'")
64
+ print("DEBUG: Normalized path from '%s' to '%s'" % (path_str, normalized))
65
65
  return normalized
66
66
 
67
67
  try:
@@ -73,16 +73,16 @@ try:
73
73
  print("DEBUG: CODESYS version info:")
74
74
  try:
75
75
  version_info = script_engine.get_version_info()
76
- print(f"DEBUG: CODESYS Version: {version_info}")
76
+ print("DEBUG: CODESYS Version: %s" % version_info)
77
77
  except Exception as v_err:
78
- print(f"DEBUG: Error getting CODESYS version: {v_err}")
78
+ print("DEBUG: Error getting CODESYS version: %s" % v_err)
79
79
 
80
80
  print("DEBUG: Opening project...")
81
81
  primary_project = ensure_project_open(normalized_path)
82
82
 
83
83
  if primary_project is None:
84
84
  print("DEBUG: ERROR - Project object is None after ensure_project_open")
85
- raise ValueError(f"Failed to open project: {normalized_path} - project object is None")
85
+ raise ValueError("Failed to open project: %s - project object is None" % normalized_path)
86
86
 
87
87
  print("DEBUG: Project object type: %s" % type(primary_project).__name__)
88
88
  project_name = os.path.basename(normalized_path)