-
Notifications
You must be signed in to change notification settings - Fork 58
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 #1442 from mrvisscher/major-functionality
Major functionality
- Loading branch information
Showing
104 changed files
with
3,843 additions
and
1,462 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 |
---|---|---|
|
@@ -2,6 +2,7 @@ name: test | |
channels: | ||
- conda-forge | ||
- cmutel | ||
- mrvisscher | ||
dependencies: | ||
- pytest | ||
- pytest-qt | ||
|
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
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
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
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
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
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
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
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
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
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,33 @@ | ||
from qtpy import QtWidgets, QtGui, QtCore | ||
|
||
from activity_browser import application, bwutils | ||
from activity_browser.actions.base import ABAction, exception_dialogs | ||
from activity_browser.ui.icons import qicons | ||
|
||
from bw_functional import Function | ||
|
||
|
||
class FunctionSubstitute(ABAction): | ||
""" | ||
ABAction to open one or more supplied activities in an activity tab by employing signals. | ||
TODO: move away from using signals like this. Probably add a method to the MainWindow to add a panel instead. | ||
""" | ||
|
||
icon = qicons.edit | ||
text = "Substitute Function" | ||
|
||
@staticmethod | ||
@exception_dialogs | ||
def run(function: tuple | int | Function, substitute: tuple | int | Function): | ||
function = bwutils.refresh_node(function) | ||
substitute = bwutils.refresh_node(substitute) | ||
|
||
if not isinstance(function, Function): | ||
return | ||
|
||
if function.get("substitute") == substitute.key: | ||
return | ||
|
||
function.substitute(substitute.key) | ||
function.save() |
29 changes: 29 additions & 0 deletions
29
activity_browser/actions/activity/function_substitute_remove.py
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,29 @@ | ||
from qtpy import QtWidgets, QtGui, QtCore | ||
|
||
from activity_browser import application, bwutils | ||
from activity_browser.actions.base import ABAction, exception_dialogs | ||
from activity_browser.ui.icons import qicons | ||
|
||
from bw_functional import Function | ||
|
||
|
||
class FunctionSubstituteRemove(ABAction): | ||
""" | ||
ABAction to open one or more supplied activities in an activity tab by employing signals. | ||
TODO: move away from using signals like this. Probably add a method to the MainWindow to add a panel instead. | ||
""" | ||
|
||
icon = qicons.edit | ||
text = "Remove substitute" | ||
|
||
@staticmethod | ||
@exception_dialogs | ||
def run(function: tuple | int | Function): | ||
function = bwutils.refresh_node(function) | ||
|
||
if not isinstance(function, Function): | ||
return | ||
|
||
function.substitute(None) | ||
function.save() |
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
Oops, something went wrong.