• Home
  • Raw
  • Download

Lines Matching refs:self

17     def __init__(self, *args, **kwargs):  argument
26 def __init__(self, argument
41 self.generator = generator
42 self.conventions = generator.genOpts.conventions
43 self.filename = filename
44 self.name = name
45 self.number = number
46 self.ext_type = ext_type
47 self.requires = requires
48 self.requiresCore = requiresCore
49 self.contact = contact
50 self.promotedTo = promotedTo
51 self.deprecatedBy = deprecatedBy
52 self.obsoletedBy = obsoletedBy
53 self.provisional = provisional
54 self.revision = revision
55 self.specialuse = specialuse
57 self.deprecationType = None
58 self.supercedingAPIVersion = None
59 self.supercedingExtension = None
61 … if self.promotedTo is not None and self.deprecatedBy is not None and self.obsoletedBy is not None:
62self.generator.logMsg('warn', 'All \'promotedto\', \'deprecatedby\' and \'obsoletedby\' attributes…
63 elif self.promotedTo is not None and self.deprecatedBy is not None:
64self.generator.logMsg('warn', 'Both \'promotedto\' and \'deprecatedby\' attributes used on extensi…
65 elif self.promotedTo is not None and self.obsoletedBy is not None:
66self.generator.logMsg('warn', 'Both \'promotedto\' and \'obsoletedby\' attributes used on extensio…
67 elif self.deprecatedBy is not None and self.obsoletedBy is not None:
68self.generator.logMsg('warn', 'Both \'deprecatedby\' and \'obsoletedby\' attributes used on extens…
71 if self.promotedTo is not None:
72 self.deprecationType = 'promotion'
74 elif self.deprecatedBy is not None:
75 self.deprecationType = 'deprecation'
77 elif self.obsoletedBy is not None:
78 self.deprecationType = 'obsoletion'
82 if supercededBy == '' and not self.deprecationType == 'promotion':
84 elif supercededBy.startswith(self.conventions.api_version_prefix):
85 self.supercedingAPIVersion = supercededBy
86 elif supercededBy.startswith(self.conventions.api_prefix):
87 self.supercedingExtension = supercededBy
89self.generator.logMsg('error', 'Unrecognized ' + self.deprecationType + ' attribute value \'' + su…
91 match = EXT_NAME_DECOMPOSE_RE.match(self.name)
92 self.vendor = match.group('tag')
93 self.bare_name = match.group('name')
95 def __str__(self): argument
96 return self.name
97 def __eq__(self, other): argument
98 return self.name == other.name
99 def __ne__(self, other): argument
100 return self.name != other.name
102 def __lt__(self, other): argument
103 self_is_KHR = self.name.startswith(self.conventions.KHR_prefix)
104 self_is_EXT = self.name.startswith(self.conventions.EXT_prefix)
105 other_is_KHR = other.name.startswith(self.conventions.KHR_prefix)
106 other_is_EXT = other.name.startswith(self.conventions.EXT_prefix)
118 return self.name < other.name
120 def typeToStr(self): argument
121 if self.ext_type == 'instance':
123 if self.ext_type == 'device':
126 if self.ext_type is not None:
127self.generator.logMsg('warn', 'The type attribute of ' + self.name + ' extension is neither \'inst…
129 self.generator.logMsg('error', 'Logic error in typeToStr(): Missing type attribute!')
132 def specLink(self, xrefName, xrefText, isRefpage = False): argument
143 specURL = self.conventions.specURL('api')
148 def conditionalLinkCoreAPI(self, apiVersion, linkSuffix, isRefpage): argument
149 versionMatch = re.match(self.conventions.api_version_prefix + r'(\d+)_(\d+)', apiVersion)
156 xrefText = self.conventions.api_name() + ' ' + dottedVersion
159 doc += ' ' + self.specLink(xrefName, xrefText, isRefpage) + '\n'
162 doc += ' ' + self.conventions.api_name() + ' ' + dottedVersion + '\n'
167 def conditionalLinkExt(self, extName, indent = ' '): argument
169 doc += indent + self.conventions.formatExtension(extName) + '\n'
177 def resolveDeprecationChain(self, extensionsList, succeededBy, isRefpage, file): argument
204self.generator.logMsg('error', 'Logic error in resolveDeprecationChain(): deprecationType is neith…
207 def writeTag(self, tag, value, isRefpage, fp): argument
231 def makeMetafile(self, extensionsList, isRefpage = False): argument
240 filename = self.filename.replace('meta/', 'meta/refpage.')
242 filename = self.filename
244 fp = self.generator.newFile(filename)
247 write('[[' + self.name + ']]', file=fp)
248 write('=== ' + self.name, file=fp)
251 self.writeTag('Name String', '`' + self.name + '`', isRefpage, fp)
252 self.writeTag('Extension Type', self.typeToStr(), isRefpage, fp)
254 self.writeTag('Registered Extension Number', self.number, isRefpage, fp)
255 self.writeTag('Revision', self.revision, isRefpage, fp)
258 self.writeTag('Extension and Version Dependencies', None, isRefpage, fp)
260 write(' * Requires ' + self.conventions.api_name() + ' ' + self.requiresCore, file=fp)
261 if self.requires:
262 for dep in self.requires.split(','):
263 write(' * Requires', self.conventions.formatExtension(dep),
265 if self.provisional == 'true':
268 self.specLink(xrefName = 'boilerplate-provisional-header',
274 if self.deprecationType:
275 self.writeTag('Deprecation state', None, isRefpage, fp)
277 if self.deprecationType == 'promotion':
278 if self.supercedingAPIVersion:
279 …write(' * _Promoted_ to\n' + self.conditionalLinkCoreAPI(self.supercedingAPIVersion, '-promotions…
281 …write(' * _Promoted_ to\n' + self.conditionalLinkExt(self.supercedingExtension) + ' extension'…
282self.resolveDeprecationChain(extensionsList, self.supercedingExtension, isRefpage, fp)
283 elif self.deprecationType == 'deprecation':
284 if self.supercedingAPIVersion:
285 …write(' * _Deprecated_ by\n' + self.conditionalLinkCoreAPI(self.supercedingAPIVersion, '-new-feat…
286 elif self.supercedingExtension:
287 …write(' * _Deprecated_ by\n' + self.conditionalLinkExt(self.supercedingExtension) + ' extensio…
288self.resolveDeprecationChain(extensionsList, self.supercedingExtension, isRefpage, fp)
291 elif self.deprecationType == 'obsoletion':
292 if self.supercedingAPIVersion:
293 …write(' * _Obsoleted_ by\n' + self.conditionalLinkCoreAPI(self.supercedingAPIVersion, '-new-featu…
294 elif self.supercedingExtension:
295 …write(' * _Obsoleted_ by\n' + self.conditionalLinkExt(self.supercedingExtension) + ' extension…
296self.resolveDeprecationChain(extensionsList, self.supercedingExtension, isRefpage, fp)
302self.generator.logMsg('error', 'Logic error in makeMetafile(): deprecationType is neither \'promot…
305 if self.specialuse is not None:
306 specialuses = self.specialuse.split(',')
311 self.writeTag(header, None, isRefpage, fp)
318 self.specLink(
319 xrefName = self.conventions.special_use_section_anchor,
324 if self.conventions.write_contacts:
325 self.writeTag('Contact', None, isRefpage, fp)
327 contacts = self.contact.split(',')
335 issuePlaceholderText = '[' + self.name + '] ' + handle
336 …rText += '%0A<<Here describe the issue or question you have about the ' + self.name + ' extension>…
352 path = 'proposals/{}.asciidoc'.format(self.name)
354 self.writeTag('Extension Proposal',
355 'link:{{specRepositoryURL}}/{}[{}]'.format(path, self.name), isRefpage, fp)
384 def __init__(self, *args, **kwargs): argument
386 self.extensions = []
388 self.vendor_tags = []
389 self.file_suffix = ''
391 def newFile(self, filename): argument
392 self.logMsg('diag', '# Generating include file:', filename)
394 write(self.genOpts.conventions.warning_comment, file=fp)
397 def beginFile(self, genOpts): argument
398 OutputGenerator.beginFile(self, genOpts)
400 self.directory = self.genOpts.directory
401 self.file_suffix = self.genOpts.conventions.file_suffix
405 root = self.registry.tree.getroot()
407 self.vendor_tags.append(tag.get('name'))
410 self.makeDir(self.directory)
412 def conditionalExt(self, extName, content, ifdef = None, condition = None): argument
441 def makeExtensionInclude(self, ext): argument
442 return self.conventions.extension_include_string(ext)
444 def endFile(self): argument
445 self.extensions.sort()
448 for ext in self.extensions:
449 ext.makeMetafile(self.extensions, isRefpage = False)
450 if self.conventions.write_refpage_include:
451 ext.makeMetafile(self.extensions, isRefpage = True)
455 for ext in self.extensions:
460 …promoted_extensions_fp = self.newFile(self.directory + '/promoted_extensions_' + coreVersion + sel…
473 prefixes = self.conventions.extension_index_prefixes
479 self.extensions.sort(key=makeSortKey)
483 …with self.newFile(self.directory + '/current_extensions_appendix' + self.file_suffix) as current_e…
484self.newFile(self.directory + '/deprecated_extensions_appendix' + self.file_suffix) as deprecated_…
485self.newFile(self.directory + '/current_extension_appendices' + self.file_suffix) as current_exten…
486self.newFile(self.directory + '/current_extension_appendices_toc' + self.file_suffix) as current_e…
487self.newFile(self.directory + '/deprecated_extension_appendices' + self.file_suffix) as deprecated…
488self.newFile(self.directory + '/deprecated_extension_appendices_toc' + self.file_suffix) as deprec…
489self.newFile(self.directory + '/deprecated_extensions_guard_macro' + self.file_suffix) as deprecat…
490self.newFile(self.directory + '/provisional_extensions_appendix' + self.file_suffix) as provisiona…
491self.newFile(self.directory + '/provisional_extension_appendices' + self.file_suffix) as provision…
492self.newFile(self.directory + '/provisional_extension_appendices_toc' + self.file_suffix) as provi…
493self.newFile(self.directory + '/provisional_extensions_guard_macro' + self.file_suffix) as provisi…
496 …write('include::deprecated_extensions_guard_macro' + self.file_suffix + '[]', file=current_extensi…
507 …write('include::current_extension_appendices_toc' + self.file_suffix + '[]', file=current_extensio…
509 …write('include::current_extension_appendices' + self.file_suffix + '[]', file=current_extensions_a…
512 …write('include::deprecated_extensions_guard_macro' + self.file_suffix + '[]', file=deprecated_exte…
517 …write('include::deprecated_extension_appendices_toc' + self.file_suffix + '[]', file=deprecated_ex…
519 …write('include::deprecated_extension_appendices' + self.file_suffix + '[]', file=deprecated_extens…
529 …write('include::provisional_extensions_guard_macro' + self.file_suffix + '[]', file=provisional_ex…
534 …write('include::provisional_extension_appendices_toc' + self.file_suffix + '[]', file=provisional_…
536 …write('include::provisional_extension_appendices' + self.file_suffix + '[]', file=provisional_exte…
539 for ext in self.extensions:
540 include = self.makeExtensionInclude(ext)
541 link = ' * ' + self.conventions.formatExtension(ext.name)
543 … write(self.conditionalExt(ext.name, include), file=provisional_extension_appendices_fp)
544 … write(self.conditionalExt(ext.name, link), file=provisional_extension_appendices_toc_fp)
545 …write(self.conditionalExt(ext.name, ':HAS_PROVISIONAL_EXTENSIONS:'), file=provisional_extensions_g…
547 … write(self.conditionalExt(ext.name, include), file=current_extension_appendices_fp)
548 … write(self.conditionalExt(ext.name, link), file=current_extension_appendices_toc_fp)
552 …write(self.conditionalExt(ext.name, include, 'ifndef', condition), file=current_extension_appendic…
553 …write(self.conditionalExt(ext.name, link, 'ifndef', condition), file=current_extension_appendices_…
555 …write(self.conditionalExt(ext.name, include, 'ifdef', condition), file=deprecated_extension_append…
556 …write(self.conditionalExt(ext.name, link, 'ifdef', condition), file=deprecated_extension_appendice…
558 …write(self.conditionalExt(ext.name, ':HAS_DEPRECATED_EXTENSIONS:', 'ifdef', condition), file=depre…
563 OutputGenerator.endFile(self)
565 def beginFeature(self, interface, emit): argument
567 OutputGenerator.beginFeature(self, interface, emit)
570 self.logMsg('diag', 'beginFeature: ignoring non-extension feature', self.featureName)
574 name = self.featureName
575 number = self.getAttrib(interface, 'number')
576 ext_type = self.getAttrib(interface, 'type')
577 revision = self.getSpecVersion(interface, name)
581 requires = self.getAttrib(interface, 'requires', OPTIONAL)
582 …requiresCore = self.getAttrib(interface, 'requiresCore', OPTIONAL, '1.0') # TODO update this line …
583 contact = self.getAttrib(interface, 'contact', OPTIONAL)
584 promotedTo = self.getAttrib(interface, 'promotedto', OPTIONAL)
585 deprecatedBy = self.getAttrib(interface, 'deprecatedby', OPTIONAL)
586 obsoletedBy = self.getAttrib(interface, 'obsoletedby', OPTIONAL)
587 provisional = self.getAttrib(interface, 'provisional', OPTIONAL, 'false')
588 specialuse = self.getAttrib(interface, 'specialuse', OPTIONAL)
590 filename = self.directory + '/' + name + self.file_suffix
593 generator = self,
607 self.extensions.append(extdata)
610 def endFeature(self): argument
612 OutputGenerator.endFeature(self)
614 def getAttrib(self, elem, attribute, required=True, default=None): argument
624self.logMsg('error', 'While processing \'' + self.featureName + ', <' + elem.tag + '> \'' + name +…
627 def numbersToWords(self, name): argument
642 def getSpecVersion(self, elem, extname, default=None): argument
650 versioningEnumName = self.numbersToWords(extname.upper()) + '_SPEC_VERSION'
653 enumName = self.getAttrib(enum, 'name')
655 return self.getAttrib(enum, 'value')
659 enumName = self.getAttrib(enum, 'name')
661self.logMsg('diag', 'Missing ' + versioningEnumName + '! Potential misnamed candidate ' + enumName…
662 return self.getAttrib(enum, 'value')
664 self.logMsg('error', 'Missing ' + versioningEnumName + '!')