Description: adjust paths to use system-wide packages resources (.js etc)
Author: Jaakko Leppakangas <jaeilepp@student.jyu.fi>
Origin: upstream
Forwarded: not-needed
Reviewed-By: Yaroslav O. Halchenko <debian@onerussian.com>
Last-Update: 2019-09-01

--- a/mne/report.py
+++ b/mne/report.py
@@ -1359,16 +1359,21 @@
     @verbose
     def _init_render(self, verbose=None):
         """Initialize the renderer."""
-        inc_fnames = ['jquery-1.10.2.min.js', 'jquery-ui.min.js',
+        inc_fnames = ['/usr/share/javascript/jquery/jquery.min.js',
+                      '/usr/share/javascript/jquery-ui/jquery-ui.min.js',
                       'bootstrap.min.js', 'jquery-ui.min.css',
                       'bootstrap.min.css']
 
         include = list()
         for inc_fname in inc_fnames:
             logger.info('Embedding : %s' % inc_fname)
-            fname = op.join(op.dirname(__file__), 'html', inc_fname)
-            with open(fname, 'rb') as fid:
-                file_content = fid.read().decode('utf-8')
+            if not os.path.isabs(inc_fname):
+                inc_fname = op.join(op.dirname(__file__), 'html', inc_fname)
+            f = open(inc_fname, 'r')
+            if PY3:
+                file_content = f.read()
+            else:
+                file_content = f.read().decode('UTF-8')
             if inc_fname.endswith('.js'):
                 include.append(u'<script type="text/javascript">' +
                                file_content + u'</script>')
