Skip to content

Commit

Permalink
Added details on environment variables to docstring for ExportServer.…
Browse files Browse the repository at this point in the history
…referer and ExportServer.user_agent properties.
  • Loading branch information
hcpchris committed Nov 4, 2024
1 parent ead44f7 commit 2aef265
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions highcharts_core/headless_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ def __init__(self, **kwargs):

@property
def referer(self) -> Optional[str]:
"""The referer to use when making requests to the export server. Defaults to
"""The referer to use when making requests to the export server. Defaults to the
``HIGHCHARTS_EXPORT_SERVER_REFERER`` environment variable if present, otherwise defaults to
``'https://www.highcharts.com'``.
:rtype: :class:`str <python:str>` or :obj:`None <python:None>`
Expand All @@ -124,15 +125,15 @@ def referer(self, value):

@property
def user_agent(self) -> Optional[str]:
"""The user agent to use when making requests to the export server. Defaults to
``Highcharts for Python / v.<VERSION NUMBER>.
"""The user agent to use when making requests to the export server. Defaults to the ``HIGHCHARTS_EXPORT_SERVER_USER_AGENT`` environment variable if present, otherwise defaults to
``Highcharts Core for Python / v.<VERSION NUMBER>.
:rtype: :class:`str <python:str>` or :obj:`None <python:None>`
"""
if self._user_agent:
return self._user_agent

return f'Highcharts for Python / v.{highcharts_version.__version__}'
return f'Highcharts Core for Python / v.{highcharts_version.__version__}'

@user_agent.setter
def user_agent(self, value):
Expand Down

0 comments on commit 2aef265

Please sign in to comment.