Skip to content

Commit

Permalink
only load documentation if --with-docs is present
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloose committed May 18, 2024
1 parent 6aa033d commit 3ac71f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion glad/generator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def select(self, spec, api, version, profile, extensions, config, sink=LoggingSi
:param sink: sink used to collect non fatal errors and information
:return: FeatureSet with the required types, enums, commands/functions
"""
return spec.select(api, version, profile, extensions, sink=sink)
return spec.select(api, version, profile, extensions, config, sink=sink)

def generate(self, spec, feature_set, config, sink=LoggingSink(__name__)):
"""
Expand Down
13 changes: 8 additions & 5 deletions glad/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ def split_types(iterable, types):

return result

def select(self, api, version, profile, extension_names, sink=LoggingSink(__name__)):
def select(self, api, version, profile, extension_names, config, sink=LoggingSink(__name__)):
"""
Select a specific configuration from the specification.
Expand Down Expand Up @@ -748,10 +748,13 @@ def select(self, api, version, profile, extension_names, sink=LoggingSink(__name
if name in self.extensions[api]]

# Load documentation for the specific configuration
if self.DOCS:
self._docs = self.DOCS(api, version, profile, extensions)
sink.info('loading documentation for api {} version {}'.format(api, version))
self._docs.load()
if config['WITH_DOCS']:
if self.DOCS:
self._docs = self.DOCS(api, version, profile, extensions)
sink.info('loading documentation for api {} version {}'.format(api, version))
self._docs.load()
else:
sink.warning("documentation not available for specification '{}'".format(self.name))

# Collect information
result = set()
Expand Down

0 comments on commit 3ac71f0

Please sign in to comment.