Skip to content

Commit b7733d5

Browse files
committed
Added more documentation.
1 parent 3dbb963 commit b7733d5

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

highcharts_core/chart.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,8 @@ def download_chart(self,
699699
auth_user = None,
700700
auth_password = None,
701701
timeout = 3,
702+
referer = None,
703+
user_agent = None,
702704
server_instance = None,
703705
**kwargs):
704706
"""Export a downloaded form of the chart using a Highcharts :term:`Export Server`.
@@ -721,6 +723,18 @@ def download_chart(self,
721723
The timeout check is passed if bytes have been received on the socket in less
722724
than the ``timeout`` value. Defaults to ``3``.
723725
:type timeout: numeric or :obj:`None <python:None>`
726+
727+
:param referer: Provide the referer URL to use when making the request to the Export
728+
Server. If not specified, will try to read from the
729+
``HIGHCHARTS_EXPORT_SERVER_REFERER`` environment variable. If that is not found, then
730+
will apply a default of ``https://www.highcharts.com``.
731+
:type referer: :class:`str <python:str>` or :obj:`None <python:None>`
732+
733+
:param user_agent: Provide the user agent to use when making the request to the Export
734+
Server. If not specified, will try to read from the ``HIGHCHARTS_EXPORT_SERVER_USER_AGENT``
735+
environment variable. If that is not found, then will apply a default submitting Highcharts
736+
for Python as the user agent.
737+
:type user_agent: :class:`str <python:str>` or :obj:`None <python:None>`
724738
725739
:param server_instance: Provide an already-configured :class:`ExportServer`
726740
instance to use to programmatically produce the exported chart. Defaults to
@@ -752,6 +766,8 @@ def download_chart(self,
752766
scale = scale,
753767
width = width,
754768
format_ = format,
769+
referer = referer,
770+
user_agent = user_agent,
755771
**kwargs)
756772

757773
if not isinstance(server_instance, ExportServer):
@@ -766,6 +782,8 @@ def download_chart(self,
766782
options = self.options,
767783
constructor = constructor,
768784
format_ = format,
785+
referer = referer,
786+
user_agent = user_agent,
769787
**kwargs)
770788

771789
@classmethod

highcharts_core/headless_export.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ExportServer(HighchartsMeta):
3232
configure the class using either the :meth:`url <ExportServer.url>`,
3333
:meth:`port <ExportServer.port>`, and
3434
:meth:`path <ExportServer.path>` properties explicitly or by setting
35-
the ``HIGHCHARTS_EXPORT_SERVER_DOMAIN`, ``HIGHCHARTS_EXPORT_SERVER_PORT``, or
35+
the ``HIGHCHARTS_EXPORT_SERVER_DOMAIN``, ``HIGHCHARTS_EXPORT_SERVER_PORT``, or
3636
``HIGHCHARTS_EXPORT_SERVER_PATH`` environment variables.
3737
3838
"""
@@ -133,7 +133,7 @@ def referer(self, value):
133133
@property
134134
def user_agent(self) -> Optional[str]:
135135
"""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
136-
``Highcharts Core for Python / v.<VERSION NUMBER>.
136+
``Highcharts Core for Python / v.<VERSION NUMBER>``.
137137
138138
:rtype: :class:`str <python:str>` or :obj:`None <python:None>`
139139
"""

0 commit comments

Comments
 (0)