User:Bugman/subsystems: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(→‎All subsystems: Pipe fixes.)
(→‎Script: Newest version of the script.)
Line 61: Line 61:
         # Find all SGSubsystem and SGSubsystemGroup derived classes.
         # Find all SGSubsystem and SGSubsystemGroup derived classes.
         paths = [SIMGEAR_PATH, FLIGHTGEAR_PATH]
         paths = [SIMGEAR_PATH, FLIGHTGEAR_PATH]
        if not self.output_flightgear:
            paths = [SIMGEAR_PATH]
         for path in paths:
         for path in paths:
             if self.category_subsystems:
             if self.category_subsystems:
Line 341: Line 343:
         group.add_argument("-t", "--text", default=False, action="store_true", help="Output in plain text format (the default).")
         group.add_argument("-t", "--text", default=False, action="store_true", help="Output in plain text format (the default).")
         group.add_argument("-x", "--xml", default=False, action="store_true", help="Output in XML format.")
         group.add_argument("-x", "--xml", default=False, action="store_true", help="Output in XML format.")
         group.add_argument("-f", "--files", default=False, action="store_true", help="List all declaration and/or implementation files.")
         group.add_argument("-l", "--files", default=False, action="store_true", help="List all declaration and/or implementation files.")
         group.add_argument("-d", "--declaration-files", default=False, action="store_true", help="List the files where subsystems and subsystem groups are declared.")
         group.add_argument("-d", "--declaration-files", default=False, action="store_true", help="List the files where subsystems and subsystem groups are declared.")
         group.add_argument("-i", "--implementation-files", default=False, action="store_true", help="List the files where subsystems and subsystem groups are implemented.")
         group.add_argument("-i", "--implementation-files", default=False, action="store_true", help="List the files where subsystems and subsystem groups are implemented.")
        # Code base selection.
        group = parser.add_argument_group("code base selections", "Choose between simgear and flightgear.")
        group.add_argument("-s", "--simgear", default=False, action="store_true", help="Exclusively output simgear subsystems.")
        group.add_argument("-f", "--flightgear", default=False, action="store_true", help="Exclusively output flightgear subsystems.")


         # Category selection.
         # Category selection.
Line 366: Line 373:
         elif args.implementation_files:
         elif args.implementation_files:
             self.output_format = "implementation files"
             self.output_format = "implementation files"
        # The code base arguments.
        self.output_simgear = True
        self.output_flightgear = True
        if args.simgear:
            self.output_flightgear = False
        if args.flightgear:
            self.output_simgear = False


         # The category arguments.
         # The category arguments.
Line 390: Line 405:
             # Loop over each subsystem, printing out the source files.
             # Loop over each subsystem, printing out the source files.
             for subsystem in subsystem_list:
             for subsystem in subsystem_list:
                # Code base selections.
                if subsystem.declaration_file[:7] == "simgear" and not self.output_simgear:
                    continue
                if subsystem.declaration_file[:7] != "simgear" and not self.output_flightgear:
                    continue
                # Output the source files.
                 if self.output_format in ["files", "declaration files"]:
                 if self.output_format in ["files", "declaration files"]:
                     print(subsystem.declaration_file)
                     print(subsystem.declaration_file)

Revision as of 08:08, 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: