Martin von Löwis avatar Martin von Löwis committed 6219617

Add attribute documentation

Comments (0)

Files changed (3)

      :attr:`special`
        an instance of :class:`Special`
      :attr:`alt`
+       a string
      :attr:`draft`
+       One of the values 'approved', 'contributed', 'provisional', 'unconfirmed'.
      :attr:`path`
+       a string
      :attr:`source`
+       a string
 
 .. class:: Any
    - XXX child of YYY element
      :attr:`special`
        an instance of :class:`Special`
      :attr:`hex`
+       a string
 
 .. class:: Default
    - XXX child of YYY element
      :attr:`special`
        an instance of :class:`Special`
      :attr:`alt`
+       a string
      :attr:`choice`
+       a string
      :attr:`draft`
+       One of the values 'approved', 'contributed', 'provisional', 'unconfirmed'.
      :attr:`references`
+       a string
      :attr:`type`
+       a string
 
 .. class:: Empty
    - XXX child of YYY element
    - the class has the following attributes:
 
      :attr:`alt`
+       a string
      :attr:`draft`
+       One of the values 'approved', 'contributed', 'provisional', 'unconfirmed'.
      :attr:`references`
+       a string
 
 .. class:: Generation
    - XXX child of YYY element
    - the class has the following attributes:
 
      :attr:`date`
+       a string
 
 .. class:: Identity
    - XXX child of YYY element
    - the class has the following attributes:
 
      :attr:`alt`
+       a string
      :attr:`draft`
+       One of the values 'approved', 'contributed', 'provisional', 'unconfirmed'.
      :attr:`references`
+       a string
      :attr:`type`
+       a string
 
 .. class:: Languages
    - XXX child of YYY element
      :attr:`special`
        an instance of :class:`Special`
      :attr:`draft`
+       One of the values 'approved', 'contributed', 'provisional', 'unconfirmed'.
      :attr:`references`
+       a string
      :attr:`standard`
+       a string
      :attr:`validSublocales`
+       a string
 
 .. class:: LocaleDisplayNames
    - XXX child of YYY element
      :attr:`variants`
        an instance of :class:`Variants`
      :attr:`draft`
+       One of the values 'approved', 'contributed', 'provisional', 'unconfirmed'.
 
 .. class:: LocaleDisplayPattern
    - XXX child of YYY element
      :attr:`special`
        an instance of :class:`Special`
      :attr:`alt`
+       a string
      :attr:`draft`
+       One of the values 'approved', 'contributed', 'provisional', 'unconfirmed'.
      :attr:`reference`
+       a string
 
 .. class:: Numbers
    - XXX child of YYY element
    - the class has the following attributes:
 
      :attr:`alt`
+       a string
      :attr:`draft`
+       One of the values 'approved', 'contributed', 'provisional', 'unconfirmed'.
      :attr:`references`
+       a string
      :attr:`type`
+       a string
 
 .. class:: Special
    - XXX child of YYY element
      :attr:`special`
        an instance of :class:`Special`
      :attr:`alt`
+       a string
      :attr:`draft`
+       One of the values 'approved', 'contributed', 'provisional', 'unconfirmed'.
      :attr:`numberSystem`
+       a string
      :attr:`references`
+       a string
      :attr:`standard`
+       a string
      :attr:`validSubLocales`
+       a string
 
 .. class:: Territories
    - XXX child of YYY element
      :attr:`territory`
        an instance of :class:`Territory`
      :attr:`draft`
+       One of the values 'approved', 'contributed', 'provisional', 'unconfirmed'.
      :attr:`references`
+       a string
      :attr:`standard`
+       a string
      :attr:`validSublocales`
+       a string
 
 .. class:: Territory
    - XXX child of YYY element
    - the class has the following attributes:
 
      :attr:`alt`
+       a string
      :attr:`draft`
+       One of the values 'approved', 'contributed', 'provisional', 'unconfirmed'.
      :attr:`references`
+       a string
      :attr:`type`
+       a BCP 47 subtag value of type region, e.g. GB or DE
 
 .. class:: Variant
    - XXX child of YYY element
    - the class has the following attributes:
 
      :attr:`alt`
+       a string
      :attr:`draft`
+       One of the values 'approved', 'contributed', 'provisional', 'unconfirmed'.
      :attr:`references`
+       a string
      :attr:`type`
+       a string
 
 .. class:: Version
    - XXX child of YYY element
    - the class has the following attributes:
 
      :attr:`cldrVersion`
+       a string
      :attr:`number`
+       a string
             print('       an instance of :class:`%s`' % name.title())
         for name, info in attrs:
             print('     :attr:`%s`' % name)
+            print('       ' + info.doc)
 
 print("""\
 :mod:`cldr` --- Unicode Common Locale Data Repository for Python
         super().__init__(('type',))
 
 class Attribute(XMLInfo):
-    pass
+    doc = 'a string'
+    def __init__(self, doc=None):
+        if doc:
+            self.doc = doc
 
 class DraftAttribute(Attribute):
-    pass
+    doc = '''One of the values 'approved', 'contributed', 'provisional', 'unconfirmed'.'''
+
 
 element2class = {}
 class LDMLMeta(type):
     alt = Attribute()
     
 class Territory(PCDATA):
-    type = Attribute()
+    type = Attribute(doc='a BCP 47 subtag value of type region, e.g. GB or DE')
     draft = DraftAttribute()
     references = Attribute()
     alt = Attribute()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.