User:Bugman/subsystems: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(→‎Script: Newest version of the script.)
(→‎Script: Bug fixes.)
Line 119: Line 119:
         for subsystem in self.subsystems[0] + self.subsystems[1] + self.subsystems[2] + self.subsystems[3] + self.groups[0] + self.groups[1] + self.groups[2] + self.groups[3]:
         for subsystem in self.subsystems[0] + self.subsystems[1] + self.subsystems[2] + self.subsystems[3] + self.groups[0] + self.groups[1] + self.groups[2] + self.groups[3]:
             # The repository location.
             # The repository location.
             if self.is_simgear(subsystem.declaration_file):
             if self.is_simgear(subsystem.declaration_file_rel):
                 path = SIMGEAR_PATH
                 path = SIMGEAR_PATH
             else:
             else:
Line 136: Line 136:
                 # The probable implementation file name.
                 # The probable implementation file name.
                 file_name = subsystem.declaration_file[:-3] + "cxx"
                 file_name = subsystem.declaration_file[:-3] + "cxx"
                 full_path = path + sep + file_name
                 if not subsystem.root_path:
                 if access(full_path, F_OK):
                    file_name = path + sep + file_name
                 if access(file_name, F_OK):
                     # The Unix grep commands to run.
                     # The Unix grep commands to run.
                     cmds = [
                     cmds = [
                         '%s %s' % (grep_ctor, full_path),
                         '%s %s' % (grep_ctor, file_name),
                         '%s %s {{!}} grep -v "return"' % (grep_any, full_path)
                         '%s %s {{!}} grep -v "return"' % (grep_any, file_name)
                     ]
                     ]


Line 444: Line 445:
             for subsystem in subsystem_list:
             for subsystem in subsystem_list:
                 # Code base selections.
                 # Code base selections.
                 if self.is_simgear(subsystem.declaration_file) and not self.output_simgear:
                 if self.is_simgear(subsystem.declaration_file_rel) and not self.output_simgear:
                     continue
                     continue
                 if not self.is_simgear(subsystem.declaration_file) and not self.output_flightgear:
                 if not self.is_simgear(subsystem.declaration_file_rel) and not self.output_flightgear:
                     continue
                     continue


Line 508: Line 509:
         subsystem_groups_flightgear = 0
         subsystem_groups_flightgear = 0
         for subsystem in self.subsystems[0] + self.subsystems[1] + self.subsystems[2] + self.subsystems[3]:
         for subsystem in self.subsystems[0] + self.subsystems[1] + self.subsystems[2] + self.subsystems[3]:
             if self.is_simgear(subsystem.declaration_file):
             if self.is_simgear(subsystem.declaration_file_rel):
                 subsystem_classes_simgear += 1
                 subsystem_classes_simgear += 1
             else:
             else:
                 subsystem_classes_flightgear += 1
                 subsystem_classes_flightgear += 1
         for group in self.groups[0] + self.groups[1] + self.groups[2] + self.groups[3]:
         for group in self.groups[0] + self.groups[1] + self.groups[2] + self.groups[3]:
             if self.is_simgear(group.declaration_file):
             if self.is_simgear(group.declaration_file_rel):
                 subsystem_groups_simgear += 1
                 subsystem_groups_simgear += 1
             else:
             else:
Line 582: Line 583:
         self.name = name
         self.name = name
         self.base_class = base_class
         self.base_class = base_class
        self.declaration_file_rel = declaration_file
         self.implementation_file = implementation_file
         self.implementation_file = implementation_file
         if root_path:
         if root_path:

Revision as of 09:00, 20 April 2018

Tracking down subsystems

Script

The following script is for finding all FlightGear dependencies:

All subsystems

The result is:

Refactoring

To check that all subsystems on a branch have been updated or refactored: