MCPcopy Index your code
hub / github.com/plotly/plotly.py / validate_executable

Function validate_executable

plotly/io/_orca.py:899–1139  ·  view source on GitHub ↗

Attempt to find and validate the orca executable specified by the `plotly.io.orca.config.executable` property. If the `plotly.io.orca.status.state` property is 'validated' or 'running' then this function does nothing. How it works: - First, it searches the system PATH fo

()

Source from the content-addressed store, hash-verified

897# Public orca server interaction functions
898# ----------------------------------------
899def validate_executable():
900 """
901 Attempt to find and validate the orca executable specified by the
902 `plotly.io.orca.config.executable` property.
903
904 If the `plotly.io.orca.status.state` property is 'validated' or 'running'
905 then this function does nothing.
906
907 How it works:
908 - First, it searches the system PATH for an executable that matches the
909 name or path specified in the `plotly.io.orca.config.executable`
910 property.
911 - Then it runs the executable with the `--help` flag to make sure
912 it's the plotly orca executable
913 - Then it runs the executable with the `--version` flag to check the
914 orca version.
915
916 If all of these steps are successful then the `status.state` property
917 is set to 'validated' and the `status.executable` and `status.version`
918 properties are populated
919
920 Returns
921 -------
922 None
923 """
924 # Check state
925 # -----------
926 if status.state != "unvalidated":
927 # Nothing more to do
928 return
929
930 # Initialize error messages
931 # -------------------------
932 install_location_instructions = """\
933If you haven't installed orca yet, you can do so using conda as follows:
934
935 $ conda install -c plotly plotly-orca
936
937Alternatively, see other installation methods in the orca project README at
938https://github.com/plotly/orca
939
940After installation is complete, no further configuration should be needed.
941
942If you have installed orca, then for some reason plotly.py was unable to
943locate it. In this case, set the `plotly.io.orca.config.executable`
944property to the full path of your orca executable. For example:
945
946 >>> plotly.io.orca.config.executable = '/path/to/orca'
947
948After updating this executable property, try the export operation again.
949If it is successful then you may want to save this configuration so that it
950will be applied automatically in future sessions. You can do this as follows:
951
952 >>> plotly.io.orca.config.save()
953
954If you're still having trouble, feel free to ask for help on the forums at
955https://community.plot.ly/c/api/python
956"""

Callers 3

_renderers.pyFile · 0.90
ensure_serverFunction · 0.85
to_imageFunction · 0.85

Calls 5

orca_envFunction · 0.85
getMethod · 0.45
replaceMethod · 0.45
formatMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected