Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(165)  |  Call(24)  |  Derive(1)  |  Import(140)

src/b/i/bika.lims-3.01a/bika/lims/subscribers/samplepartition.py   bika.lims(Download)
from DateTime import DateTime
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.WorkflowCore import WorkflowException
from bika.lims.subscribers import skip
from bika.lims.subscribers import doActionFor

src/b/i/bika.lims-3.01a/bika/lims/subscribers/sample.py   bika.lims(Download)
from DateTime import DateTime
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.WorkflowCore import WorkflowException
from bika.lims.subscribers import skip
from bika.lims.subscribers import doActionFor

src/b/i/bika.lims-3.01a/bika/lims/content/referencesample.py   bika.lims(Download)
from Products.Archetypes.references import HoldingReference
from Products.CMFCore import permissions
from Products.CMFCore.WorkflowCore import WorkflowException
from Products.CMFCore.permissions import View
from Products.CMFCore.utils import getToolByName

src/b/i/Bika-LIMS-HEAD/bika/lims/content/referencesample.py   Bika-LIMS(Download)
from Products.Archetypes.references import HoldingReference
from Products.CMFCore import permissions
from Products.CMFCore.WorkflowCore import WorkflowException
from Products.CMFCore.permissions import View
from Products.CMFCore.utils import getToolByName

src/p/r/Products.CMFCore-2.2.8/Products/CMFCore/WorkflowTool.py   Products.CMFCore(Download)
from Products.CMFCore.WorkflowCore import ObjectDeleted
from Products.CMFCore.WorkflowCore import ObjectMoved
from Products.CMFCore.WorkflowCore import WorkflowException
 
_marker = []  # Create a new marker object.
        if wf_id is None:
            if not wfs:
                raise WorkflowException(_(u'No workflows found.'))
            found = 0
            for wf in wfs:
                msg = _(u"No workflow provides the '${action_id}' action.",
                        mapping={'action_id': action})
                raise WorkflowException(msg)
        else:
            wf = self.getWorkflowById(wf_id)
            if wf is None:
                raise WorkflowException(
                    _(u'Requested workflow definition not found.'))
            if wfs is None:
                if default is _marker:
                    raise WorkflowException(_(u'No workflows found.'))
                else:
                    return default

src/e/r/erp5-HEAD/product/ERP5Type/patches/WorkflowTool.py   erp5(Download)
from Products.CMFCore.WorkflowTool import WorkflowTool
from Products.CMFCore.WorkflowCore import ObjectMoved, ObjectDeleted
from Products.CMFCore.WorkflowCore import WorkflowException
from Products.DCWorkflow.DCWorkflow import DCWorkflowDefinition
from Products.DCWorkflow.Transitions import TRIGGER_WORKFLOW_METHOD
  if wf_id is None:
    if not workflow_list:
      raise WorkflowException('No workflows found.')
    found = False
    for workflow in workflow_list:
        break
    if not found:
      raise WorkflowException('No workflow provides the destination state %r'\
                                                                    % state_id)
  else:
    workflow = self.getWorkflowById(wf_id)
    if workflow is None:
      raise WorkflowException('Requested workflow definition not found.')

src/p/r/Products.DCWorkflow-2.3.0-beta/Products/DCWorkflow/DCWorkflow.py   Products.DCWorkflow(Download)
from Products.CMFCore.WorkflowCore import ObjectDeleted
from Products.CMFCore.WorkflowCore import ObjectMoved
from Products.CMFCore.WorkflowCore import WorkflowException
from Products.DCWorkflow.events import AfterTransitionEvent
from Products.DCWorkflow.events import BeforeTransitionEvent
        sdef = self._getWorkflowStateOf(ob)
        if sdef is None:
            raise WorkflowException(_(u'Object is in an undefined state.'))
        if action not in sdef.transitions:
            raise Unauthorized(action)
        tdef = self.transitions.get(action, None)
        if tdef is None or tdef.trigger_type != TRIGGER_USER_ACTION:
            msg = _(u"Transition '${action_id}' is not triggered by a user "
                    u"action.", mapping={'action_id': action})
            raise WorkflowException(msg)
            msg = _(u'Destination state undefined: ${state_id}',
                    mapping={'state_id': new_state})
            raise WorkflowException(msg)
 
        # Fire "before" event

src/p/l/plone.app.relations-2.0/plone/app/relations/workflow.py   plone.app.relations(Download)
from plone.app.relations.annotations import ANNOTATIONS_KEY
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.WorkflowCore import WorkflowException
from Products.CMFCore.WorkflowCore import ObjectDeleted
from Products.DCWorkflow.Transitions import TRIGGER_USER_ACTION
    def doAction(self, action, comment='', **kw):
        wf = self._get_workflow()
        if not wf.isActionSupported(self.rel, action, **kw):
            raise WorkflowException(
                'No workflow provides the "%s" action.' % action)
    def getInfo(self, name, default=_marker, *args, **kw):
        wf = self._get_workflow()
        res = wf.getInfoFor(self.rel, name, default, *args, **kw)
        if res is _marker:
            raise WorkflowException('Could not get info: %s' % name)
    def _get_workflow(self):
        if not self.workflow_id:
            raise WorkflowException('Workflow definition not yet set.')
        # XXX: Add Plone 3.0 compat
        wf = self.wf_tool.getWorkflowById(self.workflow_id)
        if wf is None:
            raise WorkflowException(
                'Reqested workflow definition not found.')

src/e/r/erp5-HEAD/product/ERP5Type/patches/DCWorkflow.py   erp5(Download)
from AccessControl import getSecurityManager, ModuleSecurityInfo, Unauthorized
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.WorkflowCore import WorkflowException
from Products.CMFCore.utils import  _getAuthenticatedUser
from DocumentTemplate.DT_Util import TemplateDict
        new_sdef = self.states[new_state]
    except KeyError:
        raise WorkflowException('Destination state undefined: ' + new_state)
 
    # Execute the "before" script.

src/b/i/bika.lims-3.01a/bika/lims/browser/publish.py   bika.lims(Download)
from pkg_resources import resource_filename
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.WorkflowCore import WorkflowException
from Products.CMFPlone.utils import safe_unicode
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
                            raise SMTPServerDisconnected(msg)
                    except SMTPRecipientsRefused as msg:
                        raise WorkflowException(str(msg))
 
                    to = []
                            raise SMTPServerDisconnected(msg)
                    except SMTPRecipientsRefused as msg:
                        raise WorkflowException(str(msg))
 
        return [ar.RequestID for ar in self.analysis_requests]

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next