Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some references to NAPI for #699 #722

Merged
merged 2 commits into from
Jan 23, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions nxdl.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -724,11 +724,12 @@
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="type" type="nx:NAPI" default="NX_CHAR">
<xs:attribute name="type" type="nx:primitiveType" default="NX_CHAR">
<xs:annotation>
<xs:documentation>
Defines the type of the element as allowed by the NAPI (NeXus Application Programmer Interface).
See elsewhere for the complete list of allowed NAPI types.
Defines the type of the element as allowed by NeXus.

See :ref:`here&lt;Design-DataTypes&gt;` and :ref:`elsewhere&lt;nxdl-types&gt;` for the complete list of allowed types.
</xs:documentation>
</xs:annotation>
</xs:attribute>
Expand Down
10 changes: 0 additions & 10 deletions nxdlTypes.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -435,16 +435,6 @@
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<xs:simpleType name="primitiveType">
<xs:annotation>
<xs:documentation>
Valid names for the type attribute on fields and attributes.
This is an alias for NAPI (which is any valid NeXus type).
</xs:documentation>
</xs:annotation>
<xs:list itemType="nxdl:NAPI" />
</xs:simpleType>

<xs:simpleType name="NAPI">
<xs:annotation>
<xs:documentation>any valid NeXus type</xs:documentation>
</xs:annotation>
Expand Down
11 changes: 11 additions & 0 deletions utils/nxdl_desc2rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,17 @@ def getDocFromNode(ns, node, retval=None):
if not len(line[:indent].strip()) == 0:
raise "Something wrong with indentation on this line:\n" + line
text += '\n' + line[indent:]

# substitute HTML entities in markup: "<" for "&lt;"
# thanks: http://stackoverflow.com/questions/2087370/decode-html-entities-in-python-string
try: # see #661
import html
text = html.unescape(text)
except (ImportError, AttributeError):
from six.moves import html_parser as HTMLParser
htmlparser = HTMLParser.HTMLParser()
text = htmlparser.unescape(text)

return text.lstrip()


Expand Down
2 changes: 1 addition & 1 deletion utils/types2rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


if __name__ == '__main__':
units2rst.worker('NAPI', section = 'data')
units2rst.worker('primitiveType', section = 'data')


# NeXus - Neutron and X-ray Common Data Format
Expand Down