from zope.app.form.browser.textwidgets import escape from zope.app.renderer.plaintext import PlainTextToHTMLRenderer from zope.component import getUtility from zope.i18nmessageid import MessageFactory from zope.interface import implements from zope.securitypolicy.interfaces import IPrincipalRoleManager from zope.session.interfaces import ISession import grok import megrok.menu import xlwt import os import tempfile import itertools import logging _ = MessageFactory('afpy.barcamp') class Seance(grok.Container): """the seance itself """ implements(ISeance, IRegistrable) name = audience = description = None start_date = duration = benefits = None room = None keywords = authors = unfolding = None status = 'proposed' def __init__(self): super(Seance, self).__init__() if self.authors is None:
"""Main product initializer """ from zope.i18nmessageid import MessageFactory from uwosh.registrarforms import config from Products.Archetypes import atapi from Products.CMFCore import utils from Products.CMFCore.permissions import setDefaultRoles # Define a message factory for when this product is internationalised. # This will be imported with the special name "_" in most modules. Strings # like _(u"message") will then be extracted by i18n tools for translation. registrarformsMessageFactory = MessageFactory('uwosh.registrarforms') def initialize(context): """Initializer called when used as a Zope 2 product. This is referenced from configure.zcml. Regstrations as a "Zope 2 product" is necessary for GenericSetup profiles to work, for example. Here, we call the Archetypes machinery to register our content types with Zope and the CMF. """ # Retrieve the content types that have been registered with Archetypes # This happens when the content type is imported and the registerType() # call in the content type's module is invoked. Actually, this happens # during ZCML processing, but we do it here again to be explicit. Of
# -*- coding: utf-8 -*- """Init and utils.""" from zope.i18nmessageid import MessageFactory _ = MessageFactory('collective.myportlets')
except ImportError: IDexterityContainer = IATFolder from Solgema.fullcalendar import interfaces from Solgema.fullcalendar import log from Solgema.fullcalendar import msg_fact as _ # detect plone.app.event try: import plone.app.event HAS_PAE = True except ImportError: HAS_PAE = False DTMF = MessageFactory('collective.z3cform.datetimewidget') pMF = MessageFactory('plone') def getCopyObjectsUID(REQUEST): if REQUEST is not None and REQUEST.has_key('__cp'): cp = REQUEST['__cp'] else: return [] op, mdatas = CopySupport._cb_decode(cp) return {'op': op, 'url': ['/'.join(a) for a in mdatas][0]} def listBaseQueryTopicCriteria(topic): li = [] for criteria in topic.listCriteria():
from Acquisition import aq_base from zope.schema import ASCIILine from zope.formlib.form import Fields from zope.i18nmessageid import MessageFactory try: from Products.Five.formlib.formbase import AddForm except ImportError: # some Zope version dropped formlib" support from "Five"; try "five.formlib" from five.formlib.formbase import AddForm from dm.zope.schema.form import SchemaConfiguredFormMixin from form import ZmiMixin _ = MessageFactory('dm_zope_schema') class SchemaConfiguredAddForm(SchemaConfiguredFormMixin, AddForm): """Default add form class.""" __id_is_field = False def __init__(self, context, request): """**ATTENTION** *context* is expected to be the object added not the container; the container is expected to be found in the acquisition context of *context*. """ super(SchemaConfiguredAddForm, self).__init__(context, request) if hasattr(context, '__parent__'): parent = context.__parent__ elif hasattr(context, 'aq_parent'): parent = context.aq_parent
import logging from zope.i18nmessageid import MessageFactory MessageFactory = collectivejschosenMessageFactory = MessageFactory( 'collective.js.chosen') logger = logging.getLogger('collective.js.chosen') def initialize(context): """Initializer called when used as a Zope 2 product."""
from z3c.form.interfaces import INPUT_MODE, DISPLAY_MODE, IFormLayer from z3c.form.widget import FieldWidget from z3c.form import form, field, button, subform, datamanager from z3c.form.i18n import MessageFactory as _z3c from plone.dexterity.browser import add from plone.memoize.view import memoize from Products.CMFCore.utils import getToolByName from Products.CMFPlone.utils import normalizeString, safe_unicode, utf8_portal, getSiteEncoding from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from Products.CMFPlone import PloneLocalesMessageFactory as PLMF from zope.component.hooks import getSite from zope.i18nmessageid import MessageFactory from Products.Five.browser import BrowserView from plone.autoform.form import AutoExtensibleForm _p = MessageFactory('plone') _z3cf = MessageFactory('z3c.form') from urllib2 import Request, urlopen, URLError import urllib, urllib2 import time from urllib import urlencode import cookielib from urlparse import urlparse from oerplib.rpc.jsonrpclib import Proxy from oerplib import OERP from cookielib import Cookie, CookieJar try: import json except: import simplejson as json
# -*- coding: utf-8 -*- # # Copyright 2017 SEANAITE import logging from zope.i18nmessageid import MessageFactory # Defining a Message Factory for when this product is internationalized. senaiteMessageFactory = MessageFactory('senaite') logger = logging.getLogger("SENAITE") def initialize(context): """Initializer called when used as a Zope 2 product.""" logger.info("*** Initializing SENAITE LIMS Customization Package ***")
# -*- coding: utf-8 -*- """Init and utils.""" from zope.i18nmessageid import MessageFactory _ = MessageFactory('at.intranetstartpage')
# -*- coding: utf-8 -* from __future__ import absolute_import, unicode_literals from zope.i18nmessageid import MessageFactory GSMessageFactory = MessageFactory('gs.group.about')
from zope.i18nmessageid import MessageFactory _ = MessageFactory('plone.formwidget.geolocation') from plone.formwidget.geolocation.geolocation import Geolocation from plone.formwidget.geolocation.field import GeolocationField __all__ = (_, Geolocation, GeolocationField)
from zope.i18nmessageid import MessageFactory MessageFactory = MessageFactory('collective.loremipsum') def initialize(context): """Initializer called when used as a Zope 2 product."""
from zope.interface import implements from Products.CMFQuickInstallerTool.interfaces import INonInstallable from five import grok from collective.grok import gs from zope.i18nmessageid import MessageFactory # Set up the i18n message factory for our package MessageFactory = MessageFactory('wccpilgrimageblog.policy') _ = MessageFactory class HiddenProducts(grok.GlobalUtility): """This hides the upgrade profiles from the quick installer tool.""" implements(INonInstallable) grok.name('wccpilgrimageblog.policy.upgrades') def getNonInstallableProducts(self): return [ 'wccpilgrimageblog.policy.upgrades', ] gs.profile(name=u'default', title=u'wccpilgrimageblog.policy', description=_(u''), directory='profiles/default')
from zope.i18nmessageid import MessageFactory _ = MessageFactory("opengever.tasktemplates")
from zope.interface import Interface from zope import schema from zope.i18nmessageid import MessageFactory _ = MessageFactory('zojax.cachepurging') class ICachePurgingConfiglet(Interface): """Settings used by the purging algorithm. """ enabled = schema.Bool( title=_(u"Enable purging"), description=_(u"If disabled, no purging will take place"), default=True, ) cachingProxies = schema.Tuple( title=_(u"Caching proxies"), description=_(u"Provide the URLs of each proxy to which PURGE " u"requests shoudl be sent."), value_type=schema.URI(), ) virtualHosting = schema.Bool( title=_(u"Send PURGE requests with virtual hosting paths"), description=_(u"This option is only relevant if you are using " u"virtual hosting with Zope's VirtualHostMonster. " u"This relies on special tokens (VirtualHostBase " u"and VirtualHostRoot) in the URL to instruct "
# -*- coding: utf-8 -*- """Init and utils.""" from zope.i18nmessageid import MessageFactory _ = MessageFactory('imtheme.blue')
"""Main product initializer """ from Products.Archetypes import atapi from Products.CMFCore import utils from ftw.task import config from zope.i18nmessageid import MessageFactory taskMessageFactory = MessageFactory('ftw.task') _ = taskMessageFactory def initialize(context): """Initializer called when used as a Zope 2 product. This is referenced from configure.zcml. Regstrations as a "Zope 2 product" is necessary for GenericSetup profiles to work, for example. Here, we call the Archetypes machinery to register our content types with Zope and the CMF. """ content_types, constructors, _ftis = atapi.process_types( atapi.listTypes(config.PROJECTNAME), config.PROJECTNAME) for atype, constructor in zip(content_types, constructors): utils.ContentInit( '%s: %s' % (config.PROJECTNAME, atype.portal_type), content_types=(atype, ), permission=config.ADD_PERMISSIONS[atype.portal_type], extra_constructors=(constructor, ),
# -*- coding: utf-8 -*- """Init and utils.""" from zope.i18nmessageid import MessageFactory _ = MessageFactory('collective.archetypes.select2')
# -*- coding: utf-8 -*- """Init and utils.""" from zope.i18nmessageid import MessageFactory _ = MessageFactory('plone.app.myaddon')
from zope.i18nmessageid import MessageFactory StartingPointMessageFactory = MessageFactory('Products.MiniAudioPlayer') def initialize(context): pass
from z3c.form import field from z3c.form import form from zope.cachedescriptors.property import Lazy as lazy_property from zope.component import adapter from zope.component import getAdapters from zope.component import queryUtility from zope.event import notify from zope.i18nmessageid import MessageFactory from zope.interface import alsoProvides from zope.interface import implementer from zope.interface import noLongerProvides from zope.publisher.interfaces.browser import IBrowserRequest from zope.schema import getFieldsInOrder from ZPublisher.BaseRequest import DefaultPublishTraverse PMF = MessageFactory('plone') @adapter(ISavedDataFormWrapper, IBrowserRequest) class SavedDataTraversal(WrapperWidgetTraversal): def traverse(self, name, ignored): form = self._prepareForm() alsoProvides(self.request, IDeferSecurityCheck) form.update() noLongerProvides(self.request, IDeferSecurityCheck) for subform in form.subforms: if not hasattr(subform, 'subforms'): continue for subsubform in subform.subforms: if not name.startswith(subsubform.prefix): continue
if 'effectiveDate' in schema: schema.changeSchemataForField('effectiveDate', 'dates') if 'expirationDate' in schema: schema.changeSchemataForField('expirationDate', 'dates') if 'creation_date' in schema: schema.changeSchemataForField('creation_date', 'dates') if 'modification_date' in schema: schema.changeSchemataForField('modification_date', 'dates') # Ownership if 'creators' in schema: schema.changeSchemataForField('creators', 'ownership') if 'contributors' in schema: schema.changeSchemataForField('contributors', 'ownership') if 'rights' in schema: schema.changeSchemataForField('rights', 'ownership') # Settings if 'allowDiscussion' in schema: schema.changeSchemataForField('allowDiscussion', 'settings') if 'excludeFromNav' in schema: schema.changeSchemataForField('excludeFromNav', 'settings') if 'nextPreviousEnabled' in schema: schema.changeSchemataForField('nextPreviousEnabled', 'settings') # Use PloneboardMessageFactory for translations in Python PloneboardMessageFactory = MessageFactory(config.I18N_DOMAIN) ModuleSecurityInfo('Products.Ploneboard.utils').declarePublic( 'PloneboardMessageFactory')
# -*- coding: utf-8 -*- """Init and utils.""" from zope.i18nmessageid import MessageFactory _ = MessageFactory('collective.js.tooltipster')
# -*- coding: utf-8 -*- # TODO: fix dependency on bda.plone.orders. # this invalidates the dependency chain. from bda.plone.orders.common import get_order from bda.plone.payment import Payment from bda.plone.payment import Payments from Products.Five import BrowserView from zope.i18nmessageid import MessageFactory _ = MessageFactory('bda.plone.payment') class Cash(Payment): pid = 'cash' label = _('cash', default=u'Cash') def init_url(self, uid): return '%s/@@cash?uid=%s' % (self.context.absolute_url(), uid) class DoCash(BrowserView): def __call__(self, **kw): uid = self.request['uid'] payment = Payments(self.context).get('cash') payment.succeed(self.request, uid) url = '%s/@@cashed?uid=%s' % (self.context.absolute_url(), uid) self.request.response.redirect(url) class CashFinished(BrowserView): def id(self):
"""Adapter implementation of size-methods """ __version__ = "$Id$" # zope imports from zope.interface import implements from zope.component import adapts from zope.size.interfaces import ISized from zope.i18nmessageid import MessageFactory from zope.app.container.interfaces import IContainer # ict_ok.org imports from org.ict_ok.components.net.interfaces import INet _ = MessageFactory('org.ict_ok') class NetSized(object): """ISized adapter.""" implements(ISized) adapts(INet) def __init__(self, context): self.context = context def sizeForSorting(self): """See `ISized`""" return ('item', len(IContainer(self.context)))
from zope.i18nmessageid import MessageFactory _ = MessageFactory('tn.plonehtmlimagecache')
# -*- coding: utf-8 -*- from zope.i18nmessageid import MessageFactory _ = MessageFactory('interlegis.portalmodelo.transparency')
from zope.i18nmessageid import MessageFactory messageFactory = MessageFactory('collective.portlet.twittermultistream') def initialize(context): """Initializer called when used as a Zope 2 product."""
# -*- coding: utf-8 -*- """Init and utils.""" from zope.i18nmessageid import MessageFactory _ = MessageFactory('gwopa')
# -*- coding: utf-8 -*- """Init and utils.""" from zope.i18nmessageid import MessageFactory _ = MessageFactory('inwi.digitab')