forked from getavalon/launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request getavalon#3 from BigRoy/master
Implement actions
- Loading branch information
Showing
6 changed files
with
288 additions
and
378 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Oops, something went wrong.