Skip to content

Commit

Permalink
Issue #138 - set HTMLRoot.User to Static
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayo Kallas committed Nov 3, 2020
1 parent a949935 commit 54d8fa9
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions ait/gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,22 +241,7 @@ def reset(self):


class HTMLRoot:
Static = pkg_resources.resource_filename('ait.gui', 'static/')
User = None
plugins = ait.config.get('server.plugins', Static)
for plugin in plugins:
if plugin['plugin']['name'] == 'ait.gui.AITGUIPlugin':
User = plugin['plugin']
break

try:
with open(os.path.join(Static, 'package.json')) as infile:
package_data = json.loads(infile.read())
VERSION = 'AIT GUI v{}'.format(package_data['version'])
log.info('Running {}'.format(VERSION))
except:
VERSION = ''
log.warn('Unable to determine which AIT GUI Version is running')
Static = User = pkg_resources.resource_filename('ait.gui', 'static/')

SEQRoot = ait.config.get('sequence.directory', None)
if SEQRoot and not os.path.isdir(SEQRoot):
Expand All @@ -276,6 +261,17 @@ class HTMLRoot:
Greenlets = []


try:
with open(os.path.join(Static, 'package.json')) as infile:
package_data = json.loads(infile.read())
VERSION = 'AIT GUI v{}'.format(package_data['version'])
log.info('Running {}'.format(VERSION))
except:
VERSION = ''
log.warn('Unable to determine which AIT GUI Version is running')



class AITGUIPlugin(Plugin):
global playback

Expand Down

0 comments on commit 54d8fa9

Please sign in to comment.