Esempio n. 1
0
def recache( methodname=None, filename=None ):
    """
    Deletes entries corresponding to methodname in filename. If no arguments are passed it recaches the entire table.

    :param str methodname: The name of the method to target. This will delete ALL entries this method appears in the stack trace for.
    :param str filename: The filename the method is executed in. (include .py extension)

    :rtype int: The number of deleted entries
    """
    if not methodname and not filename:
        hashes = get_unique_hashes()
        deleted = 0
        for hash in hashes:
            delete_io(hash)
            deleted = deleted + 1
    else:
        reqd_strings = []
        if methodname:
            reqd_strings.append( methodname )
        if filename:
            reqd_strings.append( filename )
        hashes = get_unique_hashes()
        deleted = 0
        for hash in hashes:
            cd = call_descriptor.fetch( hash )
            if all( [ s in cd.stack for s in reqd_strings ] ):
                delete_io( hash )
                deleted = deleted + 1
        return deleted
Esempio n. 2
0
def recache(methodname=None, filename=None):
    """
    Deletes entries corresponding to methodname in filename. If no arguments are passed it recaches the entire table.

    :param str methodname: The name of the method to target. This will delete ALL entries this method appears in the stack trace for.
    :param str filename: The filename the method is executed in. (include .py extension)

    :rtype int: The number of deleted entries
    """
    if not methodname and not filename:
        hashes = get_unique_hashes()
        deleted = 0
        for hash in hashes:
            delete_io(hash)
            deleted = deleted + 1
    else:
        reqd_strings = []
        if methodname:
            reqd_strings.append(methodname)
        if filename:
            reqd_strings.append(filename)
        hashes = get_unique_hashes()
        deleted = 0
        for hash in hashes:
            cd = call_descriptor.fetch(hash)
            if all([s in cd.stack for s in reqd_strings]):
                delete_io(hash)
                deleted = deleted + 1
        return deleted
Esempio n. 3
0
    def save( self ):
        """
        Save method for the CallDescriptor.

        If the CallDescriptor matches a past CallDescriptor it updates the existing
        database record corresponding to the hash. If it doesn't already exist it'll
        be INSERT'd.
        """
        packets = self.__enumerate_packets( )
        delete_io( self.hash )
        for packet in packets:
            packet['hash'] = self.hash
            insert_io( packet )

        return self # Supports chaining
Esempio n. 4
0
    def save( self ):
        """
        Save method for the CallDescriptor.

        If the CallDescriptor matches a past CallDescriptor it updates the existing
        database record corresponding to the hash. If it doesn't already exist it'll
        be INSERT'd.
        """
        packets = self.__enumerate_packets( )
        delete_io( self.hash )
        for packet in packets:
            packet['hash'] = self.hash
            insert_io( packet )

        return self # Supports chaining
Esempio n. 5
0
 def wrapper__delete_last_cached(self):
     """
     Deletes the last object that was cached by this instance of caliendo's Facade
     """
     return delete_io( self.last_cached )
Esempio n. 6
0
 def wrapper__delete_last_cached(self):
     """
     Deletes the last object that was cached by this instance of caliendo's Facade
     """
     return delete_io( self.last_cached )