User:Bugman/subsystems: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
m (→‎All subsystems: Minor fix for the output.)
m (→‎Refactoring: Updated the script.)
Line 518: Line 518:
#! /usr/bin/env python3
#! /usr/bin/env python3


# Python module imports.
from subprocess import PIPE, Popen
# Other module imports.
from find_subsystems import FindSubsystems
from find_subsystems import FindSubsystems


from subprocess import PIPE, Popen


class ToUpdate:
    """Class for finding all files yet to be updated."""


class ToUpdate:
     def __init__(self):
     def __init__(self):
        """Find all files to be updated."""
        # First find all subsystems.
         subsystems = FindSubsystems()
         subsystems = FindSubsystems()


        # Generate a list of files to skip.
         pipe = Popen("git diff --name-only ..next", shell=True, stdout=PIPE)
         pipe = Popen("git diff --name-only ..next", shell=True, stdout=PIPE)
         blacklist = []
         blacklist = []
Line 535: Line 543:


         # Loop over all derived classes.
         # Loop over all derived classes.
         print("\nStill to be updated:")
         print("\nYet to be updated:")
         for subsystem in subsystems.classes_primary + subsystems.classes_secondary + subsystems.classes_tertiary + subsystems.classes_quaternary:
         for storage_list in subsystems.subsystems + subsystems.groups:
             if subsystem.file_name in blacklist:
             for subsystem in storage_list:
                continue
                if subsystem.file_name not in blacklist:
            print("    %s: %s" % (subsystem.file_name, subsystem))
                    print("    %s: %s" % (subsystem.file_name, subsystem))
 




# Instantiate the class if run as a script.
if __name__ == "__main__":
if __name__ == "__main__":
     ToUpdate()
     ToUpdate()
}}
}}

Revision as of 11:48, 18 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: