Commits

Martin von Löwis committed 3a6a6f9

Add child type info.

Comments (0)

Files changed (2)

 
 
 .. class:: Alias
-   :noindex:
-
    - XXX child of YYY element
    - the class has the following attributes:
 
-     - :attr:`alt`
-     - :attr:`draft`
-     - :attr:`special`
-     - :attr:`path`
-     - :attr:`source`
+     :attr:`special`
+       an instance of :class:`Special`
+     :attr:`alt`
+     :attr:`draft`
+     :attr:`path`
+     :attr:`source`
 
 .. class:: Any
-   :noindex:
-
    - XXX child of YYY element
 
 .. class:: Cp
-   :noindex:
-
    - XXX child of YYY element
    - the class has the following attributes:
 
-     - :attr:`special`
-     - :attr:`hex`
+     :attr:`special`
+       an instance of :class:`Special`
+     :attr:`hex`
 
 .. class:: Default
-   :noindex:
-
    - XXX child of YYY element
    - the class has the following attributes:
 
-     - :attr:`references`
-     - :attr:`draft`
-     - :attr:`special`
-     - :attr:`choice`
-     - :attr:`type`
-     - :attr:`alt`
+     :attr:`special`
+       an instance of :class:`Special`
+     :attr:`alt`
+     :attr:`choice`
+     :attr:`draft`
+     :attr:`references`
+     :attr:`type`
 
 .. class:: Empty
-   :noindex:
-
    - XXX child of YYY element
 
 .. class:: Fallback
-   :noindex:
-
    - XXX child of YYY element
    - the class has the following attributes:
 
-     - :attr:`references`
-     - :attr:`draft`
-     - :attr:`alt`
+     :attr:`alt`
+     :attr:`draft`
+     :attr:`references`
 
 .. class:: Generation
-   :noindex:
-
    - XXX child of YYY element
    - the class has the following attributes:
 
-     - :attr:`date`
+     :attr:`date`
 
 .. class:: Identity
-   :noindex:
-
    - XXX child of YYY element
    - the class has the following attributes:
 
-     - :attr:`language`
-     - :attr:`special`
-     - :attr:`generation`
-     - :attr:`variant`
-     - :attr:`version`
-     - :attr:`territory`
-     - :attr:`script`
+     :attr:`generation`
+       an instance of :class:`Generation`
+     :attr:`language`
+       an instance of :class:`Language`
+     :attr:`script`
+       an instance of :class:`Script`
+     :attr:`special`
+       an instance of :class:`Special`
+     :attr:`territory`
+       an instance of :class:`Territory`
+     :attr:`variant`
+       an instance of :class:`Variant`
+     :attr:`version`
+       an instance of :class:`Version`
 
 .. class:: LDMLBase
-   :noindex:
-
    - XXX child of YYY element
 
 .. class:: Language
-   :noindex:
-
    - XXX child of YYY element
    - the class has the following attributes:
 
-     - :attr:`references`
-     - :attr:`type`
-     - :attr:`draft`
-     - :attr:`alt`
+     :attr:`alt`
+     :attr:`draft`
+     :attr:`references`
+     :attr:`type`
 
 .. class:: Languages
-   :noindex:
-
    - XXX child of YYY element
    - the class has the following attributes:
 
-     - :attr:`references`
-     - :attr:`language`
-     - :attr:`standard`
-     - :attr:`special`
-     - :attr:`validSublocales`
-     - :attr:`draft`
+     :attr:`language`
+       an instance of :class:`Language`
+     :attr:`special`
+       an instance of :class:`Special`
+     :attr:`draft`
+     :attr:`references`
+     :attr:`standard`
+     :attr:`validSublocales`
 
 .. class:: LocaleDisplayNames
-   :noindex:
-
    - XXX child of YYY element
    - the class has the following attributes:
 
-     - :attr:`special`
-     - :attr:`measurementSystemNames`
-     - :attr:`types`
-     - :attr:`localeDisplayPattern`
-     - :attr:`variants`
-     - :attr:`scripts`
-     - :attr:`draft`
-     - :attr:`languages`
-     - :attr:`keys`
-     - :attr:`codePatterns`
-     - :attr:`transformNames`
-     - :attr:`territories`
+     :attr:`codePatterns`
+       an instance of :class:`Codepatterns`
+     :attr:`keys`
+       an instance of :class:`Keys`
+     :attr:`languages`
+       an instance of :class:`Languages`
+     :attr:`localeDisplayPattern`
+       an instance of :class:`Localedisplaypattern`
+     :attr:`measurementSystemNames`
+       an instance of :class:`Measurementsystemnames`
+     :attr:`scripts`
+       an instance of :class:`Scripts`
+     :attr:`special`
+       an instance of :class:`Special`
+     :attr:`territories`
+       an instance of :class:`Territories`
+     :attr:`transformNames`
+       an instance of :class:`Transformnames`
+     :attr:`types`
+       an instance of :class:`Types`
+     :attr:`variants`
+       an instance of :class:`Variants`
+     :attr:`draft`
 
 .. class:: LocaleDisplayPattern
-   :noindex:
-
    - XXX child of YYY element
    - the class has the following attributes:
 
-     - :attr:`draft`
-     - :attr:`localePattern`
-     - :attr:`special`
-     - :attr:`alt`
-     - :attr:`localeKeyTypePattern`
-     - :attr:`localeSeparator`
-     - :attr:`reference`
+     :attr:`localeKeyTypePattern`
+       an instance of :class:`Localekeytypepattern`
+     :attr:`localePattern`
+       an instance of :class:`Localepattern`
+     :attr:`localeSeparator`
+       an instance of :class:`Localeseparator`
+     :attr:`special`
+       an instance of :class:`Special`
+     :attr:`alt`
+     :attr:`draft`
+     :attr:`reference`
 
 .. class:: Numbers
-   :noindex:
-
    - XXX child of YYY element
    - the class has the following attributes:
 
-     - :attr:`decimalFormats`
-     - :attr:`currencies`
-     - :attr:`special`
-     - :attr:`symbols`
-     - :attr:`percentFormats`
-     - :attr:`defaultNumberingSystem`
-     - :attr:`scientificFormats`
-     - :attr:`otherNumberingSystems`
-     - :attr:`currencyFormats`
+     :attr:`currencies`
+       an instance of :class:`Currencies`
+     :attr:`currencyFormats`
+       an instance of :class:`Currencyformats`
+     :attr:`decimalFormats`
+       an instance of :class:`Decimalformats`
+     :attr:`defaultNumberingSystem`
+       an instance of :class:`Defaultnumberingsystem`
+     :attr:`otherNumberingSystems`
+       an instance of :class:`Othernumberingsystems`
+     :attr:`percentFormats`
+       an instance of :class:`Percentformats`
+     :attr:`scientificFormats`
+       an instance of :class:`Scientificformats`
+     :attr:`special`
+       an instance of :class:`Special`
+     :attr:`symbols`
+       an instance of :class:`Symbols`
 
 .. class:: PCDATA
-   :noindex:
-
    - XXX child of YYY element
 
 .. class:: PresumedEmpty
-   :noindex:
-
    - XXX child of YYY element
 
 .. class:: Script
-   :noindex:
-
    - XXX child of YYY element
    - the class has the following attributes:
 
-     - :attr:`references`
-     - :attr:`type`
-     - :attr:`draft`
-     - :attr:`alt`
+     :attr:`alt`
+     :attr:`draft`
+     :attr:`references`
+     :attr:`type`
 
 .. class:: Special
-   :noindex:
-
    - XXX child of YYY element
 
 .. class:: Symbols
-   :noindex:
-
    - XXX child of YYY element
    - the class has the following attributes:
 
-     - :attr:`decimal`
-     - :attr:`patternDigit`
-     - :attr:`group`
-     - :attr:`special`
-     - :attr:`numberSystem`
-     - :attr:`percentSign`
-     - :attr:`plusSign`
-     - :attr:`perMille`
-     - :attr:`currencyDecimal`
-     - :attr:`list`
-     - :attr:`references`
-     - :attr:`exponential`
-     - :attr:`draft`
-     - :attr:`standard`
-     - :attr:`minusSign`
-     - :attr:`infinity`
-     - :attr:`alt`
-     - :attr:`nativeZeroDigit`
-     - :attr:`validSubLocales`
-     - :attr:`currencyGroup`
-     - :attr:`nan`
+     :attr:`currencyDecimal`
+       an instance of :class:`Currencydecimal`
+     :attr:`currencyGroup`
+       an instance of :class:`Currencygroup`
+     :attr:`decimal`
+       an instance of :class:`Decimal`
+     :attr:`exponential`
+       an instance of :class:`Exponential`
+     :attr:`group`
+       an instance of :class:`Group`
+     :attr:`infinity`
+       an instance of :class:`Infinity`
+     :attr:`list`
+       an instance of :class:`List`
+     :attr:`minusSign`
+       an instance of :class:`Minussign`
+     :attr:`nan`
+       an instance of :class:`Nan`
+     :attr:`nativeZeroDigit`
+       an instance of :class:`Nativezerodigit`
+     :attr:`patternDigit`
+       an instance of :class:`Patterndigit`
+     :attr:`perMille`
+       an instance of :class:`Permille`
+     :attr:`percentSign`
+       an instance of :class:`Percentsign`
+     :attr:`plusSign`
+       an instance of :class:`Plussign`
+     :attr:`special`
+       an instance of :class:`Special`
+     :attr:`alt`
+     :attr:`draft`
+     :attr:`numberSystem`
+     :attr:`references`
+     :attr:`standard`
+     :attr:`validSubLocales`
 
 .. class:: Territories
-   :noindex:
-
    - XXX child of YYY element
    - the class has the following attributes:
 
-     - :attr:`references`
-     - :attr:`draft`
-     - :attr:`standard`
-     - :attr:`special`
-     - :attr:`territory`
-     - :attr:`validSublocales`
+     :attr:`special`
+       an instance of :class:`Special`
+     :attr:`territory`
+       an instance of :class:`Territory`
+     :attr:`draft`
+     :attr:`references`
+     :attr:`standard`
+     :attr:`validSublocales`
 
 .. class:: Territory
-   :noindex:
-
    - XXX child of YYY element
    - the class has the following attributes:
 
-     - :attr:`references`
-     - :attr:`type`
-     - :attr:`draft`
-     - :attr:`alt`
+     :attr:`alt`
+     :attr:`draft`
+     :attr:`references`
+     :attr:`type`
 
 .. class:: Variant
-   :noindex:
-
    - XXX child of YYY element
    - the class has the following attributes:
 
-     - :attr:`references`
-     - :attr:`type`
-     - :attr:`draft`
-     - :attr:`alt`
+     :attr:`alt`
+     :attr:`draft`
+     :attr:`references`
+     :attr:`type`
 
 .. class:: Version
-   :noindex:
-
    - XXX child of YYY element
    - the class has the following attributes:
 
-     - :attr:`cldrVersion`
-     - :attr:`number`
+     :attr:`cldrVersion`
+     :attr:`number`
 
 def genclass(klasse):
     print('\n.. class:: ' + klasse.__name__)
-    print('   :noindex:\n')
     print('   - XXX child of YYY element')
     if klasse._fields:
         print('   - the class has the following attributes:\n')
-        for name, data in klasse._fields.items():
-            print('     - :attr:`%s`' % name)
-
+        attrs = []
+        elems = []
+        for name, info in klasse._fields.items():
+            if isinstance(info, ldml.Attribute):
+                attrs.append((name, info))
+            else:
+                elems.append((name, info))
+        attrs.sort()
+        elems.sort()
+        for name, info in elems:
+            print('     :attr:`%s`' % name)
+            print('       an instance of :class:`%s`' % name.title())
+        for name, info in attrs:
+            print('     :attr:`%s`' % name)
 
 print("""\
 :mod:`cldr` --- Unicode Common Locale Data Repository for Python