Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
task.new()
else:
application = event.task.window.application
win = application.create_window(TaskWindowLayout(self.task_id))
task = win.active_task
if task.new():
win.open()
# class GenericReplaceAction(TaskAction):
# pass
# else:
# manager = self._get_experimentor(event)
# manager.save_as_experiment_queues()
class ToggleFullWindowAction(TaskAction):
name = 'Toggle Full Window'
method = 'toggle_full_window'
image = icon('view-fullscreen-8')
class EditInitializationAction(Action):
name = 'Edit Initialization'
image = icon('brick-edit')
def perform(self, event):
from pychron.envisage.initialization.initialization_edit_view import edit_initialization
if edit_initialization():
restart()
class SummaryTableAction(TaskAction):
name = 'Summary'
method = 'open_summary_table'
image = icon('report.png')
tooltip = 'New summary table'
class AppendSummaryTableAction(TaskAction):
method = 'append_summary_table'
image = icon('report_add.png')
tooltip = 'Append to current summary table'
class FusionTableAction(TaskAction):
name = 'Laser'
method = 'new_fusion_table'
image = icon('report.png')
tooltip = 'New fusion table'
class AppendTableAction(TaskAction):
name = 'Append Table'
method = 'append_table'
image = icon('report_add.png')
tooltip = 'Append to current table'
import os
from pyface.tasks.action.schema import SToolBar
from pyface.tasks.action.task_action import TaskAction
from traits.api import Instance
# ============= standard library imports ========================
# ============= local library imports ==========================
from pychron.canvas.tasks.designer import Designer
from pychron.paths import paths
from pychron.canvas.tasks.panes import CanvasDesignerPane
from pychron.envisage.tasks.base_task import BaseTask
class OpenAction(TaskAction):
name = 'Open'
method = 'open'
class SaveAction(TaskAction):
name = 'Save'
method = 'save'
class CanvasDesignerTask(BaseTask):
name = 'Canvas Designer'
tool_bars = [SToolBar(OpenAction(),
SaveAction()
)]
designer = Instance(Designer)
# ------------------------------------------------------------------------
# Protected interface.
# ------------------------------------------------------------------------
@cached_property
def _get_central_pane(self):
if self.task and self.task.window is not None:
return self.task.window.get_central_pane(self.task)
return None
def _get_object(self):
return self.central_pane
class DockPaneAction(TaskAction):
""" An Action the makes a callback to one of a Task's dock panes.
"""
# ListeningAction interface --------------------------------------------
object = Property(depends_on="dock_pane")
# DockPaneAction interface ---------------------------------------------
# The dock pane with which the action is associated. Set by the framework.
dock_pane = Property(Instance(TaskPane), depends_on="task")
# The ID of the dock pane with which the action is associated.
dock_pane_id = Str()
# ------------------------------------------------------------------------
image = icon('document-save')
class AddFolderAction(TaskAction):
name = 'Add Folder'
method = 'add_folder'
image = icon('folder-new')
class PushAction(TaskAction):
name = 'Push'
method = 'push'
image = icon('arrow_up')
class PullAction(TaskAction):
name = 'Pull'
method = 'pull'
image = icon('arrow_down')
class NewLabelAction(TaskAction):
name = 'New Label'
method = 'new_label'
image = icon('add')
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#===============================================================================
#============= enthought library imports =======================
from traits.api import HasTraits
from traitsui.api import View, Item
from pyface.tasks.action.task_action import TaskAction
#============= standard library imports ========================
#============= local library imports ==========================
class CalcOptimalEquilibrationAction(TaskAction):
description = 'Calculate optimal equilibration time'
name = 'Optimal Eq.'
method = 'calculate_optimal_eqtime'
#============= EOF =============================================
if method:
method()
else:
task = app.get_task('pychron.processing.interpreted_age', activate=False)
method = self._get_attr(task, self.method)
if method:
method()
class MakeGroupFromFileAction(TasklessInterpretedAgeAction):
name = 'Group From File'
method = 'make_group_from_file'
image = icon('document-open')
class MakeGroupAction(TaskAction):
name = 'Make Group'
method = 'make_group_from_selected'
image = icon('add')
class DeleteInterpretedAgeGroupAction(TaskAction):
name = 'Delete Group'
method = 'delete_group'
image = icon('database_delete')
def perform(self, event=None):
app = self.task.window.application
method = self._get_attr(self.object, self.method)
if method:
method()
else:
import os
from pyface.confirmation_dialog import confirm
from pyface.constant import YES
from pyface.message_dialog import warning, information
from pyface.tasks.action.task_action import TaskAction
from traitsui.menu import Action
from pychron.core.ui.progress_dialog import myProgressDialog
from pychron.dvc import repository_path
from pychron.envisage.resources import icon
from pychron.envisage.tasks.actions import restart
from pychron.pychron_constants import DVC_PROTOCOL
class LocalRepositoryAction(TaskAction):
enabled_name = 'selected_local_repository_name'
class RemoteRepositoryAction(TaskAction):
enabled_name = 'selected_repository'
class CloneAction(RemoteRepositoryAction):
method = 'clone'
name = 'Clone'
image = icon('repo-clone')
tooltip = 'Clone repository from remote. e.g. git clone https://github.com...'
class AddBranchAction(LocalRepositoryAction):
name = 'Add Branch'
# class ConfigureAnalysesTableAction(TaskAction):
# name = 'Configure Analyses Table'
# dname = 'Configure Analyses Table'
# method = 'configure_analyses_table'
# image = icon('cog')
#
#
# class ConfigureSampleTableAction(TaskAction):
# name = 'Configure Sample Table'
# dname = 'Configure Sample Table'
# method = 'configure_sample_table'
# image = icon('cog')
class LoadReviewStatusAction(TaskAction):
name = 'Review Status'
method = 'load_review_status'
image = icon('check_boxes')
class EditAnalysisAction(TaskAction):
name = 'Edit Analysis'
method = 'edit_analysis'
image = icon('application-form-edit')
class DiffViewAction(TaskAction):
name = 'Diff View'
method = 'diff_analysis'
image = icon('edit_diff')
enabled_name = 'diff_enabled'
image = icon('document-open')
class CheckoutAnalysesAction(TaskAction):
name = 'Checkout Analyses'
method = 'checkout_analyses'
image = icon('database_go')
class AddBranchAction(TaskAction):
name = 'Add Branch'
method = 'add_branch'
image = icon('add')
class TestModificationAction(TaskAction):
name = 'Test'
method = 'test_modification'
class TagBranchAction(TaskAction):
name = 'Tag Branch'
method = 'tag_branch'
class PullAction(TaskAction):
name = 'Pull'
method = 'pull'
image = icon('arrow_down')
class PushAction(TaskAction):