Ignore:
Timestamp:
2 Feb 2012, 21:09:31 (13 years ago)
Author:
Henrik Bettermann
Message:

Move storage path configuration to SIRPUtils in order to ease customization.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/datacenter.py

    r7321 r7568  
    2626import grok
    2727from datetime import datetime
     28from zope.component import getUtility
    2829from zope.component.interfaces import ObjectEvent
    2930from waeup.sirp.interfaces import (IDataCenter, IDataCenterFile,
    30                                    IDataCenterStorageMovedEvent)
     31                                   IDataCenterStorageMovedEvent,
     32                                   ISIRPUtils)
    3133from waeup.sirp.utils.helpers import copy_filesystem_tree
    3234from waeup.sirp.utils.logger import Logger
     
    3638    """
    3739    grok.implements(IDataCenter)
    38     storage = os.path.join(os.path.dirname(__file__), 'files')
    3940
    4041    logger_name = 'waeup.sirp.${sitename}.datacenter'
     
    4344    def __init__(self, *args, **kw):
    4445        super(DataCenter, self).__init__(*args, **kw)
     46        self.storage = getUtility(ISIRPUtils).storage()
    4547        self._createSubDirs()
    4648
  • main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py

    r7485 r7568  
    143143    """A collection of methods which are subject to customization.
    144144    """
     145
     146    def storage():
     147        """Return the initial storage path of the data center.
     148        """
     149
    145150    def sendContactForm(
    146151          from_name,from_addr,rcpt_name,rcpt_addr,
  • main/waeup.sirp/trunk/src/waeup/sirp/utils/utils.py

    r7477 r7568  
    1818"""General helper utilities for SIRP.
    1919"""
     20import os
    2021import grok
    2122import string
     
    3839    """
    3940    grok.implements(ISIRPUtils)
     41
     42    def storage(self):
     43        """Return the initial storage path of the data center.
     44        """
     45        return os.path.dirname(__file__).replace('utils','files')
    4046
    4147    def sendContactForm(self,from_name,from_addr,rcpt_name,rcpt_addr,
Note: See TracChangeset for help on using the changeset viewer.