Example #1
0
 private void Predictions(StreamWriter sw, BillReportCollection reports, DateRange past_week)
 {
     StartPredictionTable(sw, "Predicted Committee Routing");
     foreach (var report in reports)
     {
         if (report.IsPositionNone())
         {
             continue;                         // Don't report bills on which we have no position
         }
         if (report.IsDead())
         {
             continue;                         // Don't report dead bills (e.g. Joint Rule 56)
         }
         if (report.IsChaptered())
         {
             continue;                         // Don't report chaptered bills
         }
         string path       = $"{Path.Combine(Config.Instance.HtmlFolder, BillUtils.EnsureNoLeadingZerosBill(report.Measure))}.html";
         string committees = IndividualReport.PreviousReport.Committees(path);
         string likelihood = IndividualReport.PreviousReport.Likelihood(path);
         if (committees.Length > 0 || likelihood.Length > 0)
         {
             ReportPrediction(sw, past_week, report, committees, likelihood);
         }
     }
     EndTable(sw);
 }
Example #2
0
 /// <summary>
 /// Report any bill that changed this week.
 /// </summary>
 /// <param name="reports">Collected bill reports</param>
 /// <param name="past_week">The dates bounding the past calendar week</param>
 /// <param name="sw">StreamWriter which will be written to the report file</param>
 private void ChangesThisWeek(StreamWriter sw, BillReportCollection reports, DateRange past_week)
 {
     StartTable(sw, "Changes This Week in Bills Of Interest");
     foreach (var report in reports)
     {
         if (report.IsPositionNone())
         {
             continue;                         // Don't bother reporting bills on which we have no position
         }
         if (report.IsDead())
         {
             continue;                         // Don't bother reporting dead bills (e.g. Joint Rule 56)
         }
         string path = $"{Path.Combine(Config.Instance.HtmlFolder, BillUtils.EnsureNoLeadingZerosBill(report.Measure))}.html";
         if (File.Exists(path))
         {
             string contents = FileUtils.FileContents(path);
             if (BillUtils.IsNewThisWeek(contents, past_week))
             {
                 continue;                                          // Don't report new bills.
             }
             var dt = DateFromLastAction(report);
             if (DateUtils.DateIsInPastWeek(dt, past_week))
             {
                 ReportOneBill(sw, report);
             }
         }
     }
     EndTable(sw);
 }
Example #3
0
 /// <summary>
 /// Report any bill that is new this week.
 /// A bill is new if it was initially reviewed during the past week.
 /// </summary>
 /// <param name="reports">Collected bill reports</param>
 /// <param name="past_week">The dates bounding the past calendar week</param>
 /// <param name="sw">StreamWriter which will be written to the report file</param>
 private void NewThisWeek(StreamWriter sw, BillReportCollection reports, DateRange past_week)
 {
     StartTable(sw, "New Of-Interest Bills This Week");
     foreach (var report in reports)
     {
         string path = $"{Path.Combine(Config.Instance.HtmlFolder, BillUtils.EnsureNoLeadingZerosBill(report.Measure))}.html";
         if (File.Exists(path))
         {
             string contents = FileUtils.FileContents(path);
             if (BillUtils.IsNewThisWeek(contents, past_week))
             {
                 if (report.IsDead())
                 {
                     continue;                       // Don't bother reporting dead bills
                 }
                 if (report.IsPositionNone())
                 {
                     continue;                       // Don't bother reporting bills on which we have no position
                 }
                 if (report.IsChaptered())
                 {
                     continue;                       // Don't bother reporting chaptered bills
                 }
                 ReportOneBill(sw, report);
             }
         }
     }
     EndTable(sw);
 }
Example #4
0
 private void HighestPriority(StreamWriter sw, BillReportCollection reports, DateRange past_week)
 {
     StartTable(sw, "Highest Priority Bills");
     foreach (string bill in Config.Instance.HighestPriority)
     {
         var measure = BillUtils.EnsureDashAndNoLeadingZeros(bill);
         var report  = (from item in reports where (item.Measure == measure) select item).FirstOrDefault();
         if (report != null)
         {
             string prefix = BillUtils.NewOrChangePrefix(past_week, report);
             ReportOneBillWithPrefix(sw, report, prefix);
         }
     }
     EndTable(sw);
 }
Example #5
0
 private void Dead(StreamWriter sw, BillReportCollection reports)
 {
     StartTable(sw, "Of-Interest Bills Dead This Biennium");
     foreach (var report in reports)
     {
         if (report.IsPositionNone())
         {
             continue;                         // Don't bother reporting bills on which we have no position
         }
         if (report.IsDead())
         {
             ReportOneBill(sw, report);
         }
     }
     EndTable(sw);
 }
Example #6
0
 private void Modify_Monitor(StreamWriter sw, BillReportCollection reports, DateRange past_week)
 {
     StartTable(sw, "Modify/Monitor");
     foreach (var report in reports)
     {
         if (report.IsDead())
         {
             continue;                   // Don't bother reporting dead bills
         }
         if (report.IsChaptered())
         {
             continue;                   // Chaptered bills are reported elsewhere
         }
         if (report.IsPositionModifyOrMonitor())
         {
             string prefix = BillUtils.NewOrChangePrefix(past_week, report);
             ReportOneBillWithPrefix(sw, report, prefix);
         }
     }
     EndTable(sw);
 }
Example #7
0
        public void Generate()
        {
            string weekly_report_path = ReportPath();
            var    reports            = new BillReportCollection(report_folder);
            var    past_week          = PastWeek();

            using (var sw = new StreamWriter(weekly_report_path)) {
                Header(sw);
                HighestPriority(sw, reports, past_week); // Our highest priority bills
                NewThisWeek(sw, reports, past_week);     // New bills of interest this week
                ChangesThisWeek(sw, reports, past_week); // Changes this week in bills of interest
                //UpcomingCommitteeHearingsOfInterest(sw);// Committee hearings for bills of interest
                Oppose(sw, reports, past_week);          // Bills for which our position is Oppose
                Modify_Monitor(sw, reports, past_week);  // Bills for which our position is Monitor or Modify
                Predictions(sw, reports, past_week);     // Per-bill expected path through committees
                Chaptered(sw, reports);                  // Bills of interest which chaptered this biennium
                Dead(sw, reports);                       // Bills of interest which died this biennium
                RemainingLegislativeSchedule(sw);        // What's left on this year's schedule
                Definitions(sw);                         // Definitions of terms
                End(sw);
            }
        }