Ejemplo n.º 1
0
    def __init__(self,
                 filename=None,
                 classesFilename=None,
                 configFilename=None,
                 customCoreClasses={},
                 rootModel=None,
                 havePythonClasses=True):
        Configurable.__init__(self)
        self._havePythonClasses = havePythonClasses
        self._filename = None
        self._configFilename = configFilename or 'Settings.config'
        self._coreClasses = customCoreClasses
        self._klasses = None
        self._name = None
        self._parents = []  # e.g., parent models
        self._pyClassForName = {}

        # _allModelsByFilename is used to avoid loading the same parent model twice
        if rootModel:
            self._allModelsByFilename = rootModel._allModelsByFilename
        else:
            self._allModelsByFilename = {}
        self._rootModel = rootModel

        if filename or classesFilename:
            self.read(filename or classesFilename, classesFilename is not None)
	def __init__(self, application=None):
		HTTPServlet.__init__(self)
		Configurable.__init__(self)
		if application is None:
			from WebKit.AppServer import globalAppServer
			application = globalAppServer.application()
			assert application is not None
		self._application = application
Ejemplo n.º 3
0
	def __init__(self, application=None):
		HTTPServlet.__init__(self)
		Configurable.__init__(self)
		if application is None:
			from AppServer import globalAppServer
			application = globalAppServer.application()
			assert application is not None
		self._application = application
    def setting(self, name, default=NoDefault):
        """Return setting, using the server side path when indicated.

        Returns the setting, filtered by `self.serverSidePath()`,
        if the name ends with ``Filename`` or ``Dir``.
        """
        value = Configurable.setting(self, name, default)
        if name.endswith(
            ('Dir', 'Filename')) and (value or name.endswith('Dir')):
            if name.endswith('LogFilename') and '/' not in value:
                value = os.path.join(Configurable.setting(self, 'LogDir'),
                                     value)
            value = self.serverSidePath(value)  # pylint: disable=no-member
        return value
    def setting(self, name, default=NoDefault):
        """Return setting, using the server side path when indicated.

        Returns the setting, filtered by self.serverSidePath(),
        if the name ends with ``Filename`` or ``Dir``.
        """
        value = Configurable.setting(self, name, default)
        if name[-8:] == 'Filename' or name[-3:] == 'Dir':
            value = self.serverSidePath(value)
        return value
Ejemplo n.º 6
0
    def setting(self, name, default=NoDefault):
        """Return setting, using the server side path when indicated.

        Returns the setting, filtered by self.serverSidePath(),
        if the name ends with ``Filename`` or ``Dir``.
        """
        value = Configurable.setting(self, name, default)
        if name[-8:] == 'Filename' or name[-3:] == 'Dir':
            value = self.serverSidePath(value)
        return value
Ejemplo n.º 7
0
	def __init__(self):
		SitePage.__init__(self)
		Configurable.__init__(self)
Ejemplo n.º 8
0
 def __init__(self, application):
     HTTPServlet.__init__(self)
     Configurable.__init__(self)
     self._application = application
Ejemplo n.º 9
0
 def __init__(self):
     LunarcPage.__init__(self)
     Configurable.__init__(self)
Ejemplo n.º 10
0
 def __init__(self, webKitDir):
     Configurable.__init__(self)
     self._webKitDir = webKitDir
     self._respData = []
Ejemplo n.º 11
0
 def __init__(self):
     Configurable.__init__(self)
     self._model = None
Ejemplo n.º 12
0
 def __init__(self):
     ExamplePage.__init__(self)
     Configurable.__init__(self)
Ejemplo n.º 13
0
 def __init__(self):
     Page.__init__(self)
     Configurable.__init__(self)
Ejemplo n.º 14
0
 def __init__(self):
     ExamplePage.__init__(self)
     Configurable.__init__(self)
Ejemplo n.º 15
0
from MiscUtils.Configurable import Configurable
config = Configurable()
settingName = 'settingName'
# <yes> <report> PYTHON_INJECTION_RESOURCE 36f5ed
config.setSetting(settingName)

import builtins
file = 'path/to/file'
# <yes> <report> PYTHON_INJECTION_RESOURCE 54972e
file(file)
# <yes> <report> PYTHON_INJECTION_RESOURCE 54972e
open(file)

# <yes> <report> PYTHON_INJECTION_RESOURCE 156b64
builtins.open(file)
# <yes> <report> PYTHON_INJECTION_RESOURCE 156b64
builtins.setattr(foo, bar, value)

from django.core.mail import EmailMessage
img_data = 'images/img'
message = EmailMessage('Title', 'Body', '*****@*****.**')
# <yes> <report> PYTHON_INJECTION_RESOURCE 0afea5
message.attach('design.png', img_data, 'image/png')

import shelve
# <yes> <report> PYTHON_INJECTION_RESOURCE 55142c
shelve.open(file)

import tarfile
import zipfile
# <yes> <report> PYTHON_INJECTION_RESOURCE 62ec63
Ejemplo n.º 16
0
Archivo: Adapter.py Proyecto: Cito/w4py
 def __init__(self, webKitDir):
     Configurable.__init__(self)
     self._webKitDir = webKitDir
     self._respData = []
Ejemplo n.º 17
0
	def setting(self, name, default=NoDefault):
		""" Returns the setting, filtered by self.serverSidePath(), if the name ends with 'Filename' or 'Dir'. """
		value = Configurable.setting(self, name, default)
		if name[-8:]=='Filename' or name[-3:]=='Dir':
			value = self.serverSidePath(value)
		return value