コード例 #1
0
ファイル: NaayaUpdater.py プロジェクト: eaudeweb/trunk-eggs
from persistent.list import PersistentList
from zope.interface import implements
from zope.component import queryUtility

import Globals
from OFS.Folder import Folder

from interfaces import IUpdater, IUpdateScript
import utils

UPDATERID = 'naaya_updates'
UPDATERTITLE = 'Update scripts for Naaya'
NAAYAUPDATER_PRODUCT_PATH = Globals.package_home(globals())

LogEntry = namedtuple("LogEntry", ('update_id, datetime, user, portals'))


class NaayaUpdater(Folder):
    """ NaayaUpdater class """

    implements(IUpdater)

    meta_type = 'Naaya Updater'
    icon = 'misc_/naayaUpdater/updater.jpg'
    title = UPDATERTITLE

    #Should be changed to interface
    pmeta_types = (
        'Naaya Site',
        'CHM Site',
コード例 #2
0
    'account_modified': EmailPageTemplateFile('emailpt/account_modified.zpt',
                                              globals()),
}


def manage_addNotificationTool(self, REQUEST=None):
    """ """
    ob = NotificationTool(core_constants.ID_NOTIFICATIONTOOL,
                          core_constants.TITLE_NOTIFICATIONTOOL)
    self._setObject(core_constants.ID_NOTIFICATIONTOOL, ob)

    if REQUEST is not None:
        return self.manage_main(self, REQUEST, update_menu=1)

# TODO: remove `Subscription` after all sites have been updated
Subscription = namedtuple('Subscription', 'user_id location notif_type lang')


class NotificationTool(Folder):
    """ """

    meta_type = core_constants.METATYPE_NOTIFICATIONTOOL
    icon = 'misc_/NaayaCore/NotificationTool.gif'

    meta_types = ()
    all_meta_types = meta_types

    security = ClassSecurityInfo()

    # default configuration settings
    default_config = {
コード例 #3
0
ファイル: symbols_tool.py プロジェクト: eaudeweb/trunk-eggs
from StringIO import StringIO
import re
import PIL.Image
import PIL.ImageDraw

from Globals import InitializeClass
from AccessControl import ClassSecurityInfo

from naaya.core.backport import namedtuple

CIRCLE_IMAGE_SIZE = 12

ImageSize = namedtuple('ImageSize', 'w h')


class symbol_item:
    """ """

    sortorder = 100
    color = None

    @property
    def image_size(self):
        # temporary, until we're sure all symbol_item objects have the property
        return self._calculate_image_size()

    def __init__(self, id, title, description, parent, color, picture,
                 sortorder):
        self.id = id
        self.title = title
        self.description = description
コード例 #4
0
    EmailPageTemplateFile('emailpt/account_modified.zpt', globals()),
}


def manage_addNotificationTool(self, REQUEST=None):
    """ """
    ob = NotificationTool(core_constants.ID_NOTIFICATIONTOOL,
                          core_constants.TITLE_NOTIFICATIONTOOL)
    self._setObject(core_constants.ID_NOTIFICATIONTOOL, ob)

    if REQUEST is not None:
        return self.manage_main(self, REQUEST, update_menu=1)


# TODO: remove `Subscription` after all sites have been updated
Subscription = namedtuple('Subscription', 'user_id location notif_type lang')


class NotificationTool(Folder):
    """ """

    meta_type = core_constants.METATYPE_NOTIFICATIONTOOL
    icon = 'misc_/NaayaCore/NotificationTool.gif'

    meta_types = ()
    all_meta_types = meta_types

    security = ClassSecurityInfo()

    # default configuration settings
    default_config = {
コード例 #5
0
from persistent.list import PersistentList
from zope.interface import implements
from zope.component import queryUtility

import Globals
from OFS.Folder import Folder

from interfaces import IUpdater, IUpdateScript
import utils

UPDATERID = 'naaya_updates'
UPDATERTITLE = 'Update scripts for Naaya'
NAAYAUPDATER_PRODUCT_PATH = Globals.package_home(globals())

LogEntry = namedtuple("LogEntry", ('update_id, datetime, user, portals'))

class NaayaUpdater(Folder):
    """ NaayaUpdater class """

    implements(IUpdater)

    meta_type = 'Naaya Updater'
    icon = 'misc_/naayaUpdater/updater.jpg'
    title = UPDATERTITLE

    #Should be changed to interface
    pmeta_types = ('Naaya Site',
                   'CHM Site',
                   'EnviroWindows Site',
                   'SEMIDE Site',
コード例 #6
0
from StringIO import StringIO
import re
import PIL.Image
import PIL.ImageDraw


from Globals import InitializeClass
from AccessControl import ClassSecurityInfo

from naaya.core.backport import namedtuple

CIRCLE_IMAGE_SIZE = 12

ImageSize = namedtuple('ImageSize', 'w h')

class symbol_item:
    """ """

    sortorder = 100
    color = None

    @property
    def image_size(self):
        # temporary, until we're sure all symbol_item objects have the property
        return self._calculate_image_size()

    def __init__(self, id, title, description, parent, color, picture, sortorder):
        self.id = id
        self.title = title
        self.description = description