!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.2.16 (Debian). PHP/5.3.3-7+squeeze19 

uname -a: Linux mail.tri-specialutilitydistrict.com 2.6.32-5-amd64 #1 SMP Tue May 13 16:34:35 UTC
2014 x86_64
 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/usr/share/pyshared/axiom/   drwxr-xr-x
Free 130.05 GB of 142.11 GB (91.51%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     _fincache.py (2.56 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |

from weakref import ref
from traceback import print_exc

from twisted.python import log

from axiom import iaxiom

class CacheFault(RuntimeError):
    """
    A serious problem has occurred within the cache.  This error is internal
    and should never really be trapped.
    """

def logErrorNoMatterWhat():
    try:
        log.msg("Exception in finalizer cannot be propagated")
        log.err()
    except:
        try:
            emergLog = file("WEAKREF_EMERGENCY_ERROR.log", 'a')
            print_exc(file=emergLog)
            emergLog.flush()
            emergLog.close()
        except:
            # Nothing can be done.  We can't get an emergency log file to write
            # to.  Don't bother.
            return

def createCacheRemoveCallback(w, k, f):
    def remove(self):
        # Weakref callbacks cannot raise exceptions or DOOM ensues
        try:
            f()
        except:
            logErrorNoMatterWhat()
        try:
            self = w()
            if self is not None:
                del self.data[k]
        except:
            logErrorNoMatterWhat()
    return remove

PROFILING = False

class FinalizingCache:
    """Possibly useful for infrastructure?  This would be a nice addition (or
    perhaps even replacement) for twisted.python.finalize.
    """
    def __init__(self):
        self.data = {}
        if not PROFILING:
            # see docstring for 'has'
            self.has = self.data.has_key

    def cache(self, key, value):
        fin = value.__finalizer__()
        assert key not in self.data, "Duplicate cache key: %r %r %r" % (key, value, self.data[key])
        self.data[key] = ref(value, createCacheRemoveCallback(
                ref(self), key, fin))
        return value

    def uncache(self, key, value):
        assert self.get(key) is value
        del self.data[key]

    def has(self, key):
        """Does the cache have this key?

        (This implementation is only used if the system is being profiled, due
        to bugs in Python's old profiler and its interaction with weakrefs.
        Set the module attribute PROFILING to True at startup for this.)
        """
        if key in self.data:
            o = self.data[key]()
            if o is None:
                del self.data[key]
                return False
            return True
        return False

    def get(self, key):
        o = self.data[key]()
        if o is None:
            raise CacheFault(
                "FinalizingCache has %r but its value is no more." % (key,))
        log.msg(interface=iaxiom.IStatEvent, stat_cache_hits=1, key=key)
        return o


:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0146 ]--