content_type = indigo.utils.FILE_EXTENSION_MIME_MAP.get(os.path.splitext(file_path[-1])[-1].strip("."), "text/plain")
https://yourreflector.indigodomo.net/com.yourplugin.id/path/to/file.css
Resources
css
EventLog.css
js
prototype.js
tablekit.js
<link rel="stylesheet" type="text/css" href="/com.yourplugin.id/css/EventLog.css">
<script type="text/javascript" src="/com.yourplugin.id/js/prototype.js"></script>
<script type="text/javascript" src="/com.yourplugin.id/js/tablekit.js"></script>
html_elems.append ("<head>\n")
html_elems.append ('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n')
html_elems.append("<title>Indigo log viewer</title></Head>\n")
html_elems.append('<link rel="stylesheet" type="text/css" href="css/EventLog.css">')
html_elems.append ('<meta name="apple-mobile-web-app-capable" content="yes">')
html_elems.append ('<meta name="viewport" content="width=320,initial-scale=0.8,maximum-scale=1.6,user-scalable=yes"/>')
html_elems.append("<body>\n")
html_elems.append ('''<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/tablekit.js"></script>''')
html_elems.append("</body>\n")
#html_elems.append("</html>\n")
#indigo.server.log("html_elems = " + str(html_elems))
#content_type = indigo.utils.FILE_EXTENSION_MIME_MAP.get(os.path.splitext(indigo_path[-1])[-1].strip("."), "text/html")
reply = indigo.Dict()
reply["headers"] = indigo.Dict({"Content-Type": "text/html"})
reply["content"] = ''.join(html_elems)
return reply
bschollnick2 wrote:Matt, and Jay, I seem to recall the official method is to copy the application support directory for Indigo?
Switchboard Error Error in plugin execution ReceivedBroadcast:
Traceback (most recent call last):
File "plugin.py", line 799, in x10CommandReceived
File "plugin.py", line 730, in check_X10_Heartbeats
KeyError: key id 1723706321 not found in database
pmset schedule wakeorpoweron "09/08/20 20:00:00"
Switchboard Error Error in plugin execution ReceivedBroadcast:
Traceback (most recent call last):
File "plugin.py", line 799, in x10CommandReceived
File "plugin.py", line 730, in check_X10_Heartbeats
KeyError: key id 1723706321 not found in database
jay (support) wrote:Or just use the built-in server method:
- Code:
indigo.server.getInstallFolderPath()
Which will always work...
indigo.server.getInstallFolderPath()
log_files = sorted(glob.glob (indigo_path+'/*Events.txt'), key=os.path.getmtime)
80 def return_indigo_path ( self ):
81 #
82 # Next Generation iws path calculation
83 #
84 # Uses the Indigo Server version to generate the IWS path
85 #
86 return r"/library/Application Support/Perceptive Automation/Indigo %s/" % (int(indigo.server.version[0]) )
return r"/library/Application Support/Perceptive Automation/Indigo %s/" % (str(indigo.server.version[:3]) )
indigo.server.getInstallFolderPath()
80 def return_indigo_path ( self ):
81 #
82 # Next Generation iws path calculation
83 #
84 # Uses the Indigo Server version to generate the IWS path
85 #
86 return r"/library/Application Support/Perceptive Automation/Indigo %s/" % (int(indigo.server.version[0]) )
return r"/library/Application Support/Perceptive Automation/Indigo %s/" % (str(indigo.server.version[:3]) )
import subprocess
subprocess.Popen("/usr/bin/zip -r /users/YOURID/indigodir.zip '/Library/Application Support/Perceptive Automation/Indigo 7.2' &",shell=True)