[Soci SLIP] Python

Davide Corio davide.corio a redomino.com
Gio 6 Apr 2006 17:06:28 CEST


Pių che mostrarti il pezzo di codice su cui sto lavorando :)

*********************************************************************
    security.declareProtected(ManagePortal, 'getChainForPortalType')
    def getChainForPortalType(self, pt_name, managescreen=0):

        """ Get a chain for a specific portal type.
        """
        if self._chains_by_type.has_key(pt_name):
            return self._chains_by_type[pt_name]
        else:
            # (Default) is _not_ a chain nor a workflow in a chain.
            if managescreen:
                return '(Default)'
            else:
                # Return the default chain.
                return self._default_chain
*********************************************************************

lo faccio diventare:

*********************************************************************
    security.declareProtected(ManagePortal, 'getChainForPortalType')
    def getChainForPortalType(self, pt_name, managescreen=0):

        """ Get a chain for a specific portal type.
        """
        import pdb; pdb.set_trace()
        if self._chains_by_type.has_key(pt_name):
            return self._chains_by_type[pt_name]
        else:
            # (Default) is _not_ a chain nor a workflow in a chain.
            if managescreen:
                return '(Default)'
            else:
                # Return the default chain.
                return self._default_chain
*********************************************************************


PDB č il mio migliore amico durante le giornate intense.
Quello che non so lo chiedo a lui :)

E' un debugger potente, ti permette di chiedere all'interprete che sta
facendo in quel momento...ovvero chiedere a lui che cosa pensavano gli
sviluppatori in quel momento :)

-- 
Davide Corio                                   davide.corio a redomino.com
Redomino S.r.l.            C.so Monte Grappa 90/b - 10145 Torino - Italy
Tel: +39 011 19502871 - Fax: +39 011 19791122 - http://www.redomino.com/
-------------- parte successiva --------------
Un allegato non testuale č stato rimosso....
Nome:        non disponibile
Tipo:        application/pgp-signature
Dimensione:  189 bytes
Descrizione: Questa parte del messaggio =?ISO-8859-1?Q?č?Url:         http://mailman.pinerolo.linux.it/pipermail/soci/attachments/20060406/5d2c827b/attachment.bin


Maggiori informazioni sulla lista Soci