def main():
    if len(sys.argv) > 1:
        print >> sys.stderr, 'No arguments expected!'
        sys.stderr.write(__doc__)
        sys.exit(1)

    update_histogram_enum.UpdateHistogramFromDict(
        'NetErrorCodes',
        ReadNetErrorCodes(NET_ERROR_LIST_PATH, POSITIVE_ERROR_REGEX),
        NET_ERROR_LIST_PATH, os.path.basename(__file__))

    update_histogram_enum.UpdateHistogramFromDict(
        'CombinedHttpResponseAndNetErrorCode',
        ReadNetErrorCodes(NET_ERROR_LIST_PATH, NEGATIVE_ERROR_REGEX),
        NET_ERROR_LIST_PATH, os.path.basename(__file__))
def main():
    if len(sys.argv) > 1:
        print('No arguments expected!', file=sys.stderr)
        sys.stderr.write(__doc__)
        sys.exit(1)

    update_histogram_enum.UpdateHistogramFromDict(
        'GpuDriverBugWorkaroundEntry',
        ReadGpuDriverBugEntries(GPU_DRIVER_BUG_WORKAROUND_PATH),
        GPU_DRIVER_BUG_WORKAROUND_PATH, os.path.basename(__file__))
def main():
    if len(sys.argv) > 1:
        print('No arguments expected!', file=sys.stderr)
        sys.stderr.write(__doc__)
        sys.exit(1)

    with open(path_util.GetInputFile(NET_ROOT_CERTS_PATH)) as f:
        root_stores = json.load(f)

    spki_enum = {}
    spki_enum[0] = 'Unknown or locally-installed trust anchor'
    for spki, spki_data in sorted(root_stores['spkis'].items()):
        spki_enum[int(spki_data['id'])] = spki

    update_histogram_enum.UpdateHistogramFromDict('NetTrustAnchors', spki_enum,
                                                  NET_ROOT_CERTS_PATH,
                                                  os.path.basename(__file__))
        if enum_match:
            enum_name = enum_match.group(1)
            property_id = int(enum_match.group(2))
            # Properties with id = 0 are invalid. Skip them.
            if property_id == 0:
                continue
            properties[property_id] = EnumToCssProperty(enum_name)

    return properties


if __name__ == '__main__':
    parser = optparse.OptionParser()
    parser.add_option(
        '--for-dashboard',
        action='store_true',
        dest='dashboard',
        default=False,
        help='Print enum definition formatted for use in uma.py of '
        'Chromium dashboard developed at '
        'https://github.com/GoogleChrome/chromium-dashboard')
    options, args = parser.parse_args()

    if options.dashboard:
        enum_dict = ReadCssProperties(USE_COUNTER_MOJOM_PATH)
        update_use_counter_feature_enum.PrintEnumForDashboard(enum_dict)
    else:
        update_histogram_enum.UpdateHistogramFromDict(
            'MappedCSSProperties', ReadCssProperties(USE_COUNTER_MOJOM_PATH),
            USE_COUNTER_MOJOM_PATH, os.path.basename(__file__))
Пример #5
0
        if enum_match:
            enum_name = enum_match.group(1)
            property_id = int(enum_match.group(2))
            properties[property_id] = EnumToCssProperty(enum_name)
            previous_line = ''
        else:
            previous_line = line

    return properties


if __name__ == '__main__':
    parser = optparse.OptionParser()
    parser.add_option(
        '--for-dashboard',
        action='store_true',
        dest='dashboard',
        default=False,
        help='Print enum definition formatted for use in uma.py of '
        'Chromium dashboard developed at '
        'https://github.com/GoogleChrome/chromium-dashboard')
    options, args = parser.parse_args()

    if options.dashboard:
        enum_dict = ReadCssProperties(USE_COUNTER_CPP_PATH)
        update_use_counter_feature_enum.PrintEnumForDashboard(enum_dict)
    else:
        update_histogram_enum.UpdateHistogramFromDict(
            'MappedCSSProperties', ReadCssProperties(USE_COUNTER_CPP_PATH),
            USE_COUNTER_CPP_PATH)