folder_jobs_scheduled_manual.py

What this script is for:
For each folder from the job definition XML, write to CSV file:  
job count of jobs, platform, scheduled (Y or N), folder order method, and an optional variable name that is specified by the user, to check if it exists in the folder (or for a job in the folder).

What the script does:
Script input: job definition XML file and optional variable name to check occureance.

Script output: A CSV file contains a folder list from the job definition XML file and for each folder:
count of jobs, platform, scheduled (Y or N), folder order method, optional another folder attribute 
and the optional variable (the variable value if it is found, N if it isn't).
              
Step 1) The script goes through the job definition XML and extracts relevant data for each folder, such as the folder name, the number of jobs, the platform, and the order method. It then determines if the folder is scheduled by checking for scheduling attributes like DAYSCAL, WEEKSCAL, DATE, WEEKDAYS, and DAYS.

Step 2) The script checks for an optional variable. If the user has not specified any, it skips this step. However, if the variable exists, the script checks whether the folder or any job in the folder has it. If it does, then the script writes the value of the variable to the CSV. If the variable is not found, the script writes "N".

Step 3) Writes the following to the CSV: "Folder Name", "Number of Jobs", "Platform", "Scheduled", "Order Method", and an optional variable name, if specified by the user. 

Script usage:

Invoke the script by: 
folder_jobs_scheduled_manual.py [-h] -i  -o  [-a] [-v]

options:
  -h, --help  show this help message and exit
  -i          Input XML file
  -o          Output CSV file
  -a          Folder attribute to be added to output
  -v          variable name to report on