Skip to content

Commit

Permalink
Merge pull request getavalon#3 from BigRoy/master
Browse files Browse the repository at this point in the history
Implement actions
  • Loading branch information
BigRoy authored Dec 1, 2017
2 parents eb4f901 + 611f3bf commit 0af6443
Show file tree
Hide file tree
Showing 6 changed files with 288 additions and 378 deletions.
4 changes: 4 additions & 0 deletions launcher/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .actions import register_default_actions

# todo(roy): Maybe install studio config instead of "launcher" default
register_default_actions()
40 changes: 40 additions & 0 deletions launcher/actions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import avalon.api
from avalon import lib


class ProjectManagerAction(avalon.api.Action):
name = "projectmanager"
label = "Project Manager"
icon = "gear"
order = 999 # at the end

def is_compatible(self, session):
return "AVALON_PROJECT" in session

def process(self, session, **kwargs):

return lib.launch(executable="python",
args=["-u", "-m", "avalon.tools.projectmanager",
session['AVALON_PROJECT']])


class LoaderAction(avalon.api.Action):
name = "loader"
label = "Loader"
icon = "cloud-download"
order = 998 # at the end

def is_compatible(self, session):
return "AVALON_PROJECT" in session

def process(self, session, **kwargs):

return lib.launch(executable="python",
args=["-u", "-m", "avalon.tools.cbloader",
session['AVALON_PROJECT']])


def register_default_actions():
"""Register default actions for Launcher"""
avalon.api.register_plugin(avalon.api.Action, ProjectManagerAction)
avalon.api.register_plugin(avalon.api.Action, LoaderAction)
Loading

0 comments on commit 0af6443

Please sign in to comment.