Archive/Old Shell Version/camp_records.py
def _get_campers(self):
        "Create a table with a row for each camper and columns for the"
        "camper specific information."

        def priority(act, cell):
            if act in [c.strip() for c in cell.split(',')]:
                return 'P'
            return None

        def other(act, cell):
            if act in [c.strip() for c in cell.split(',')]:
                return 'Y'
            return 'N'

        try:
            # Start with just the camper fields.
            campers = self._norm[[I_REF, FAMILY]+CAMPER_FIELDS].copy()

            for activity in ACTIVITIES:
                pri_sequence = campers[PRI.format("")].copy().map(
                    functools.partial(priority, activity))
                other_sequence = campers[OTHER.format("")].copy().map(
                    functools.partial(other, activity))
                pri_sequence[pri_sequence != 'P'] = other_sequence
                campers[activity] = pri_sequence
        except:
            log.error("Failed to create camper table. "
                      "norm tables is {}.".format(
                          self._norm), exc_info=True)

        return campers
Create a table with a row for each camper and columns for the
Create a table with a row for each camper and columns for the
Create a table with a row for each camper and columns for the
def _get_campers(self):
        def priority(act, cell):
            if act in [c.strip() for c in cell.split(',')]:
                return 'P'
            return None
        def other(act, cell):
            if act in [c.strip() for c in cell.split(',')]:
                return 'Y'
            return 'N'
        try:
            campers = self._norm[[I_REF, FAMILY]+CAMPER_FIELDS].copy()
            for activity in ACTIVITIES:
                pri_sequence = campers[PRI.format("")].copy().map(
                    functools.partial(priority, activity))
                other_sequence = campers[OTHER.format("")].copy().map(
                    functools.partial(other, activity))
                pri_sequence[pri_sequence != 'P'] = other_sequence
                campers[activity] = pri_sequence
        except:
            log.error("Failed to create camper table. "
                      "norm tables is {}.".format(
                          self._norm), exc_info=True)
        return campers
def _get_campers ( self ) : "camper specific information." def priority ( act , cell ) : if act in [ c . strip ( ) for c in cell . split ( ',' ) ] : return 'P' return None def other ( act , cell ) : if act in [ c . strip ( ) for c in cell . split ( ',' ) ] : return 'Y' return 'N' try : campers = self . _norm [ [ I_REF , FAMILY ] + CAMPER_FIELDS ] . copy ( ) for activity in ACTIVITIES : pri_sequence = campers [ PRI . format ( "" ) ] . copy ( ) . map ( functools . partial ( priority , activity ) ) other_sequence = campers [ OTHER . format ( "" ) ] . copy ( ) . map ( functools . partial ( other , activity ) ) pri_sequence [ pri_sequence != 'P' ] = other_sequence campers [ activity ] = pri_sequence except : log . error ( "Failed to create camper table. " "norm tables is {}." . format ( self . _norm ) , exc_info = True ) return campers
Create a table with a row for each camper and columns for the
Create a table with a row for each camper and columns for the
"Create a table with a row for each camper and columns for the" "camper specific information." # Start with just the camper fields.
self