

def _DisplayReleaseReport(self, date=None, range_of_days=6):
    'Displays Managed Software Update Update report.'
    try:
        period = datetime.timedelta(days=range_of_days)
    except TypeError:
        self.error(400)
        self.response.out.write('invalid date input')
        return
    candidate_items = []
    if (not date):
        start_date = datetime.datetime.now()
    else:
        try:
            start_date = datetime.datetime(date)
        except TypeError:
            self.error(400)
            self.response.out.write('invalid date input')
            return
    query = models.AdminPackageLog.all()
    query.filter('mtime >', (start_date - period))
    for item in query:
        if ('stable' in item.catalogs):
            if (item.filename not in candidate_items):
                candidate_items.append(item.filename)
    final_list = self.ItemQualificationCheck(candidate_items, start_date, range_of_days)
    (final_report, contains_forced_install) = self.MakeReleaseReport(final_list)
    username = users.get_current_user()
    report_date = str(datetime.date.today())
    self.Render('release_report.html', {
        'report_items': final_report,
        'admin_username': username,
        'contains_forced_install': contains_forced_install,
        'report_date': report_date,
        'salutation': settings.RELEASE_REPORT_SALUTATION,
        'title': settings.RELEASE_REPORT_TITLE,
        'subject_line_flag': settings.RELEASE_REPORT_SUBJECT_FLAG,
        'introduction': settings.RELEASE_REPORT_INTRODUCTION,
        'introduction_warning': settings.RELEASE_REPORT_INTRODUCTION_WARNING,
        'managed_install_text': settings.RELEASE_REPORT_MANAGED_INSTALL_TEXT,
        'managed_update_and_optional_text': settings.RELEASE_REPORT_MANAGED_UPDATE_AND_OPTIONAL_TEXT,
        'managed_update_text': settings.RELEASE_REPORT_MANAGED_UPDATE_TEXT,
        'optional_install_text': settings.RELEASE_REPORT_OPTIONAL_INSTALL_TEXT,
        'unattended_and_forced_text': settings.RELEASE_REPORT_UNATTENDED_AND_FORCED_TEXT,
        'forced_text': settings.RELEASE_REPORT_FORCED_TEXT,
        'restart_required_text': settings.RELEASE_REPORT_RESTART_REQUIRED_TEXT,
        'signature': settings.RELEASE_REPORT_SIGNATURE,
        'version_verb': settings.RELEASE_REPORT_VERSION_VERB,
    })

dataset/ETHPy150Open google/simian/src/simian/mac/admin/release_report.py ReleaseReport._DisplayReleaseReport/original