I pushed the attached patch. It should have removed all the remaining
unused instance variables. -3 GLConfig's to worry about.
Collin
From 134f6b8a1806b1bcf0d1cd96ffe97e0d249d4581 Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.fu...@gmail.com>
Date: Tue, 30 Apr 2024 01:09:55 -0700
Subject: [PATCH] gnulib-tool.py: Remove remaining unused instance variables.
* pygnulib/GLModuleSystem.py (GLModule.__init__)
(GLModuleTable.__init__): Remove the unused GLFileSystem variable. These
classes perform lookups with a GLModuleSystem.
* pygnulib/GLTestDir.py (GLTestDir.__init__): Remove the unused
GLFileAssistant variable. The transformations it performs are not needed
in testdirs.
---
ChangeLog | 10 ++++++++++
pygnulib/GLModuleSystem.py | 4 ----
pygnulib/GLTestDir.py | 2 --
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index bd5bb93c0b..5cd01d60d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-04-30 Collin Funk <collin.fu...@gmail.com>
+
+ gnulib-tool.py: Remove remaining unused instance variables.
+ * pygnulib/GLModuleSystem.py (GLModule.__init__)
+ (GLModuleTable.__init__): Remove the unused GLFileSystem variable. These
+ classes perform lookups with a GLModuleSystem.
+ * pygnulib/GLTestDir.py (GLTestDir.__init__): Remove the unused
+ GLFileAssistant variable. The transformations it performs are not needed
+ in testdirs.
+
2024-04-29 Collin Funk <collin.fu...@gmail.com>
gnulib-tool.py: Add type hints to classes.
diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py
index a5afb5af6f..01ee393d12 100644
--- a/pygnulib/GLModuleSystem.py
+++ b/pygnulib/GLModuleSystem.py
@@ -175,7 +175,6 @@ class GLModule:
path: str
patched: bool
config: GLConfig
- filesystem: GLFileSystem
modulesystem: GLModuleSystem
sections: dict[str, str]
@@ -202,7 +201,6 @@ def __init__(self, config: GLConfig, name: str, path: str, patched: bool = False
self.path = path
self.patched = patched
self.config = config
- self.filesystem = GLFileSystem(self.config)
self.modulesystem = GLModuleSystem(self.config)
# Read the module description file into memory.
with open(path, mode='r', newline='\n', encoding='utf-8') as file:
@@ -706,7 +704,6 @@ class GLModuleTable:
tests_modules: list[GLModule]
final_modules: list[GLModule]
config: GLConfig
- filesystem: GLFileSystem
modulesystem: GLModuleSystem
inc_all_direct_tests: bool
inc_all_indirect_tests: bool
@@ -750,7 +747,6 @@ def __init__(self, config: GLConfig, inc_all_direct_tests: bool, inc_all_indirec
raise TypeError('config must be a GLConfig, not %s'
% type(config).__name__)
self.config = config
- self.filesystem = GLFileSystem(self.config)
self.modulesystem = GLModuleSystem(self.config)
if type(inc_all_direct_tests) is not bool:
raise TypeError('inc_all_direct_tests must be a bool, not %s'
diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py
index 688224cdce..8ddc1ea4c8 100644
--- a/pygnulib/GLTestDir.py
+++ b/pygnulib/GLTestDir.py
@@ -96,7 +96,6 @@ class GLTestDir:
emitter: GLEmiter
filesystem: GLFileSystem
modulesystem: GLModuleSystem
- assistant: GLFileAssistant
makefiletable: GLMakefileTable
def __init__(self, config: GLConfig, testdir: str) -> None:
@@ -117,7 +116,6 @@ def __init__(self, config: GLConfig, testdir: str) -> None:
self.emitter = GLEmiter(self.config)
self.filesystem = GLFileSystem(self.config)
self.modulesystem = GLModuleSystem(self.config)
- self.assistant = GLFileAssistant(self.config)
self.makefiletable = GLMakefileTable(self.config)
# Subdirectory names.
--
2.44.0