diff --git a/adsmsg/__init__.py b/adsmsg/__init__.py index e9c0671..0ffd6fa 100644 --- a/adsmsg/__init__.py +++ b/adsmsg/__init__.py @@ -8,7 +8,7 @@ from .fulltext_update import FulltextUpdate from .metrics_record import MetricsRecord, \ MetricsRecordList -from .nonbibrecord import NonBibRecord,\ +from .nonbibrecord import NonBibRecord, \ NonBibRecordList, \ DataLinksRecord, \ DataLinksRecordList diff --git a/adsmsg/master.py b/adsmsg/master.py index d382784..2dcc6bd 100644 --- a/adsmsg/master.py +++ b/adsmsg/master.py @@ -11,7 +11,7 @@ def __init__(self, *args, **kwargs): if links: link_record = instance.links for key in links.keys(): - if isinstance(links[key], str) or isinstance(links[key], bool): + if isinstance(links[key], bool): setattr(link_record, key, links[key]) elif isinstance(links[key], list): if key == 'ARXIV': diff --git a/adsmsg/protobuf/master_pb2.py b/adsmsg/protobuf/master_pb2.py index 48cb126..76f61a3 100644 --- a/adsmsg/protobuf/master_pb2.py +++ b/adsmsg/protobuf/master_pb2.py @@ -13,14 +13,14 @@ _sym_db = _symbol_database.Default() -import status_pb2 as status__pb2 +from . import status_pb2 as status__pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='master.proto', package='adsmsg', syntax='proto3', - serialized_pb=_b('\n\x0cmaster.proto\x12\x06\x61\x64smsg\x1a\x0cstatus.proto\";\n\x0eLinkTypeRecord\x12\x0b\n\x03url\x18\x01 \x03(\t\x12\r\n\x05title\x18\x02 \x03(\t\x12\r\n\x05\x63ount\x18\x03 \x01(\x05\"\xc6\x04\n\nLinkRecord\x12\r\n\x05\x41RXIV\x18\x01 \x03(\t\x12\x0b\n\x03\x44OI\x18\x02 \x03(\t\x12*\n\x04\x44\x41TA\x18\x03 \x03(\x0b\x32\x1c.adsmsg.LinkRecord.DATAEntry\x12\x30\n\x07\x45SOURCE\x18\x04 \x03(\x0b\x32\x1f.adsmsg.LinkRecord.ESOURCEEntry\x12*\n\nASSOCIATED\x18\x05 \x01(\x0b\x32\x16.adsmsg.LinkTypeRecord\x12\'\n\x07INSPIRE\x18\x06 \x01(\x0b\x32\x16.adsmsg.LinkTypeRecord\x12.\n\x0eLIBRARYCATALOG\x18\x07 \x01(\x0b\x32\x16.adsmsg.LinkTypeRecord\x12,\n\x0cPRESENTATION\x18\x08 \x01(\x0b\x32\x16.adsmsg.LinkTypeRecord\x12#\n\x03TOC\x18\t \x01(\x0b\x32\x16.adsmsg.LinkTypeRecord\x12\x11\n\tCITATIONS\x18\n \x01(\x08\x12\x10\n\x08GRAPHICS\x18\x0b \x01(\x08\x12\x0f\n\x07METRICS\x18\x0c \x01(\x08\x12\x0f\n\x07OPENURL\x18\r \x01(\x08\x12\x12\n\nREFERENCES\x18\x0e \x01(\x08\x1a\x43\n\tDATAEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.adsmsg.LinkTypeRecord:\x02\x38\x01\x1a\x46\n\x0c\x45SOURCEEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.adsmsg.LinkTypeRecord:\x02\x38\x01\"X\n\x0e\x44ocumentRecord\x12\x0f\n\x07\x62ibcode\x18\x01 \x01(\t\x12\x12\n\nidentifier\x18\x02 \x03(\t\x12!\n\x05links\x18\x03 \x01(\x0b\x32\x12.adsmsg.LinkRecord\"c\n\x0f\x44ocumentRecords\x12\x30\n\x10\x64ocument_records\x18\x01 \x03(\x0b\x32\x16.adsmsg.DocumentRecord\x12\x1e\n\x06status\x18\x02 \x01(\x0e\x32\x0e.adsmsg.Statusb\x06proto3') + serialized_pb=_b('\n\x0cmaster.proto\x12\x06\x61\x64smsg\x1a\x0cstatus.proto\";\n\x0eLinkTypeRecord\x12\x0b\n\x03url\x18\x01 \x03(\t\x12\r\n\x05title\x18\x02 \x03(\t\x12\r\n\x05\x63ount\x18\x03 \x01(\x05\"\xae\x04\n\nLinkRecord\x12\r\n\x05\x41RXIV\x18\x01 \x03(\t\x12\x0b\n\x03\x44OI\x18\x02 \x03(\t\x12*\n\x04\x44\x41TA\x18\x03 \x03(\x0b\x32\x1c.adsmsg.LinkRecord.DATAEntry\x12\x30\n\x07\x45SOURCE\x18\x04 \x03(\x0b\x32\x1f.adsmsg.LinkRecord.ESOURCEEntry\x12*\n\nASSOCIATED\x18\x05 \x01(\x0b\x32\x16.adsmsg.LinkTypeRecord\x12\'\n\x07INSPIRE\x18\x06 \x01(\x0b\x32\x16.adsmsg.LinkTypeRecord\x12.\n\x0eLIBRARYCATALOG\x18\x07 \x01(\x0b\x32\x16.adsmsg.LinkTypeRecord\x12,\n\x0cPRESENTATION\x18\x08 \x01(\x0b\x32\x16.adsmsg.LinkTypeRecord\x12\x11\n\tCITATIONS\x18\t \x01(\x08\x12\x10\n\x08GRAPHICS\x18\n \x01(\x08\x12\x0f\n\x07METRICS\x18\x0b \x01(\x08\x12\x0f\n\x07OPENURL\x18\x0c \x01(\x08\x12\x12\n\nREFERENCES\x18\r \x01(\x08\x12\x0b\n\x03TOC\x18\x0e \x01(\x08\x1a\x43\n\tDATAEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.adsmsg.LinkTypeRecord:\x02\x38\x01\x1a\x46\n\x0c\x45SOURCEEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.adsmsg.LinkTypeRecord:\x02\x38\x01\"X\n\x0e\x44ocumentRecord\x12\x0f\n\x07\x62ibcode\x18\x01 \x01(\t\x12\x12\n\nidentifier\x18\x02 \x03(\t\x12!\n\x05links\x18\x03 \x01(\x0b\x32\x12.adsmsg.LinkRecord\"c\n\x0f\x44ocumentRecords\x12\x30\n\x10\x64ocument_records\x18\x01 \x03(\x0b\x32\x16.adsmsg.DocumentRecord\x12\x1e\n\x06status\x18\x02 \x01(\x0e\x32\x0e.adsmsg.Statusb\x06proto3') , dependencies=[status__pb2.DESCRIPTOR,]) @@ -105,8 +105,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=543, - serialized_end=610, + serialized_start=519, + serialized_end=586, ) _LINKRECORD_ESOURCEENTRY = _descriptor.Descriptor( @@ -142,8 +142,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=612, - serialized_end=682, + serialized_start=588, + serialized_end=658, ) _LINKRECORD = _descriptor.Descriptor( @@ -210,42 +210,42 @@ is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='TOC', full_name='adsmsg.LinkRecord.TOC', index=8, - number=9, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + name='CITATIONS', full_name='adsmsg.LinkRecord.CITATIONS', index=8, + number=9, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='CITATIONS', full_name='adsmsg.LinkRecord.CITATIONS', index=9, + name='GRAPHICS', full_name='adsmsg.LinkRecord.GRAPHICS', index=9, number=10, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='GRAPHICS', full_name='adsmsg.LinkRecord.GRAPHICS', index=10, + name='METRICS', full_name='adsmsg.LinkRecord.METRICS', index=10, number=11, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='METRICS', full_name='adsmsg.LinkRecord.METRICS', index=11, + name='OPENURL', full_name='adsmsg.LinkRecord.OPENURL', index=11, number=12, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='OPENURL', full_name='adsmsg.LinkRecord.OPENURL', index=12, + name='REFERENCES', full_name='adsmsg.LinkRecord.REFERENCES', index=12, number=13, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name='REFERENCES', full_name='adsmsg.LinkRecord.REFERENCES', index=13, + name='TOC', full_name='adsmsg.LinkRecord.TOC', index=13, number=14, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, @@ -264,7 +264,7 @@ oneofs=[ ], serialized_start=100, - serialized_end=682, + serialized_end=658, ) @@ -308,8 +308,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=684, - serialized_end=772, + serialized_start=660, + serialized_end=748, ) @@ -346,8 +346,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=774, - serialized_end=873, + serialized_start=750, + serialized_end=849, ) _LINKRECORD_DATAENTRY.fields_by_name['value'].message_type = _LINKTYPERECORD @@ -360,7 +360,6 @@ _LINKRECORD.fields_by_name['INSPIRE'].message_type = _LINKTYPERECORD _LINKRECORD.fields_by_name['LIBRARYCATALOG'].message_type = _LINKTYPERECORD _LINKRECORD.fields_by_name['PRESENTATION'].message_type = _LINKTYPERECORD -_LINKRECORD.fields_by_name['TOC'].message_type = _LINKTYPERECORD _DOCUMENTRECORD.fields_by_name['links'].message_type = _LINKRECORD _DOCUMENTRECORDS.fields_by_name['document_records'].message_type = _DOCUMENTRECORD _DOCUMENTRECORDS.fields_by_name['status'].enum_type = status__pb2._STATUS diff --git a/adsmsg/protobuf/nonbibrecord_pb2.py b/adsmsg/protobuf/nonbibrecord_pb2.py index 91a38a2..a12ab22 100644 --- a/adsmsg/protobuf/nonbibrecord_pb2.py +++ b/adsmsg/protobuf/nonbibrecord_pb2.py @@ -1,26 +1,26 @@ +# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: nonbibrecord.proto -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database -from google.protobuf import descriptor_pb2 # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() -import status_pb2 as status__pb2 +from . import status_pb2 as status__pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='nonbibrecord.proto', package='adsmsg', syntax='proto3', - serialized_pb=_b('\n\x12nonbibrecord.proto\x12\x06\x61\x64smsg\x1a\x0cstatus.proto\"\xb1\x03\n\x0cNonBibRecord\x12\x0f\n\x07\x62ibcode\x18\x01 \x01(\t\x12\x16\n\x0esimbad_objects\x18\x03 \x03(\t\x12\x0e\n\x06grants\x18\x04 \x03(\t\x12\r\n\x05\x62oost\x18\x06 \x01(\x02\x12\x16\n\x0e\x63itation_count\x18\x07 \x01(\x05\x12\x12\n\nread_count\x18\x08 \x01(\x05\x12\x0f\n\x07readers\x18\t \x03(\t\x12\x11\n\treference\x18\x0c \x03(\t\x12\x13\n\x0bned_objects\x18\r \x03(\t\x12\x0c\n\x04\x64\x61ta\x18\x0e \x03(\t\x12\x19\n\x11total_link_counts\x18\x0f \x01(\x05\x12\x0f\n\x07\x65source\x18\x11 \x03(\t\x12\x10\n\x08property\x18\x12 \x03(\t\x12-\n\x0f\x64\x61ta_links_rows\x18\x13 \x03(\x0b\x32\x14.adsmsg.DataLinksRow\x12\x1e\n\x06status\x18\x14 \x01(\x0e\x32\x0e.adsmsg.Status\x12\x12\n\nnorm_cites\x18\x15 \x01(\x05\x12\x1b\n\x13\x63itation_count_norm\x18\x16 \x01(\x02\x12\x10\n\x08\x62ibgroup\x18\x17 \x03(\t\x12\x16\n\x0e\x62ibgroup_facet\x18\x18 \x03(\t\"h\n\x0c\x44\x61taLinksRow\x12\x11\n\tlink_type\x18\x01 \x01(\t\x12\x15\n\rlink_sub_type\x18\x02 \x01(\t\x12\x0b\n\x03url\x18\x03 \x03(\t\x12\r\n\x05title\x18\x04 \x03(\t\x12\x12\n\nitem_count\x18\x05 \x01(\x05\"`\n\x10NonBibRecordList\x12,\n\x0enonbib_records\x18\x01 \x03(\x0b\x32\x14.adsmsg.NonBibRecord\x12\x1e\n\x06status\x18\x02 \x01(\x0e\x32\x0e.adsmsg.Status\"Q\n\x0f\x44\x61taLinksRecord\x12\x0f\n\x07\x62ibcode\x18\x01 \x01(\t\x12-\n\x0f\x64\x61ta_links_rows\x18\x02 \x03(\x0b\x32\x14.adsmsg.DataLinksRow\"i\n\x13\x44\x61taLinksRecordList\x12\x32\n\x11\x64\x61talinks_records\x18\x01 \x03(\x0b\x32\x17.adsmsg.DataLinksRecord\x12\x1e\n\x06status\x18\x02 \x01(\x0e\x32\x0e.adsmsg.Statusb\x06proto3') + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\x12nonbibrecord.proto\x12\x06\x61\x64smsg\x1a\x0cstatus.proto\"\xb1\x03\n\x0cNonBibRecord\x12\x0f\n\x07\x62ibcode\x18\x01 \x01(\t\x12\x16\n\x0esimbad_objects\x18\x03 \x03(\t\x12\x0e\n\x06grants\x18\x04 \x03(\t\x12\r\n\x05\x62oost\x18\x06 \x01(\x02\x12\x16\n\x0e\x63itation_count\x18\x07 \x01(\x05\x12\x12\n\nread_count\x18\x08 \x01(\x05\x12\x0f\n\x07readers\x18\t \x03(\t\x12\x11\n\treference\x18\x0c \x03(\t\x12\x13\n\x0bned_objects\x18\r \x03(\t\x12\x0c\n\x04\x64\x61ta\x18\x0e \x03(\t\x12\x19\n\x11total_link_counts\x18\x0f \x01(\x05\x12\x0f\n\x07\x65source\x18\x11 \x03(\t\x12\x10\n\x08property\x18\x12 \x03(\t\x12-\n\x0f\x64\x61ta_links_rows\x18\x13 \x03(\x0b\x32\x14.adsmsg.DataLinksRow\x12\x1e\n\x06status\x18\x14 \x01(\x0e\x32\x0e.adsmsg.Status\x12\x12\n\nnorm_cites\x18\x15 \x01(\x05\x12\x1b\n\x13\x63itation_count_norm\x18\x16 \x01(\x02\x12\x10\n\x08\x62ibgroup\x18\x17 \x03(\t\x12\x16\n\x0e\x62ibgroup_facet\x18\x18 \x03(\t\"h\n\x0c\x44\x61taLinksRow\x12\x11\n\tlink_type\x18\x01 \x01(\t\x12\x15\n\rlink_sub_type\x18\x02 \x01(\t\x12\x0b\n\x03url\x18\x03 \x03(\t\x12\r\n\x05title\x18\x04 \x03(\t\x12\x12\n\nitem_count\x18\x05 \x01(\x05\"`\n\x10NonBibRecordList\x12,\n\x0enonbib_records\x18\x01 \x03(\x0b\x32\x14.adsmsg.NonBibRecord\x12\x1e\n\x06status\x18\x02 \x01(\x0e\x32\x0e.adsmsg.Status\"Q\n\x0f\x44\x61taLinksRecord\x12\x0f\n\x07\x62ibcode\x18\x01 \x01(\t\x12-\n\x0f\x64\x61ta_links_rows\x18\x02 \x03(\x0b\x32\x14.adsmsg.DataLinksRow\"i\n\x13\x44\x61taLinksRecordList\x12\x32\n\x11\x64\x61talinks_records\x18\x01 \x03(\x0b\x32\x17.adsmsg.DataLinksRecord\x12\x1e\n\x06status\x18\x02 \x01(\x0e\x32\x0e.adsmsg.Statusb\x06proto3' , dependencies=[status__pb2.DESCRIPTOR,]) @@ -33,147 +33,148 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='bibcode', full_name='adsmsg.NonBibRecord.bibcode', index=0, number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), + has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='simbad_objects', full_name='adsmsg.NonBibRecord.simbad_objects', index=1, number=3, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='grants', full_name='adsmsg.NonBibRecord.grants', index=2, number=4, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='boost', full_name='adsmsg.NonBibRecord.boost', index=3, number=6, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='citation_count', full_name='adsmsg.NonBibRecord.citation_count', index=4, number=7, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='read_count', full_name='adsmsg.NonBibRecord.read_count', index=5, number=8, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='readers', full_name='adsmsg.NonBibRecord.readers', index=6, number=9, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='reference', full_name='adsmsg.NonBibRecord.reference', index=7, number=12, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='ned_objects', full_name='adsmsg.NonBibRecord.ned_objects', index=8, number=13, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='data', full_name='adsmsg.NonBibRecord.data', index=9, number=14, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='total_link_counts', full_name='adsmsg.NonBibRecord.total_link_counts', index=10, number=15, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='esource', full_name='adsmsg.NonBibRecord.esource', index=11, number=17, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='property', full_name='adsmsg.NonBibRecord.property', index=12, number=18, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='data_links_rows', full_name='adsmsg.NonBibRecord.data_links_rows', index=13, number=19, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='status', full_name='adsmsg.NonBibRecord.status', index=14, number=20, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='norm_cites', full_name='adsmsg.NonBibRecord.norm_cites', index=15, number=21, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='citation_count_norm', full_name='adsmsg.NonBibRecord.citation_count_norm', index=16, number=22, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='bibgroup', full_name='adsmsg.NonBibRecord.bibgroup', index=17, number=23, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='bibgroup_facet', full_name='adsmsg.NonBibRecord.bibgroup_facet', index=18, number=24, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], - options=None, + serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], @@ -190,49 +191,50 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='link_type', full_name='adsmsg.DataLinksRow.link_type', index=0, number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), + has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='link_sub_type', full_name='adsmsg.DataLinksRow.link_sub_type', index=1, number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), + has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='url', full_name='adsmsg.DataLinksRow.url', index=2, number=3, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='title', full_name='adsmsg.DataLinksRow.title', index=3, number=4, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='item_count', full_name='adsmsg.DataLinksRow.item_count', index=4, number=5, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], - options=None, + serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], @@ -249,6 +251,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='nonbib_records', full_name='adsmsg.NonBibRecordList.nonbib_records', index=0, @@ -256,21 +259,21 @@ has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='status', full_name='adsmsg.NonBibRecordList.status', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], - options=None, + serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], @@ -287,28 +290,29 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='bibcode', full_name='adsmsg.DataLinksRecord.bibcode', index=0, number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=_b("").decode('utf-8'), + has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='data_links_rows', full_name='adsmsg.DataLinksRecord.data_links_rows', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], - options=None, + serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], @@ -325,6 +329,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='datalinks_records', full_name='adsmsg.DataLinksRecordList.datalinks_records', index=0, @@ -332,21 +337,21 @@ has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='status', full_name='adsmsg.DataLinksRecordList.status', index=1, number=2, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - options=None), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], - options=None, + serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], @@ -370,40 +375,40 @@ DESCRIPTOR.message_types_by_name['DataLinksRecordList'] = _DATALINKSRECORDLIST _sym_db.RegisterFileDescriptor(DESCRIPTOR) -NonBibRecord = _reflection.GeneratedProtocolMessageType('NonBibRecord', (_message.Message,), dict( - DESCRIPTOR = _NONBIBRECORD, - __module__ = 'nonbibrecord_pb2' +NonBibRecord = _reflection.GeneratedProtocolMessageType('NonBibRecord', (_message.Message,), { + 'DESCRIPTOR' : _NONBIBRECORD, + '__module__' : 'nonbibrecord_pb2' # @@protoc_insertion_point(class_scope:adsmsg.NonBibRecord) - )) + }) _sym_db.RegisterMessage(NonBibRecord) -DataLinksRow = _reflection.GeneratedProtocolMessageType('DataLinksRow', (_message.Message,), dict( - DESCRIPTOR = _DATALINKSROW, - __module__ = 'nonbibrecord_pb2' +DataLinksRow = _reflection.GeneratedProtocolMessageType('DataLinksRow', (_message.Message,), { + 'DESCRIPTOR' : _DATALINKSROW, + '__module__' : 'nonbibrecord_pb2' # @@protoc_insertion_point(class_scope:adsmsg.DataLinksRow) - )) + }) _sym_db.RegisterMessage(DataLinksRow) -NonBibRecordList = _reflection.GeneratedProtocolMessageType('NonBibRecordList', (_message.Message,), dict( - DESCRIPTOR = _NONBIBRECORDLIST, - __module__ = 'nonbibrecord_pb2' +NonBibRecordList = _reflection.GeneratedProtocolMessageType('NonBibRecordList', (_message.Message,), { + 'DESCRIPTOR' : _NONBIBRECORDLIST, + '__module__' : 'nonbibrecord_pb2' # @@protoc_insertion_point(class_scope:adsmsg.NonBibRecordList) - )) + }) _sym_db.RegisterMessage(NonBibRecordList) -DataLinksRecord = _reflection.GeneratedProtocolMessageType('DataLinksRecord', (_message.Message,), dict( - DESCRIPTOR = _DATALINKSRECORD, - __module__ = 'nonbibrecord_pb2' +DataLinksRecord = _reflection.GeneratedProtocolMessageType('DataLinksRecord', (_message.Message,), { + 'DESCRIPTOR' : _DATALINKSRECORD, + '__module__' : 'nonbibrecord_pb2' # @@protoc_insertion_point(class_scope:adsmsg.DataLinksRecord) - )) + }) _sym_db.RegisterMessage(DataLinksRecord) -DataLinksRecordList = _reflection.GeneratedProtocolMessageType('DataLinksRecordList', (_message.Message,), dict( - DESCRIPTOR = _DATALINKSRECORDLIST, - __module__ = 'nonbibrecord_pb2' +DataLinksRecordList = _reflection.GeneratedProtocolMessageType('DataLinksRecordList', (_message.Message,), { + 'DESCRIPTOR' : _DATALINKSRECORDLIST, + '__module__' : 'nonbibrecord_pb2' # @@protoc_insertion_point(class_scope:adsmsg.DataLinksRecordList) - )) + }) _sym_db.RegisterMessage(DataLinksRecordList) -# @@protoc_insertion_point(module_scope) +# @@protoc_insertion_point(module_scope) \ No newline at end of file diff --git a/adsmsg/tests/test_master.py b/adsmsg/tests/test_master.py index 0e781f7..85bcdb8 100644 --- a/adsmsg/tests/test_master.py +++ b/adsmsg/tests/test_master.py @@ -125,7 +125,7 @@ def test_document_records(self): 'title': ['https://doi.org/10.1038%2F375659a0']} }, 'INSPIRE': {'url': ['http://inspirehep.net/search?p=find+j+NATUA,375,659']}, - 'TOC': {'url': ['/abs/1995Natur.375..659T/toc']}} + 'TOC': True} } ] } diff --git a/specs/master.proto b/specs/master.proto index 7e4ca7c..b64b65b 100644 --- a/specs/master.proto +++ b/specs/master.proto @@ -22,12 +22,12 @@ message LinkRecord { LinkTypeRecord INSPIRE = 6; LinkTypeRecord LIBRARYCATALOG = 7; LinkTypeRecord PRESENTATION = 8; - LinkTypeRecord TOC = 9; - bool CITATIONS = 10; - bool GRAPHICS = 11; - bool METRICS = 12; - bool OPENURL = 13; - bool REFERENCES = 14; + bool CITATIONS = 9; + bool GRAPHICS = 10; + bool METRICS = 11; + bool OPENURL = 12; + bool REFERENCES = 13; + bool TOC = 14; } message DocumentRecord {